Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 67b97513c0f5f491320605834d1d9f26 > files > 16

gnupod-0.93-1mdk.noarch.rpm

\input texinfo @c -*-texinfo-*-

@setfilename gnupod.info
@settitle GNUpod Manual
@setchapternewpage odd
@finalout
@include version.texi

@copying
Copyright @copyright{} 2002, 2003 Adrian Ulrich

Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU Manual'',
and with the Back-Cover Texts as in (a) below.  A copy of the license
is included in the section entitled ``GNU Free Documentation License''.

(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
this GNU Manual, like GNU software.  Copies published by the Free
Software Foundation raise funds for GNU development.''
@end copying

@ifinfo
@dircategory GNU Packages
@direntry
* GNUpod: (gnupod).        Manage your iPod.
@end direntry
@end ifinfo

@titlepage
@title GNUpod
@subtitle Manage your iPod
@author Adrian Ulrich
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage


@node Top, Requirements, , (dir)
@ifinfo
@chapter GNUpod
This edition of the @cite{GNUpod Manual}, last updated @value{UPDATED},
documents GNUpod Version @value{VERSION}
@end ifinfo

@menu
* Requirements::                    What you will need to use GNUpod
* Installing GNUpod::               How to install GNUpod and setup FireWire
* Using GNUpod::                    How to use the GNUpod-tools
* Problems::                        The FAQ



Appendices

* GNU Free Documentation License::  This manual is under the GNU Free
                                    Documentation License.

@end menu



@c ===========================================================================================
@node Requirements, Installing GNUpod, Top, Top
@chapter Requirements
@cindex requirements
@cindex Solaris
@cindex Darwin

To use GNUpod, the follwing is needed:

@itemize @bullet
@item iPod (HFS+ or FAT32)
@item Firewire card that is supported by the Operating System
@item Write support for HFS+ or FAT32
@item Perl 5.6 or 5.8
@item The Perl modules MP3::Info, File::Copy, Unicode::String, and XML::Parser
@item Basic knowledge of the shell
@end itemize

GNUpod is known to run on GNU/Linux, FreeBSD, Darwin (Mac OSX) and Solaris 9.
@c ===========================================================================================



@c ===========================================================================================
@node Installing GNUpod, Using GNUpod, Requirements, Top
@chapter Installing GNUpod
@menu
* Installation of GNUpod::          How to install the Scripts
* Using FireWire with GNU/Linux::   Setup FireWire on Linux
* Convert your Mac iPod::           How to convert an HFS+ formatted iPod
* Firmware update::                 How to upgrade the Firmware using GNU/Linux
@end menu



@node Installation of GNUpod
@section Installation of GNUpod
@cindex installation

The installation of GNUpod is very simple:

@example
tar -xzvf gnupod-tools-VERSION.tar.gz
cd gnupod-tools/
./configure
make install
@end example

The @w{@code{configure}} script checks if the desired Perl modules are installed.

On Debian GNU/Linux you'll simply have to run this commands to install the required Perl modules:
@example
apt-get install libfile-ncopy-perl
apt-get install libmp3-info-perl
apt-get install libunicode-string-perl
apt-get install libxml-parser-perl
apt-get install libxml-simple-perl
@end example


If you are using a RPM-based Distribution (Mandrake, RedHat, SuSE..) try http://www.rpmfind.net.

Another way is to install the modules 'by hand'.

http://search.cpan.org 

will help you to find the needed tarballs.
If you don't know how to install them, please read 

http://cpan.org/misc/cpan-faq.html#How_install_Perl_modules



@node Using FireWire with GNU/Linux
@section Using FireWire with GNU/Linux

Of course the Linux kernel must support FireWire. If the one you are using doesn't have FireWire support you'll have 
to recompile your Kernel. (It's also a good idea to update the Kernel when you are doing this...)

If you don't know how to compile the Linux kernel, please read http://www.kernelnewbies.org/faq/index.php3#compile


To get FireWire working, you should configure the Kernel like this:

@itemize @bullet
@item Code maturity level options - y
@item IEEE1394 (FireWire)/IEEE 1394 (FireWire) support (Experimental) - y
@item OHCI-1394 support - m
@item SBP-2 support - m
@end itemize

Feel free to build OHCI-1394 into the kernel ('y'), but make sure to compile 
SBP-2 support as module. It won't work (good) if you say 'y' there!
If you don't own an OHCI-1394 FireWire card you may need to use the LYNX driver instead.
But OHCI-1394 is the most common used, please also have a look at http://www.linux1394.org

After you rebootet with the new Kernel, you should now be able to mount the iPod.
First load the OHCI-1394 module if you did say 'm' to OHCI-1394 support.
@example
modprobe ohci1394
@end example

Now plugin the iPod and wait until you can see the 'hook-symbol' and load the sbp2 module using
@example
modprobe sbp2
@end example

Please keep in mind that FireWire support is still experimental and you may see Kernel Oopses and other nasty things.
If your system hangs after loading sbp2 or mounting the iPod you may try to load sbp2 like this:
@example
modprobe sbp2 sbp2_max_speed=0 sbp2_serialize_io=1 sbp2_force_inquiry_hack=1
@end example

This will slow down the transfer rate but should act much more stable.
Note: The FireWire code of Linux 2.4.21 (and newer) seems to be much more 
stable: try to upgrade your kernel if you have crashes and oopses.


After loading sbp2, use @code{@w{dmesg}} to get some information, the output
should look like this (If you are running linux 2.4.20 or older)

@example
SBP-2 module load options:
- Max speed supported: S400
- Max sectors per I/O supported: 255
- Max outstanding commands supported: 8
- Max outstanding commands per lun supported: 1
- Serialized I/O (debug): no
- Exclusive login: yes
  Vendor: Apple     Model: iPod              Rev: 1.21
  Type:   Direct-Access                      ANSI SCSI revision: 02
Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
SCSI device sdb: 9780750 512-byte hdwr sectors (5008 MB)
sda: test WP failed, assume Write Enabled
 sda: sda1 sda2
@end example

In this case, @code{@w{/dev/sda}} would be your iPod.

Linux 2.4.21 (and newer) doesn't show such verbose output and your iPod 
won't get detectet when loading sbp2. Simply run @code{@w{rescan-scsi-bus.sh}} 
wich should find your iPod (See /proc/scsi/scsi). 
(You can download 'rescan-scsi-bus.sh' at http://www.garloff.de/kurt/linux/rescan-scsi-bus.sh)

You can now mount the iPod:
@example
mount -t vfat /dev/sda2 /mnt/ipod -o sync
@end example

It's a good idea to add a line like this to the fstab
@example
/dev/sda2   /mnt/ipod   vfat   defaults,user,noauto,sync,umask=000
@end example

Note: As you can see, we assume an FAT32/VFAT formatted iPod (@code{@w{-t
vfat}}), if you own a HFS+ formatted iPod (aka. Mac-iPod) please have a look at the 
next section 'Convert your Mac iPod' before using @code{@w{mount}}.


@node Convert your Mac iPod
@section Convert your Mac iPod

If the Operating System you are running doesn't have write support for HFS+ and your iPod is 
HFS+ Formatted (aka 'Mac-iPod') you will have to reformat the iPod.

Note: Linux 2.4.22 HAS Support for HFS+! 
It's still experimental and may do nasty things. 
If you build your kernel with HFS+ support, you don't have to convert your iPod :)


The first step is to upgrade your iPod to Firmware 1.1.0 or newer.
(YES: 1.1.0 can read FAT32, but Apple never shipped FAT32 formatted iPods with 1.1.0. 
Firmware 1.1.0 seems to use less power (has 1.20 a rtc problem?), but the name of the 
iPod won't show up in the 'Info' menu and it may crash on very large MP3 files. 

You can do this with Mac OSX using the Apple Firmware upgrader, it's aviable from:
http://www.apple.com/ipod/download/

If you don't own Mac OSX you can update the Mac-iPod using Linux.
Have a look at the next section to learn how to do this.

Also note that you will need a fdisk for DOS-Style partitions. The kernel you are running has also to support 
DOS-Style partitions (to access the device after you converted it) and Mac partitions (to read the firmware).
If you are using GNU/Linux on x86, your fdisk should be fine, but if you are running GNU/Linux on 
(for example) PowerPC you may have to get a suitable fdisk from the util-linux package wich can
be retrieved from: ftp://ftp.kernel.org/pub/linux/utils/util-linux/

Compile and install the pc-fdisk (and only the pc-fdisk!)
@example
tar -xjvf util-linux-X.XXx.tar.bz2
cd util-linux-X.XXx
./configure
cd fdisk
make
cp fdisk /usr/sbin/pc-fdisk
@end example


We assume your iPod at @code{@w{/dev/sda}}. (No, don't mount the iPod, simply plugin the iPod and make sure it
got detected with @code{@w{dmesg}}.

Here we go:

First, we 'backup' the current Firmware
@example
dd if=/dev/sda2 of=backup_firmware
@end example

This should result in a ~32Mb big file,now we have to kill the old partition map and force the kernel 
to re-read the new (empty) map
@example
dd if=/dev/zero of=/dev/sda bs=1M count=10
rmmod sbp2 && insmod sbp2
@end example

Now we can use 'pc-fdisk' to create a new partition layout:
@example
pc-fdisk /dev/sda [start fdisk]


Command (m for help): n [make new partition]
Command action
   e extended
   p primary partition (1-4)
p we want primary
Partition number (1-4): 1
First cylinder (1-608, default 1): [just press enter]
Using default value 1
Last cylinder or +size or +sizeM or +sizeK (1-608, default 608): +32M [32M is the default for 1.x iPods]

Command (m for help): n
Command action
   e extended
   p primary partition (1-4)
p
Partition number (1-4): 2
First cylinder (6-608, default 6): 6 [Just use the default value, press ENTER (don't worry if it isn't 6)]
Using default value 6
Last cylinder or +size or +sizeM or +sizeK (6-608, default 608): [press ENTER]
Using default value 608 [If you don't own a 5gb iPod, this value will be different, don't care about it]

Command (m for help): t [Modify type]
Partition number (1-4): 1
Hex code (type L to list codes): 0 [we don't care about the warning below]
Type 0 means free space to many systems
(but not to Linux). Having partitions of
type 0 is probably unwise. You can delete
a partition using the `d' command.
Changed system type of partition 1 to 0 (Empty)

Command (m for help): t
Partition number (1-4): 2 [this is where data will go]
Hex code (type L to list codes): b [b=FAT32]
Changed system type of partition 2 to b (Win95 FAT32)


Command (m for help): w [Writing new partition. Can take a while.]
The partition table has been altered!

Calling ioctl() to re-read partition table.
Syncing disks.
@end example

Note: The first partition doesn't have to be 32M, it just needs enought space to hold the firmware 
image (6M would be okay for firmware 130.bin).
Now we can rewrite the Firmwarebackup we created above.
@example
dd if=backup_firmware of=/dev/sda1
@end example

You may ask why we now write the Firmware to sda1 while we read it from sda2, the answear is simple:
Before running fdisk, the iPod was a Mac-iPod with a different Partition layout, but now the iPod is a Windows-iPod, belive me: sda1 
is correct.

After writing back the Firmware we can format the iPod:
@example
mkfs.vfat -F 32 -n "LUNIX" /dev/sda2
@end example

"LUNIX" is the name of the iPod, you can use another name if you like. After mkfs.vfat is done, we remove sbp2:
@example
rmmod sbp2
@end example

Unplug the iPod and pray. If everything went well, the iPod boots up :).
If not, reread this section, if you are lost, feel free to drop me a mail: bug-gnupod@@gnu.org


It's a good idea to edit @code{@w{/etc/fstab}} and add a line for the iPod:
@example
/dev/sda2    /mnt/ipod    vfat    noauto,user  0 0
@end example



@node Firmware update
@section Firmware update

** Don't update the Firmware just for fun, only do it if you need a 
new Firmware or/and the documentation told you to do this **


Setup Firewire as described in 'Using FireWire with GNU/Linux', load the modules and make sure sbp2 detected your iPod.
Do not try to mount the iPod. We assume your iPod at @code{@w{/dev/sda}}.

First you need to get a new Firmware wich you can download from http://www.iweenie.com/ipod.shtml

If you got a FAT32 formatted iPod (..or you plan to 'convert' the iPod after upgrading the Firmware), you'll need 
Version 1.1.0 or newer.

Let's say, you downloaded the File 121.zip (Firmware version 1.2.1), you'll have now to unzip this file.
Unzip should be preinstalled on most Systems (if not, you can get it from http://www.info-zip.org/pub/infozip/UnZip.html).

@example
unzip 121.zip 
Archive:  121.zip
  inflating: 121.bin  
@end example

Ok, we are now ready to write the new firmware to the iPod.

If your iPod is HFS+ Formatted (your kernel supports 'mac-style' partitions??), use
@example
dd if=121.bin of=/dev/sda2
@end example

to upgrade the Firmware. If you own a FAT32 Formatted (your kernel supports 'dos-style' partitions??) iPod, use
@example
dd if=121.bin of=/dev/sda1
@end example

After @code{@w{dd}} finished (it can take some time), remove sbp2
@example
rmmod sbp2
@end example

You can now unplug the iPod and pray ;)

It could be possible to damage the iPod with this action, but the iPod is very clever looking for new Firmware.
Even if you uploaded 121.zip to the iPod it shouldn't reflash itself with the bad
Firmware... (because the zip file wouldn't have a correct checksum) 

But please don't blame me if your iPod dies...
@c ===========================================================================================



@c ===========================================================================================
@node Using GNUpod, Problems, Installing GNUpod, Top
@chapter Using GNUpod
@menu
* Preparation::                     How to mount and prepare the iPod for GNUpod
* Add files::                       How to add MP3 files to the iPod
* Search files::                    How to search for files on the iPod
* Remove files::                    How to delete files on the iPod
* Creating playlists::              How to create a playlist
* Unplug the iPod::                 How to unplug the iPod (Not a joke.. read it)
* Recovering files::                How to rebuild the Database if you lost the iTunesDB & GNUtunesDB
* Coexistence::                     iTunes/Music Match/xtunes/Ehpod user? Read this!
@end menu


@node Preparation
@section Preparation

Mount the iPod (i assume you mount it at /mnt/ipod) as described in 'Using FireWire with GNUpod'

If the iPod is freshly formatted or you never used GNUpod before with this iPod, run
@example
gnupod_INIT.pl -m /mnt/ipod
@end example

gnupod_INIT.pl will create the default directory tree and creates an empty GNUtunesDB 
(or if it finds an iTunesDB, it runs tunes2pod.pl to convert the iTunesDB to an GNUtunesDB)

Use
@example
gnupod_INIT.pl -m /mnt/ipod --france
@end example

if you would like to enable the 'EU-Volume-Limit' (=decrase max. volume).
This only works for iPods running Firmware 1.x

Your iPod is now ready for GNUpod!


@node Add files
@section Add files

To add files, we use the script called @code{@w{gnupod_addsong.pl}}.

First, mount the iPod (eg. at /mnt/ipod) if it isn't mounted.

If you would like to add the file /tmp/foo.mp3, run gnupod_addsong.pl like this:
@example
gnupod_addsong.pl -m /mnt/ipod /tmp/foo.mp3
@end example

You can also use wildcards:
@example
gnupod_addsong.pl -m /mnt/ipod /mnt/mp3/seiken_densetsu2_ost/* /mnt/mp3/xenogears/ost?/*
@end example

It isn't possible to add the same MP3 multiple times, gnupod_addsong.pl detects duplicates 
(Duplicate = same filesize/time and ID3Tag name).

Note: gnupod_addsong.pl will try to 'auto-detect' the encoding of the ID3 Tag. 
Sometimes this works (in most cases ;) ) sometimes it doesn't. If it doesn't work for you, 
feel free do send me an example-file: pab@@blinkenligts.ch


DO NOT umount the iPod yet! First read the section 'Unplug the iPod'!


@node Search files
@section Search files

GNUpod includes a tool called @code{@w{gnupod_search.pl}} wich helps you searching for files.

Maybe you would like to search for the artist called 'Schlummiguch'. In this case, run
@example
gnupod_search.pl -m /mnt/ipod -a "Schlummiguch"
@end example

Note: gnupod_search.pl assumes RegExp input.
Please have a look at @code{@w{gnupod_search.pl --help}} for more information.

@node Remove files
@section Remove files

Removing files is done using @code{@w{gnupod_search.pl -d}}.
To Remove all files from the artist 'Schlummiguch', run
@example
gnupod_search.pl -m /mnt/ipod -a "Schlummiguch" -d
@end example


@node Creating playlists
@section Creating playlists

Open the file @code{@w{iPod_Control/.gnupod/GNUtunesDB}} in a editor (It's a XML File).

To create a playlist named 'sweet' wich holds the songs with the ID 1 and 2, create something like this:
@example
<playlist name="sweet">
 <add id="1" />
 <add id="2" />
</playlist>
@end example


You are not limited to use 'id', you can also use other attributes:
@example
<playist name="bogus">
 <add album="seiken densetsu" bitrate="256" />
</playlist>
@end example
This would add every song from the album 'Seiken Densetsu' (<add.. is case INsensitive) with a bitrate of 256kbit/s.

Since GNUpod 0.26 it's also possible to use Regular Expressions (Regex).
See @code{@w{perldoc perlre}} to learn more about this

@example
<playlist name="Regex Demo">
 <regex album="^A" />
 <iregex album="^b" />
</playlist>
@end example 

<regex is case sensitive, use <iregex to do case insensitive matching.

For more examples have a look at @code{@w{doc/gnutunesdb.example}} included in the GNUpod tarball.

Don't forget to run mktunes before umounting! (See 'Unplug the iPod')

@node Unplug the iPod
@section Unplug the iPod

Before umounting the iPod, you have to call @code{@w{mktunes.pl}} wich will 
parse the GNUtunesDB XML file and convert it into the iTunesDB format.

Simply run
@example
mktunes.pl -m /mnt/ipod
@end example

Note: Since GNUpod 0.91, mktunes.pl has a '--volume' option wich you can use to 
boost the Volume.

@example
mktunes.pl -m /mnt/ipod --volume 40
@end example

This would adjust the volume +40 percent. (You can also use '-100' to get 
a silent iPod ;) )

After @code{@w{mktunes.pl}} is done, you can umount the iPod and remove the sbp2 module
@example
umount /mnt/ipod
rmmod sbp2
@end example

Added songs won't be visible on the iPod if you did not run mktunes.pl before umounting the iPod. 
(If you forgot to run @code{@w{mktunes.pl}} before unpluging/umounting, simply mount the iPod again and run it)


@node Recovering files
@section Recovering files

If you lost your iTunesDB and your GNUtunesDB, your iPod won't know anymore wich songs are on it, this 
very good ;)

You can 'rebuild' an GNUtunesDB using @code{gnupod_addsong.pl}

@example
gnupod_addsong.pl --restore -m /mnt/ipod
@end example

First, @code{gnupod_INIT.pl} will create a clean, empty GNUtunesDB, it won't delete any songs on the iPod.
@code{gnupod_addsong.pl --restore} will re-create a GNUtunesDB including the Songs wich are on the iPod

I think nobody will ever have to do this.. but it maybe usefull to know that it's possible
(Note: Of course you'll lose your Playlists)

@node Coexistence
@section Coexistence

GNUpod can coexist with iTunes and other programs for the iPod.

If you want to use an iPod with GNUpod and used something other than GNUpod (maybe iTunes)
 to perform the last update (adding songs, editing playists.. doing something..), you'll have to
 use @code{@w{tunes2pod.pl}} to update the (outdatet) GNUtunesDB.

Mount the iPod and run 
@example
tunes2pod.pl -m /mnt/ipod
@end example

The iPod is now ready again for GNUpod.

You have to do this because GNUpod stores it's information in the GNUtunesDB, other programs are accessing the 
iTunesDB directly. After you did something with eg. iTunes, the GNUtunesDB would be 'outdatet' and you would 
lose any changes you made with iTunes. Running @code{@w{tunes2pod.pl}} will write a new GNUtunesDB wich
reflects the content of the current iTunesDB.


You sould avoid the use of 'extended playlist support' if you use your iPod with other programs.

The Playlist part of this file...
@example
<files>
<file id="1" title="hello" album="foo"..
<file id="2" title="boing" album="foo"..
</files>
<playlist name="extended">
 <add album="foo" />
</playlist>
@end example

..would look like this after using tunes2pod.pl
@example
...
<playist name="extended">
 <add id="1" />
 <add id="2" />
</playlist>
@end example

The songs are still in the playlists, but the expressions you wrote are 'lost'.
@c ===========================================================================================


@c ===========================================================================================
@node Problems, GNU Free Documentation License, Using GNUpod, Top
@chapter Problems

@menu
* GNUtunesDB::                      What is the GNUtunesDB?
* Get rid of '-m'::                 You don't like the -m switch?
* Known bugs and limitations::      GNUpod isn't perfect :)
* Reporting Bugs::                  How to report a Bug
@end menu

@node GNUtunesDB
@section GNUtunesDB

We talked alot about the 'GNUtunesDB' and the 'iTunesDB' files, but 
why do we need this two files and what's the difference ?

Well, you can find the iTunesDB on your iPod at @code{@w{iPod_Control/iTunes/iTunesDB}} .
This file is read by the iPod when you 'boot' the device.
The iTunesDB is a small Database and stores information about all MP3s on the iPod 
(Title, Artist, Path, Bitrate...) and all Playlists: everything the iPod needs to know.

The iTunesDB is a proprietary file format created by Apple.

The GNUtunesDB (@code{@w{iPod_Control/.gnupod/GNUtunesDB}}) holds the same information like 
the iTunesDB, but it's a simple XML file: easy to understand by humans and easy to edit by hand.

Everytime you run @code{@w{tunes2pod.pl}}, the iTunesDB will get parsed and converted into an 
XML File (the GNUtunesDB). 
@code{@w{mktunes.pl}} does the opposite: it parses the XML file and creates an iTunesDB (for the 
iPod and iTunes)

Only mktunes.pl and tunes2pod.pl have to worry about the iTunesDB format: all other tools 
(gnupod_addsong.pl for example) only have to deal with the XML file called GNUtunesDB.

It's important to keep the iTunesDB and GNUtunesDB 'in sync', so everytime you changed the 
GNUtunesDB (by hand or using gnupod_something.pl) you'll have to run @code{@w{mktunes.pl}}.

If 'you' changed the iTunesDB (using gtkPod/iTunes/Ehpod), run @code{@w{tunes2pod.pl}} *before* 
using any other GNUpod commands.


@node Get rid of '-m'
@section Get rid of '-m'

You don't have to use the '-m' switch if you set IPOD_MOUNTPOINT.
(Example for the BASH)
@example
export IPOD_MOUNTPOINT="/mnt/ipod"
@end example


@node Known bugs and limitations
@section Known bugs and limitations

@itemize @bullet
@item Smartplaylist support is incomplete (No liveupdate)
@item You can't add m4a (AAC) files atm
@end itemize


@node Reporting Bugs
@section Reporting Bugs

To report a bug, send a mail to bug-gnupod@@gnu.org

Include as much information as possible.

You may want to attach the files iPod_Control/.gnupod/GNUtunesDB and iPod_Control/iTunes/iTunesDB.
But please use gzip or bzip2 to compress the files.

Please do not send me any mp3 files without asking me.
@c ===========================================================================================




@node GNU Free Documentation License, , Problems, Top
@include fdl.texi




@printindex cp
@shortcontents
@contents
@bye
@c gnupod.texi ends here