2017-12-21 Rockbox on the iPod

Rockbox is a free alternative to iTunes for all sorts of devices including the iPods.

First step: identifying my iPod. Using the Apple support page I conclude that my model is the iPod classic. On the back of my iPod I can see “80GB”, model no. A1238 and a serial no. ending in YMV.

If you’re on macOS with the same model, read on.

Or maybe just skip to the section “Too Long, Did Not Read.”

I need to convert the iPod to FAT32 and have no Windows available. I downloaded the partition table for “80GB Video (2048-byte sectors)”.

I connected the iPod using the USB cable and shut down iTunes. The command line utility diskutil list doesn’t list the iPod so I assume it isn’t mounted. But since the next command I must issue is dd if=mbr-xxxx.bin of=/dev/diskN and I have no disk listed, I unplug the iPod and plug it back in, it gets mounted, iTunes starts, and diskutil list shows me the iPod:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *79.8 GB    disk3
   1:        Apple_partition_map                         254.0 KB   disk3s1
   2:                  Apple_HFS Alex Schröder’s iPod    79.8 GB    disk3s2

I issue the command sudo dd if=mbr-video80gb-2048.bin of=/dev/disk3. But either iTunes is busy and I’m getting the error dd: failed to open '/dev/disk3': Resource busy or iTunes quits, the iPod unmounts and I get the error dd: failed to open '/dev/disk3': Operation not permitted.

I tried to check “Enable disk use” for the iPod in iTunes. I’m not sure it made a difference. Perhaps it just gave me more time to switch to DiskUtility and “Unmount” the disk without ejecting it. Finally, sudo dd if=mbr-video80gb-2048.bin of=/dev/disk3 succeeded.

1+0 records in
1+0 records out
512 bytes copied, 0.007105 s, 72.1 kB/s

Now to make a new filesystem: sudo newfs_msdos -F 32 -S 2048 -v iPod /dev/rdisk3s2. This didn’t work. I tried the “Erase” menu in DiskUtility and that didn’t work either, giving me an error and showing me two disks instead of one: disk3s1 and disk3s2. I unplugged the iPod and plugged it again, situation unchanged. I then tried to erase disk3s1 and that didn’t work, then I tried to erase disk3s2 and that worked. It now has the MS-DOS (FAT) format.

This is what diskutil list print, now:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     Apple_partition_scheme                        *79.8 GB    disk3
   1:        Apple_partition_map                         254.0 KB   disk3s1
   2:                 DOS_FAT_32 JAKKU                   79.7 GB    disk3s3

So now I’m ready to start RockboxUtility again. I’m in the configuration screen and where it says “Select your device in the filesystem” I can pick the iPod I just formatted, /Volumes/JAKKU. I also pick AppleIpod Video (5th gen) (Stable). The “Autodetect” button does nothing. Click OK, click Install.

Sadly, I’m getting three “Could not open Ipod: permission denied” errors. So I restarted the app with root permissions: sudo /Applications/RockboxUtility.app/Contents/MacOS/RockboxUtility. This got me a different error: Error reading partition table - possibly not an Ipod.

I guess I’m off to section 2.2.2 of the manual, “Manual Installation”. I downloaded rockbox-ipodvideo-3.14.zip from Rockbox Manual Install.

cd /Volumes/JAKKU/
unzip /Users/alex/Desktop/rockbox-ipodvideo-3.14.zip

This gives me a directory called iPod_Control and a hidden directory called .rockbox on the iPod.

I downloaded the ipodpatcher and ran it from the terminal:

cd
./Desktop/ipodpatcher

OK, permission problems!

ipodpatcher 5.0 with v4.0 bootloaders (v1.0 for 2nd Gen Nano)
(C) Dave Chapman 2006-2009
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[INFO] Scanning disk devices...
[ERR]  FATAL: Permission denied on 3 device(s) and no ipod detected.
[ERR]  You need permissions for raw disc access for this program to work!

Press ENTER to exit ipodpatcher :

Try again, with sudo.

ipodpatcher 5.0 with v4.0 bootloaders (v1.0 for 2nd Gen Nano)
(C) Dave Chapman 2006-2009
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

[INFO] Scanning disk devices...
[ERR]  No ipods found, aborting
[ERR]  Please connect your ipod and ensure it is in disk mode
[ERR]  Also ensure that itunes is closed, and that your ipod is not mounted.
[ERR]  Please refer to the Rockbox manual if you continue to have problems.

Press ENTER to exit ipodpatcher :

This makes me sad.

Well, I decided to try again: sudo /Applications/RockboxUtility.app/Contents/MacOS/RockboxUtility. This time it worked! The first checkbox (”Bootloader”) was no longer checked. Wow.

I unplugged the iPod and forced a reset by holding Menu and Select simultaneously for a couple of seconds until the player resets. Now Rockbox should load. But it doesn’t! I got the “new iPod” language selection and the default iPod interface.

And there’s the problem: when check the “Bootloader” menu, I still get the errors (Error reading partition table - possibly not an Ipod). So the bootloader still isn’t installed. When I go to the “Backup & Uninstallation” Tab and click “Remove the bootloader” I get the error No Rockbox bootloader found.

Looking at the output while the RockboxUtility is running, this seems to be the relevant section:

[selectiveinstallwidget.cpp:229 INFO] installing bootloader 
[rbsettings.cpp:162 INFO] GET U: "platform" "ipodvideo" 
[rbsettings.cpp:162 INFO] GET U: "platform" "ipodvideo" 
[systeminfo.cpp:93 INFO] GET: "ipodvideo/bootloadermethod" "ipod" 
[httpget.cpp:82 INFO] setting cache folder to "/var/folders/wy/wyh0lwx913j52rv15cszkfjm0000gp/T/rbutil-cache" 
[rbsettings.cpp:162 INFO] GET U: "platform" "ipodvideo" 
[systeminfo.cpp:93 INFO] GET: "ipodvideo/bootloaderfile" "" 
[rbsettings.cpp:162 INFO] GET U: "mountpoint" "/Volumes/JAKKU" 
[utils.cpp:129 INFO] resolving path "/Volumes/JAKKU" -> "/Volumes/JAKKU" 
[rbsettings.cpp:162 INFO] GET U: "platform" "ipodvideo" 
[systeminfo.cpp:93 INFO] GET: "ipodvideo/bootloadername" "/ipod/bootloader-ipodvideo.ipod" 
[rbsettings.cpp:162 INFO] GET U: "platform" "ipodvideo" 
[systeminfo.cpp:93 INFO] GET: "bootloader_url" "http://download.rockbox.org/bootloader" 
[rbsettings.cpp:162 INFO] GET U: "mountpoint" "/Volumes/JAKKU" 
[utils.cpp:422 INFO] resolving device name "/Volumes/JAKKU" 
[utils.cpp:457 INFO] device name is /dev/disk3s3 
[bootloaderinstallipod.cpp:240 INFO] ipodpatcher: overriding scan, using /dev/disk3 
[bootloaderinstallipod.cpp:195 INFO] installed: BootloaderUnknown 
[utils.cpp:422 INFO] resolving device name "/Volumes/JAKKU" 
[utils.cpp:457 INFO] device name is /dev/disk3s3 
[bootloaderinstallipod.cpp:240 INFO] ipodpatcher: overriding scan, using /dev/disk3 
[bootloaderinstallipod.cpp:195 INFO] installed: BootloaderUnknown 
[utils.cpp:422 INFO] resolving device name "/Volumes/JAKKU" 
[utils.cpp:457 INFO] device name is /dev/disk3s3 
[bootloaderinstallipod.cpp:240 INFO] ipodpatcher: overriding scan, using /dev/disk3 
[selectiveinstallwidget.cpp:195 INFO] continuing install with stage 1 
[selectiveinstallwidget.cpp:197 ERROR] Last part returned error. 

OK, perhaps I just need to try this 6G stuff. On to this page. Still using the same RockboxUtility, change device, check “Show disabled targets”, pick “Apple Ipod Classic (6th gen) (Unknown)”. So now I’m going to get the Rockbox “Developmental Version (Revision d35a18f)”. Bootloader is unchecked, click Install, click OK (because the device has changed).

Download bootloader-ipod6g.ipod, download mks5lboot. All this binary stuff and root permissions, this hurts. Make sure libusb is installed (brew install libusb). Yes it is. Start ActivityMonitor and force quit the two iTunes services running. Run chmod +x mks5lboot and then sudo ./mks5lboot --dfuscan -l. Do the DFU dance. mks5lboot now reports:

[INFO] libusb: found [05ac:1223] at bus 36, device 2, USB ver. 0200
[INFO] DFU device state: 2

And finally: sudo ./mks5lboot --bl-inst bootloader-ipod6g.ipod. And there are strange beeps! The iPod reboot with something that looks like four lines of terminal output. It says: Bootloader USB mode. And macOS says that it didn’t recognize the disk and did I want to initialize it? No I don’t!

OK, restarting it.

Rockbox boot loader
Version 1.0
Battery status ok: 4001 mV
No partition found

Entering USB mode...
Plug USB cable

No partition found? This doesn’t look good. Plugging cable. Looks like I need to format it again? Rebooting the iPod with the cable connected. macOS offers to initialize the disk. Agree to that and DiskUtility starts. I see disk3s1 (79.82 GB, Windows FAT 32, looking good) and disk3s2 (201.3 MB, type 0x3F).

This doesn’t look so bad?

I’m going to pick disk3s1 and erase it, giving it the name JAKKU and the format MS-DOS (FAT). This fails: POSIX reports: The operation couldn’t be completed. Invalid argument. Oh wow.

Let’s check out the command line, diskutil list:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *80.0 GB    disk3
   1:                       0x3F                         201.3 MB   disk3s1
   2:                 DOS_FAT_32                         79.8 GB    disk3s2

Sadly, diskutil mountdisk /dev/disk3 and diskutil mount /dev/disk3s2 both don’t work.

OK, going hardcore: diskutil eraseDisk FAT32 JAKKU disk3.

Started erase on disk3
Unmounting disk
Creating the partition map
Waiting for partitions to activate
Formatting disk3s2 as MS-DOS (FAT32) with name JAKKU
4096 bytes per physical sector
/dev/rdisk3s2: 19455824 sectors in 2431978 FAT32 clusters (32768 bytes/cluster)
bps=4096 spc=8 res=32 nft=2 mid=0xf8 spt=32 hds=255 hid=77056 drv=0x80 bsec=19460608 bspf=2375 rdcl=2 infs=1 bkbs=6
Mounting disk
Finished erase on disk3

The new output of diskutil list:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:      GUID_partition_scheme                        *80.0 GB    disk3
   1:                        EFI EFI                     314.6 MB   disk3s1
   2:       Microsoft Basic Data JAKKU                   79.7 GB    disk3s2

“Microsoft Basic Data”. How strange!

OK, returning to RockboxUtility and trying to install stuff. Seems to have worked! Ejecting iPod, and forcing a reboot.

The situation remains unchanged:

Rockbox boot loader
Version 1.0
Battery status ok: 4005 mV
No partition found

Entering USB mode...
Plug USB cable

Fuuuuuh! 😠

Now what? Connecting the cable. There is a /Volumes/JAKKU/.rockbox directory.

Too Long, Did Not Read

OK, restarting at the beginning. Remember I had already downloaded the following:

  1. mbr-video80gb-2048.bin
  2. mks5lboot
  3. bootloader-ipod6g.ipod
  4. and I installed libusb via brew
  5. and I have the installer (RockboxUtility) installed

Quickly run through it all. Remember that on my system the iPod is on disk3. Use diskutil list to figure out, where it is on your system.

diskutil unmountdisk disk3
sudo dd if=mbr-video80gb-2048.bin of=/dev/disk3
sudo newfs_msdos -F 32 -S 2048 -v iPod /dev/disk3s2 

diskutil list output now:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *80.0 GB    disk3
   1:                 DOS_FAT_32                         79.8 GB    disk3s2

Attempt diskutil mountdisk disk3 which fails. But diskutil list output now:

/dev/disk3 (external, physical):
   #:                       TYPE NAME                    SIZE       IDENTIFIER
   0:     FDisk_partition_scheme                        *80.0 GB    disk3
   1:                 DOS_FAT_32 IPOD                    79.8 GB    disk3s2

This means that the volume is now available in DiskUtility as IPOD. Erase it, picking MS-DOS (FAT) as the format. diskutil list output remains unchanged.

Run sudo ./mks5lboot --dfuscan -l. Do the DFU dance (set Hold, wait a second, remove Hold, press Menu and Select for twelve seconds and the mks5lboot output shows a DFU device).

Run sudo ./mks5lboot --bl-inst bootloader-ipod6g.ipod. It beeps, reboots, and says Can't load rockbox.ipod: File not found.

Start sudo /Applications/RockboxUtility.app/Contents/MacOS/RockboxUtility and set Mountpoint to /Volumes/IPOD and device to “Apple Ipod Classic (6th gen) (Unknown)”, the Bootloader checkbox is unchecked. Click Install. Everything seems to work.

Unplug the cable. Reboot the iPod by holding Menu and Select for a few seconds.

It reboots into Rockbox!!

Plugging the cable again. Picking 80G of music for this baby...

When connecting the iPod to a speaker via USB cable, keep any key pressed in order to prevent the iPod from switching into USB mode. Playback works via audio out, so you need a second cable. (Let me know if this is not required.)

I found that the iPod draws so much power when indexing the database that I ended up in an unusable state.

I wanted to initialize the Rockbox database while playing some music on this very old iPod and this apparently draws so much current that the iPod ended up power cycling: it kept shutting down because battery was low, and then it kept coming back up again. I finally thought of holding Select and Pause/Play while booting. I ended up in some sort of “waiting for iTunes to restore the system” mode. I think I need to let it charge for a bit before trying again. What a weird problem to have.

As it turned out, all the iPod, iPad and iPhone chargers I found in the kitchen don’t work. I had to hook it up to the laptop before the iPod was able to index the files.

I just hope that doesn’t happen when I try to play music...

Tags:

Comments


Please make sure you contribute only your own work, or work licensed under the GNU Free Documentation License. See Info for text formatting rules. You can edit the comment page if you need to fix typos. You can subscribe to new comments by email without leaving a comment.

To save this page you must answer this question:

Please say HELLO.