https://wiki.archlinux.org/api.php?action=feedcontributions&user=MadCat+X&feedformat=atomArchWiki - User contributions [en]2024-03-28T11:10:28ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=IOS&diff=203625IOS2012-06-04T20:08:46Z<p>MadCat X: /* The iFuse Way */</p>
<hr />
<div>{{Lowercase_title}}<br />
[[Category:Sound]]<br />
{{i18n|IPod}}<br />
{{Article summary start}}<br />
{{Article summary text|<br />
The purpose of this article is to demonstrate the use of an iPod/idevices under Arch Linux.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Audiobook}}<br />
{{Article summary end}}<br />
<br />
{{Out of date|HAL has been deappreciated for a while now.}}<br />
<br />
=== Changing iPod Mountpoint ===<br />
<br />
HAL will mount an attached iPod to /media/<iPod name>. If the volume label of your iPod is long, or contains a mixture of spaces, and/or lower-case and capital letters, it may present an inconvenience. You may easily change the volume label for more expedient access using {{ic|mlabel}} from the {{ic|mtools}} package:<br />
<br />
* Get and confirm the current volume label:<br />
# mlabel -i /dev/sd''xx'' -s ::<br />
* Set the new volume label (as iPod)<br />
# mlabel -i /dev/sd''xx'' -s ::iPod<br />
Where ''/dev/sdxx'' is the current mountpoint of your iPod.<br />
<br />
HAL will now automount iPod to /media/iPod.<br />
<br />
== Importing videos and pictures ==<br />
<br />
Both videos and photos can be found in typically in `$mnt/DCIM/100APPLE`. My $mnt is /media/iphone.<br />
<br />
=== HTML5 videos ===<br />
<br />
Typically you want to convert MOV files to a HTML5 video format like OGV using ffmpeg2theora. Note that the creation date metadata is not in the converted video, so you need to use a script like:<br />
<br />
find -name "*.MOV" | while read mov<br />
do<br />
d=$(gst-discoverer-0.10 -v $mov | grep datetime: | awk '{print $2}' | tr -d \")<br />
base=${mov%.*}<br />
if test -f $base.ogv<br />
then<br />
touch -d${d} $base.ogv<br />
ls -l $base.ogv<br />
else<br />
echo $base.ogv missing<br />
fi<br />
done<br />
<br />
And use `cp -a` or `rsync -t` in order to preserve the filename's datetime.<br />
<br />
=== Importing pictures and deleting them ===<br />
<br />
You can move photos and videos out of `/media/iphone/DCIM/100APPLE`, however you need to trigger a rebuild of the "Camera Roll" database by deleting the old databases.<br />
<br />
PhotoData$ sudo rm Photos* com.apple.photos.caches_metadata.plist<br />
<br />
== Converting video for iPod ==<br />
=== Gen 5/5.5 ===<br />
==== DVD to iPod ====<br />
'''Get with:''' http://diveintomark.org/public/2007/06/podencoder.txt{{Linkrot|2012|01|23}}<br><br />
'''Depends on:''' aur/gpac mplayer<br />
<br />
Has detailed help, and is fairly self explanatory.<br />
<br />
Mirrored at http://src.iphitus.org/scripts/podencoder.txt{{Linkrot|2011|09|04}}<br />
<br />
An alternative is to use a method suggested at [DVD Ripping] then use one of the programs listed below to convert that to an iPod-friendly format.<br />
<br />
==== Video File to iPod ====<br />
'''Get with:''' http://src.iphitus.org/scripts/mp4ize.txt{{Linkrot|2011|09|04}}<br><br />
'''Depends on:''' mplayer<br />
<br />
I originally found this script here: http://thomer.com/howtos/ipod_video.html http://thomer.com/howtos/mp4ize <br />
It has been modified to properly handle filenames with unusual characters. Thanks to Thomer for the great script.<br />
<br />
=== Handbrake ===<br />
<br />
[http://handbrake.fr/ Handbrake] is a nifty tool with presets for a variety of iPod versions. A CLI version is available from pacman by:<br />
pacman -S handbrake<br />
or a version with a GTK interface is available in the [[AUR]]. See {{AUR|handbrake-gtk-svn}}<br />
The version within the package managers seem to be broken though (ie Handbrake version 0.9.3<br />
visit here http://forum.handbrake.fr/viewtopic.php?f=6&t=12464#p61835<br />
or here https://aur.archlinux.org/packages.php?ID=29320<br />
<br />
If you do decide to take the CLI way, a good guide is available at http://trac.handbrake.fr/wiki/CLIGuide,<br />
<br />
=== More Advanced/Configurable Methods ===<br />
<br />
==== Avidemux ====<br />
'''Get with:''' pacman -S avidemux<br />
<br />
This can convert to mp4 files. If you enforce a hard max of bitrate @ 700ish and keep the video size to 720x480 or 320x240 than it works fine for video file exporting.<br />
<br />
==== Mencoder ====<br />
<br />
'''Get with:''' pacman -S mplayer<br />
<br />
Has ''extremely'' comprehensive configuration support, which will be able to spit out iPod-compatible video files. Check out {{ic|man mencoder}}; a lot of mplayer opts will also affect encoding.<br />
<br />
A basic guide is also available at [[Mencoder]].<br />
<br />
An example command to encode iPhone/iPod Touch-compatible video:<br />
<br />
mencoder INPUT -o output.mp4 \<br />
-vf scale=480:-10,harddup \<br />
-oac faac -faacopts mpeg=4:object=2:raw:br=128 \<br />
-of lavf -lavfopts format=mp4 \<br />
-ovc x264 -x264encopts nocabac:level_idc=30:bframes=0<br />
<br />
==== FFMpeg ====<br />
<br />
'''Get with:''' pacman -S ffmpeg<br />
<br />
Another encoder with comprehensive configuration support. Example command to encode for 5G iPod:<br />
<br />
ffmpeg -vcodec xvid -b 300 -qmin 3 -qmax 5 -bufsize 4096 \<br />
-g 300 -acodec aac -ab 96 -i INPUT -s 320x240 \<br />
-aspect 4:3 output.mp4<br />
<br />
or iPod Touch/iPhone compatible video output:<br />
<br />
ffmpeg -f mp4 -vcodec mpeg4 -maxrate 1000 -b 700 -qmin 3 -qmax 5\<br />
-bufsize 4096 -g 300 -acodec aac -ab 192 -s 480×320 -aspect 4:3 -i INPUT output.mp4<br />
<br />
== iPhone/iPod Touch ==<br />
<br />
=== Introduction ===<br />
By default, neither the iPhone nor the iPod Touch present mass storage capability over USB, though there exist two solutions for accessing your files.<br />
<br />
The first is to mount your device through the FUSE filesystem SSHFS. This requires jailbreaking, which at the moment requires access to a computer running Mac OS or a recent version of Windows, and [http://www.quickpwn.com/ QuickPwn]. After jailbreaking, an SSH server will also need to be installed on the device, which can be done through the Cydia program, installed on the device during the jailbreak process.<br />
<br />
The second is to use a different FUSE filesystem called [http://www.libimobiledevice.org/ iFuse], which allows you to mount your device through USB, as you normally would. This method requires no hacking and is in general the better solution, though be aware that the software is still under heavy development. As of late, however, it has proven to be rather reliable and stable.<br />
<br />
Note: '''The current releases of libgpod and gtkpod from the "extra" repository support the iPod Touch and the Iphone OS 3.1.x up to iOS 4.3.x. It's possible to transfer pictures and music without limitations'''<br />
<br />
Refer to this page:[https://help.ubuntu.com/community/PortableDevices/iPhone]<br />
<br />
=== Making Friends with the Device ===<br />
<br />
==== The SSHFS Way ====<br />
<br />
After this the easiest way to properly initialise a few things on the device's side is with the [http://launchpad.net/ipod-convenience iPod convenience script]. This is available in the AUR as {{AUR|ipod-convenience}}<br />
<br />
Next do {{ic|modprobe fuse}} to actually load the fuse module. You may also want to add it to your MODULES array in /etc/rc.conf to have it loaded on boot.<br />
<br />
A few things may need changing in the script, depending on your setup. If you do not use sudo, replace:<br />
sudo lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf "FirewireGuid: 0x%s" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo<br />
with:<br />
su -c "lsusb -v -d 05ac: | grep iSerial | awk '{print $3}' | cut -b1-16 | xargs printf \"FirewireGuid: 0x%s\" >> $MOUNTPOINT/iTunes_Control/Device/SysInfo"<br />
in the file /usr/share/ipod-convenience/mount-umount. You may also need to replace:<br />
PROCESS=`ssh root@$IPADDRESS ps x | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
with:<br />
PROCESS=`ssh root@$IPADDRESS ps ax | grep MobileMusicPlayer | grep -v grep | awk '{print $1}'`<br />
(I'm not sure under what circumstances this is necessary; it was on my iPod Touch running 2.2.1, and it won't have any adverse affect under other firmware version)<br />
<br />
After that, edit the {{ic|/etc/default/ipod-convenience}} file with details of your device's IP address, and create the mount pount, which is {{ic|/media/ipod}} by default (make sure to set the permissions correctly if you want it accessible by a regular user)<br />
<br />
To actually mount the device, run {{ic|ipod-touch-mount}} or {{ic|iphone-mount}} (they both do exactly the same thing so it doesn't matter which). This should prompt for the root password of the device twice, which is 'alpine' by default in firmware versions 1.1 and up. This will need to be done every time you want to sync. (This can be done without having to type the password each time by using SSH keys - see [[Using SSH Keys]] for more information)<br />
<br />
==== The iFuse Way ====<br />
{{Note|If using an iPad/iPad2 that has a screen password, one must unlock the device to gain access through the USB interface.}}<br />
{{Note|The current version of ifuse is unable to mount an iPad2 using iOS v5.0.1.}}<br />
<br />
You will need to install '''usbmuxd''', '''libplist''', '''libimobiledevice''', '''ifuse'''. You can pull in all four with:<br />
# pacman -S ifuse<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in /etc/rc.conf already.<br />
<br />
You can now mount your device. Make sure it is unlocked before you plug it in, or it won't be recognized.<br />
# ifuse <mountpoint><br />
The mountpoint field is where you want to have it mounted.<br />
<br />
And you're done! You should be able to point your syncing software of choice to the mountpoint and be able to transfer files.<br />
<br />
To unmount your device:<br />
# umount <mountpoint><br />
<br />
You can also try adding this to your udev rules for automounting:<br />
{{hc|/etc/udev/rules.d/91-iOS-automount.rules|<nowiki><br />
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[13]/*", ENV{INTERFACE}=="255/*", ENV{dir_name}="ipod"<br />
SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[024]/*", ENV{INTERFACE}=="255/*", ENV{dir_name}="iphone"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[13]", ENV{dir_name}="ipod"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[024]", ENV{dir_name}="iphone"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129a", ENV{dir_name}="ipad"<br />
SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129f", ENV{dir_name}="ipad2"<br />
<br />
ACTION=="add", SUBSYSTEM=="usb", ATTR{idVendor}=="05ac", ATTR{idProduct}=="129[0-9]", RUN+="/bin/mkdir -p '/media/%E{dir_name}'", RUN+="/usr/bin/ifuse '/media/%E{dir_name}' -u '%s{serial}' -o sync,allow_other"<br />
ACTION=="remove", SUBSYSTEM=="usb", ENV{PRODUCT}=="5ac/129[0-9]/*", ENV{INTERFACE}=="255/*", RUN+="/bin/umount -l '/media/%E{dir_name}'", RUN+="/bin/rmdir '/media/%E{dir_name}'"</nowiki>}}<br />
<br />
{{Note|udev rules that automatically mount the device can interfere with Amarok 2. Using such rules might prevent Amarok from recognizing and mounting the device sometimes. See [https://bugs.kde.org/show_bug.cgi?id&#61;300958 bug 300958] on KDE bugzilla for more information, the general advice is to let Amarok handle this for you.}}<br />
<br />
==== Generating HashInfo file ====<br />
If you have not previously synced your device using iTunes specifically, you will get error messages telling you that the HashInfo file is missing. This can be fixed by making an iTunes installation on MacOS or Windows create it (by plugging in the iPod there). Alternatively you can create this file yourself, instructions can be found on [http://ihash.marcansoft.com/ this website].<br />
<br />
=== Unobfuscating the Database ===<br />
<br />
Since firmware version 2.0, Apple has obfuscated the music database. If you are using recent firmware, the file {{ic|/System/Library/Lockdown/Checkpoint.xml}} can be modified to enable use of the older, non-obfuscated database. Replace:<br />
<key>DBVersion</key><br />
<integer>4</integer><br />
with:<br />
<key>DBVersion</key><br />
<integer>2</integer><br />
Then reboot your device.<br />
<br />
If syncing fails with "ERROR: Unsupported checksum type '0' in cbk file generation!", you may need to leave this at 4. libgpod seems to [http://gitorious.org/libgpod/libgpod/blobs/b9b83dc8b6c3d1f0c53ed32f05279ca838d54e02/src/itdb_sqlite.c#line2064 expect a hashed database.]<br />
<br />
=== Syncing ===<br />
<br />
Use your favourite iPod-compatible program. Individual configuration will vary, but in general, pointing your program to your specified mount point should yield good results.<br />
<br />
After you've synced, run {{ic|ipod-touch-umount}} (or {{ic|iphone-umount}}, depending on your taste) to unmount the SSHFS file system and restart the {{ic|MobileMusicPlayer}} process on the device, so that the new music database is read.<br />
<br />
If you used iFuse, simply type:<br />
# umount <mountpoint><br />
You will still need to reload the MobileMusicPlayer process. If your device is not jailbroken, then you are stuck restarting it.<br />
<br />
=== The iFuse Way - iPhone OS 3.x and 4.x ===<br />
''Warning: this software is considered unstable and should probably not be used in a productive environment''<br />
<br />
Make sure you already installed base-devel, which contains several programs needed to compile your new components. If you did not, just run:<br />
<br />
# pacman -S base-devel<br />
<br />
which will install everything you will need.<br />
<br />
You will need to install {{Pkg|libplist}}, {{Pkg|libimobiledevice}}, {{Pkg|libgpod}}, {{Pkg|usbmuxd}} and {{Pkg|ifuse}}.<br />
<br />
Now make sure that you have the fuse module loaded by doing {{ic|modprobe fuse}}, assuming that you do not have it in /etc/rc.conf already.<br />
Check if the group "usbmux" has been created and add your user using<br />
# gpasswd -a <user> usbmux<br />
<br />
To make sure the new rules apply, execute<br />
$ udevadm control --reload-rules<br />
and plug in your iPod/iPhone. <br />
<br />
Run as ROOT:<br />
# usbmuxd<br />
Now you should the be able to mount your device by running<br />
$ ifuse ~/ipod<br />
or similar. Make sure the directory used exists and is accessible to your user.<br />
<br />
Mount the device and create the iTunes_Control/Device directory. Then, get your UUID. It should be in the syslog from usbmuxd, or you can find it by running <br />
$ lsusb -v | egrep "iSerial.*[a-f0-9]{40}"<br />
It should be 40 characters long. Then, run <br />
$ ipod-read-sysinfo-extended <uuid> <mountpoint>. <br />
This should generate a file named iTunes_Control/Device/SysInfoExtended.<br />
<br />
Now, start up your favourite app, it should detect the device via libgpod.<br />
I recommend using gtkpod-git for the time being, as that's what the libgpod devs seem to be using for debugging purposes.<br />
<br />
{{Note|If gtkpod/gtkpod-git seems to work only from root/sudo while your user only gets the slash screen, you can delete your ~/.gtkpod folder and retry. Note that gtkpod will forget your preferences.}}<br />
<br />
=== Rhythmbox ===<br />
<br />
Rhythmbox uses the Gnome Virtual File System to detect mobile devices. If using the iFuse way, gvfs-afc needs to be installed:<br />
# pacman -S gvfs-afc<br />
<br />
== iPod Classic/Nano3g ==<br />
<br />
You need to set up the iPod to make libgpod able to find its firewire id. For this, you will need to get your firewire id manually<br />
<br />
1) Mount the iPod as a rw mountpoint. In the following example, I will use /mnt/ipod.<br />
<br />
2 ) Find the serial number by typing<br />
<br />
sudo lsusb -v | grep -i Serial <br />
<br />
this should print a 16 character long string like 00A1234567891231 (it will have no colons or hyphens) <br />
<br />
3) Once you have that number, create or edit /mnt/ipod/iPod_Control/Device/SysInfo. Add to that file the line below:<br />
<br />
FirewireGuid: 0xffffffffffffffff<br />
<br />
(replace ffffffffffffffff with the 16 digit string you obtained at the previous step and do not forget the trailing 0x before the string)<br />
<br />
Your iPod can now be managed with amarok or gtkpod.<br />
<br />
== iPod management apps ==<br />
*[http://live.gnome.org/Rhythmbox Rhythmbox]<br />
**GTK interface (Gnome)<br />
**Is part of the official Gnome projects.<br />
**Fast, light interface.<br />
**Manage music on your computer and iPod<br />
**Download or stream podcasts and video podcasts<br />
**Queue up songs and podcasts<br />
**last.fm integration<br />
**Live radio stations<br />
**Jamendo and Magnatune support<br />
**Audio CD burning<br />
**Album cover display<br />
**Song lyrics display<br />
**DAAP sharing<br />
<br />
*[http://banshee.fm Banshee]<br />
**GTK interface (Gnome)<br />
**Uses Mono so it is slower and more resource hogging than rhythmbox<br />
**Device Sync: Sync your music and videos to your Android, iPod, or other device - or import its media<br />
**Podcasts: Download or stream podcasts and video podcasts<br />
**Play Queue: Queue up songs, videos, and podcasts, or let the Auto DJ take over<br />
**Shuffle Modes: Shuffle (or Auto DJ) by artist, album, rating, or even songs' acoustic similarity<br />
**Album Art: Artwork is automatically fetched as you listen<br />
**Powerful Search, Smart Playlists: Find exactly what you want, fast<br />
**Video Support: All the power of Banshee, now for your videos<br />
<br />
*[http://www.yamipod.com Yamipod]<br />
**GTK interface (Gnome)<br />
**super lightweight app for managing ONLY music on your iPod (not on your computer)<br />
**easy ratings edit<br />
**PC to iPod synchronization<br />
**News RSS and podcasts to iPod upload<br />
**Last.fm support <br />
**playlist support<br />
<br />
*[http://www.gtkpod.org gtkpod]<br />
**GTK interface (Gnome)<br />
**Read your existing iTunesDB (i.e. import the existing contents of your iPod including playcounts, ratings and on-the-go playlists).<br />
**Add MP3, WAV, M4A (non-protected AAC), M4B (audio book), podcasts, and various video files (single files, directories or existing playlists) to the **iPod. You need a third party product to download podcasts, like 'bashpodder' or 'gpodder'<br />
**View, add and modify Cover Art<br />
**Browse the contents of your local harddisk by album/artist/genre by adding all your songs to the 'local' database. From there the tracks can be **dragged over to the iPod/Shuffle easily.<br />
**Create and modify playlists, including smart playlists.<br />
**You can choose the charset the ID3 tags are encoded in from within gtkpod. The default is the charset currently used by your locale setting.<br />
**Extract tag information (artist, album, title...) from the filename if you supply a template.<br />
**Detect duplicates when adding songs (optional).<br />
**Remove and export tracks from your iPod.<br />
**Modify ID3 tags -- changes are also updated in the original file (optional).<br />
**Refresh ID3 tags from file (if you have changed the tags in the original file).<br />
**Sync directories.<br />
**Normalize the volume of your tracks (uses mp3gain or the replay-gain tag)<br />
**Write the updated iTunesDB and added songs to your iPod.<br />
**Work offline and synchronize your new playlists / songs with the iPod at a later time.<br />
**Export your korganizer/kaddressbook/thunderbird/evocalendar/evolution/webcalendar... data to the iPod (scripts for other programs can be added).<br />
<br />
*[http://www.floola.com Floola]<br />
**GTK interface (Gnome)<br />
<br />
*[http://amarok.kde.org/ Amarok]<br />
**KDE/qt interface<br />
<br />
*[http://qpod.sourceforge.net qPod]<br />
**KDE/qt interface<br />
**frontend for GNUpod<br />
<br />
*[http://www.gnu.org/software/gnupod/ GNUpod]<br />
**command-line only<br />
<br />
*[http://www.jakpod.de/ jakpod]<br />
** JakPod is based on Java and allows you to copy music and video files to your iPod.<br />
** iPod Nano 6th support<br />
** [https://aur.archlinux.org/packages.php?ID=56233 AUR package]<br />
<br />
== See also ==<br />
** [http://help.ubuntu.com/community/PortableDevices/iPhone More information about iPhone/iPod Touch support]<br />
** [http://wiki.gotux.net/code/perl/atget Apple trailers downloader script]</div>MadCat X