June 2010 Archives

June 30, 2010

iAudio X5 Tagging

The Cowon iAudio X5 is, in many ways, the ideal music player for the discerning geek.  It's Linux friendly, behaving as a normal USB mass storage device requiring no special software nor drivers; it plays Ogg/Vorbis and FLAC files; it has a line in connector; it has fantastic sound quality; it organises your files by folder, so you can have your files organised how you really want them.  It also has a battery which lasts ages, particularly the X5L version.  When my X5L was younger, a full charge would last for about two weeks of fairly constant use at work.  Now it's several years old - I've actually forgotten how old exactly - and it still lasts for many days.

It does, however, have a particular weirdness when handling Ogg/Vorbis files.  Its tag parser is extremely basic, and apparently just skips one character (the equals sign) after finding the letters "ARTIST" in the tags.  But most recent ripping software adds an extra field, called ARTISTSORT.  The X5 often finds that instead of ARTIST, and thinks the name of the artist is something like "ORT=Haza, Ofra" instead of "Ofra Haza".

So, I wrote a little script to remove the ARTISTSORT tags altogether.  It's a cheap solution - it'd probably be better just to move that tag to the end (possibly the start, I didn't really test) of the tags field, but this field isn't used for sorting on the X5 anyway.

Here's the script ("ogg-retag").  It's really simple:


if [ -e ogg.tags ]; then
        echo "ogg.tags file exists.  Please remove it first."
        exit 1

for FILENAME in "$@"; do

        echo "Processing "$FILENAME

        # Dump tags to file, removing ARTISTSORT tag
        vorbiscomment -l "$FILENAME" | grep -v "ARTISTSORT=" \
                > ogg.tags

        # Write tags back
        vorbiscomment -w -c ogg.tags "$FILENAME"


rm -f ogg.tags

To run, simply "cd" into the folder containing the problematic Ogg/Vorbis files, then run "ogg-retag *.ogg" or similar.