iRiver T10

I bought a new MP3 player a few days ago. Its one of those Windows Media Player “Plays for sure” devices which uses Microsoft’s media transfer protocol. On Linux there is libmtp but I would much rather have a USB mass storage devices that I can copy files to and from on any computer. Luckily the iRiver lets you change to UMS (USB mass storage) through a firmware upgrade. Of course the firmware updater program requires a Windows XP machine with WMP 10 installed. Once the firmware update is complete, its back to Linux.

The main reason I bought this player is because it has long (45 hour) battery life and Ogg support. I wonder why iRiver makes the default firmware require WMP 10 when that terrible program doesn’t even support Ogg? I mean if someone was really going to make use of the Ogg support, they won’t be the kind of person who uses WMP.

One problem I had with the player — and all other UMS players is that you — can put files in folders, but within each folder the songs are not listed alphabetically. Instead they are listed in the order you copied them to the player (presumably is just grabs the lowest disk address first). This is a problem because now all my albums play in the wrong order, unless I meticulously add them in the correct order.

As a UMS, this iRiver T10 does not support any regular playlist formats. I’m pretty sure on Windows using MTP you can add playlists, but on Linux using UMS you’re kinda stuck. No m3u or pls or any other kind of XML. However it does have this “QuickList” feature which lets you hold down a button and add the currently playing song to a playlist, like the iPod’s “On-The-Go” playlist.

So after making one of these I got the idea that I could make playlists and put all my songs in the correct order. But that would mean using the T10 interface then stopping, plugging in and transferring the playlist data somewhere else on the drive so I could create another one. Instead I just opened the playlist up in my trusty hex editor and reverse engineered it.

Luckily the iRiver playlists (*.pla) are not difficult to understand. They have a 512 byte header, followed by the paths for each song relative to the root of the drive. Each path takes up 512 bytes (the ascii data followed by null characters). For some reason every second byte throughout the whole file is 0x00. Is this UTF-16 and I am just using non-complex characters?

Anyway, I put it all in a python script. To make a playlist of the entire folder in alphabetical order just do:

ls | ./iRiverPlaMaker.py MyPlaylist.pla

You should run this on the iRiver disk so all the paths are correct and correspond to the root of the disk.

  1. says:

    Hi, just a thank you for providing this script which I have used to produce playlist files for my iriver s10 which uses the same format. I have made a few tweaks to the script to get the list displayed properly. My version can be found at http://wiki.bath.ac.uk/display/~ma9mjo/iRiver+s10

  2. mario says:

    Hi, i have written a new Playlistgenerator from scratch which does automatic parsing of Musicdirs and automatically create the needed playlists. It can be found here:

    http://freenet-homepage.de/wehbrink/source/iRiverPlaMaker3.py

  3. Anonymous says:

    but it doesn’t work with special characters (like spanish accents)

    \Music\cantautor\silvio\Esto no es una elegĂ­a.mp3
    Traceback (most recent call last):
    File “iRiverPlaMaker3.py”, line 122, in ?
    main()
    File “iRiverPlaMaker3.py”, line 115, in main
    playlist.addSong(“/”+root+”/”+file)
    File “iRiverPlaMaker3.py”, line 55, in addSong
    song = struct.pack(‘>H510s’,len(path)+2,name.encode(‘utf-16-be’))
    UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xc3 in position 43: ordinal not in range(128)

  4. Mario says:

    Fixed (more or less)

    it now works with most special characters. Tell me, if more problems exist. I will try to fix them.

    http://freenet-homepage.de/wehbrink/source/iRiverPlaMaker3.py

  5. Mario says:

    Fixed (more or less)

    Should work with most special characters now. Blame iriver for their strange mix of UTF8/UTF-16. Tell me, if more problems exist. I will try to fix them.

    http://freenet-homepage.de/wehbrink/source/iRiverPlaMaker3.py

  6. Andre says:

    Thank you. It saves me!

  1. There are no trackbacks for this post yet.