Playlist format for iriver T50

This unofficial specification should make it easy to create iriver T50-compatible playlists without the player-accompanied Windows software. It is also compatible with S10, for which Martin Owen had already written a practically identical spec. It is also compatible with E100 and T20, but not compatible with T7. Thanks to David Musgrave, Hanno Hecker, and Jan Kasprzak for reporting these.

The playlist format is very simple. A conforming playlist file consists of 1+N null-padded 512-byte frames, where N is the number of songs in the playlist. The first frame is a header, and the rest are song frames. The header starts with a 32-bit integer specifying N. Immediately after that there is an ASCII string iriver UMS PLA, and that’s all for the header frame. Example:

00000000  00 00 00 0b 69 72 69 76  65 72 20 55 4d 53 20 50  |....iriver UMS P|
00000010  4c 41 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |LA..............|
00000020  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000200  00 1d 00 5c 00 4d 00 75  00 73 00 69 00 63 00 5c  |...\.M.u.s.i.c.\|

This playlist has 11 songs (00 00 00 0b). The byte ordering is always big-endian. The frame is padded with zero bytes to contain exactly 512 bytes.

In addition, the player’s own Quick Lists have an apparently superfluous extra ASCII string Quick List in the header frame, starting from 0x20:

00000000  00 00 00 02 69 72 69 76  65 72 20 55 4d 53 20 50  |....iriver UMS P|
00000010  4c 41 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |LA..............|
00000020  51 75 69 63 6b 20 4c 69  73 74 00 00 00 00 00 00  |Quick List......|
00000030  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*

Each song frame begins with a 16-bit integer specifying the index of the first non-directory character of the song’s full filename. This index is one-based. The index is there probably just to help the player to strip the directory part out of the song’s filename, if there is no title tag in the song file.

Immediately after the index comes the song’s null-terminated full filename. As the filesystem type is VFAT, it is encoded as UTF-16 without a byte order mark. I have not tried whether the player recognizes wider than two-byte characters, though likely it won’t. Also, I have used only absolute paths, I don’t know if relative paths would work.

The index and filename are all there is in a single song frame. Note that the filename must fit into one 512-byte frame. So the filename, including the directory part, can have at most 255 (two-byte) characters. The player-accompanied iriver plus program seems to mess up your data without warning if you happen to use more than 255 characters, so don’t do that.

Example:

00000200  00 1d 00 5c 00 4d 00 75  00 73 00 69 00 63 00 5c  |...\.M.u.s.i.c.\|
00000210  00 63 00 65 00 64 00 69  00 70 00 5f 00 74 00 75  |.c.e.d.i.p._.t.u|
00000220  00 72 00 5c 00 74 00 72  00 61 00 6b 00 74 00 6f  |.r.\.t.r.a.k.t.o|
00000230  00 72 00 69 00 73 00 74  00 5c 00 30 00 31 00 2d  |.r.i.s.t.\.0.1.-|
00000240  00 65 00 6b 00 69 00 5f  00 61 00 5f 00 74 00 74  |.e.k.i._.a._.t.t|
00000250  00 61 00 72 00 5f 00 2d  00 5f 00 68 00 79 00 76  |.a.r._.-._.h.y.v|
00000260  00 e4 00 74 00 5f 00 68  00 65 00 76 00 6f 00 73  |...t._.h.e.v.o.s|
00000270  00 65 00 74 00 2e 00 6f  00 67 00 67 00 00 00 00  |.e.t...o.g.g....|
00000280  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000400  00 1d 00 5c 00 4d 00 75  00 73 00 69 00 63 00 5c  |...\.M.u.s.i.c.\|

The song’s filename is \Music\cedip_tur\traktorist\01-eki_a_ttar_-_hyvät_hevoset.ogg, and the (one-based) index of its first non-directory character is 29 (00 1d). Again, the frame is padded with zero bytes to contain exactly 512 bytes.

Software

Here is a short Perl script, m3u2pla, for converting simple M3U-like playlists (effectively lists of filenames) into the iriver format. Usage synopsis:

m3u2pla [-e expression] [-v] [playlist]...

Playlists should contain only bare filenames, one per line. URLs are not recognized. Empty lines, M3U EXTINF fields, and leading/trailing whitespace are discarded. If no playlists are given in the command line, standard input is read. The resulting iriver playlist is printed to standard output.

The script reads playlists one line at a time, and makes two substitutions for each valid filename encountered. The first substitution replaces a prespecified local path prefix with a prespecified player path prefix. The assumption here is that the player-residing filenames and the corresponding local filenames differ only on these fixed path prefixes. This is likely what you want, if you have a similar directory hierarchy both in your player and in your music library. For example, if you have a filename

/home/jsmith/music/pet_shop_boys/fundamental/01-psychological.ogg

in your M3U playlist, and the corresponding file in the player is

\Music\pet_shop_boys\fundamental\01-psychological.ogg

then your local path prefix is /home/jsmith/music and your player prefix is \Music. You must edit the script and change these prefixes to match your directory names before using the script.

The second substitution replaces all slashes with backslashes. The resulting filename should now point to the player-residing file.

The first substitution can be replaced with an arbitrary Perl expression with the -e option. The given expression is evaluated for each input filename, and the current filename can be altered via the default variable $_. You can also pass an empty string as expression, in which case the filenames are used verbatim (but they are still subject to backslash conversion). This option is useful when you have relative pathnames, pipes, etc. For example, the case above could be mimicked like this:

cd /home/jsmith/music; ls -1 pet_shop_boys/fundamental/* | m3u2pla -e 's{^}{/Music/}' > playlist.pla

The -v switch causes the script to print each input filename and the corresponding substituted (i.e. output) filename to standard error. This is useful for debugging.

Finally, note the encoding used in M3U files: my system uses UTF-8, but your system might not. In that case, replace UTF-8 in the script with the encoding you have in your M3U playlists.

Copyrights etc.

This specification and m3u2pla script are in public domain. You can use them in any way you wish. However, there is NO WARRANTY: if you use this specification and/or software, you do it solely at your own risk.


Home

Last updated on 15 December 2016.