CowonEdit - A logo editor for Cowon Players



The Player

For some time now I own a Cowon iAudio 7 portable media player. I have to say it is the best device of that kind I ever owned. It is one of the few portable players available that can natively play Ogg-Vorbis and FLAC audio files. That was the main reason for my initial interest in this device. Another advantage is it's excellent battery life: I never meassured it thouroughly but with my personal listening habits (listening to music every time I am moving from A to B, wether on foot, bike, or bus) I can use my player for one or two weeks until I have to recharge it. It also can play videos and show images and text files, however, due to the small screen size (2.5 x 2 cm) I never really used that feature. It can also record something via built-in mic or line in. Cowon iAudio 7


The Idea

When the player is turned on it displays a short animation of about 5 seconds. I was curious if I could change this startup animation. When I looked arround in the devices filesystem I found a file named "LOGO.ilb" in the "SYSTEM" folder, about 3 MiB in size. I suspected that the startup animation was stored there and that by changing this file, I could alter it.


Reverse Engineering the File Format

At first I compressed the file with gzip and it got a lot smaller (approx. 0.5 MiB now). Bingo! We are dealing with uncompressed data, makes things a lot easier. I looked arround on the internet for the ilb format, but I couldn't find anything usefull, except the information that Cowown offers a Windows-only editor for these files, called JetLogo. But I couldn't find a editor that could be used on Linux or any file format specifications. So I took a look at the file myself, the first few bytes are:


hexdump LOGO.ilb -C | head -n 6

00000000  69 41 55 44 49 4f 20 31 36 30 78 31 32 38 43 00 |iAUDIO 160x128C.|
00000010  01 00 30 00 3c 00 3c 00 3c 00 3c 00 3c 00 3c 00 |..0.<.<.<.<.<.<.|
00000020  3c 00 3c 00 3c 00 3c 00 3c 00 3c 00 3c 00 3c 00 |<.<.<.<.<.<.<.<.|
*
00000070  3c 00 3c 00 00 00 00 00 00 00 00 00 00 00 00 00 |<.<.............|
00000080  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|

Oh, apparently this is a file contains data for a 160x128 pixel display. The "C" at the end could mean "color". The following null byte probably just terminates the string. I couldn't make much sense of the rest yet, but I guessed the data was stored as RGB data somewhere, so i hacked together something that would take a few bytes and interpret them as RGB data, letting me play with various encoding possibilities.

It turned out that the images where stored frame after frame, without padding, starting at adress 0x74. The pixels for each frame were stored in row major order, each row was 160 pixels long and a frame consists of 128 rows (as indicated in the header string. Each Pixel is simply stored as 3 unsigned bytes, one byte for each RGB color component. With my image viewer I could verify that the image contained 48 frames. That explains the 0x30 = 48 at adress 0x12. So now I understood 2949138 of the 2949236 bytes in the file. To get a better understanding of the rest I wrote a small library that would let me create, edit and save ilb Files based on my current knowledge, so that i could test them on my player.

The meaning of the 0x3c starting at adress 0x14 occured to me when I tried to calculate the frame rate of my player (haha, I thought it was fixed): The 48 frame default video played for about 2.9 seconds. So that's about 60 ms for each frame. Oh, 0x3c means 60 in decimal, and we have 48 times 60 stored next to each other - what a coincidence. :-) So if you want to make annoying startup videos that last for a few minutes, go right ahead. Unfortunately you can't seem to use more than 48 frames, the remaining frames will just be ignored. The 0x01 stored at 0x10 seems to have no real meaning, i guess it is some kind of version number which is never checked because it is 1 and there is no version 2 yet, so no need to care for that.


The finished Program

To put the library created while reversing the file format to some use I wrote a GTK+ Frontend using Glade which let's you load an existing ilb File and view it, either frame by frame or as a whole animation in real time (as it would appear on your PMP device). If you don't have an existing file you can just create a new one.

You can export individual frames or all frames of an animation to PNG image files and you can also replace frames with the image content of PNG images. Of course you can also view and adjust the duration each individual frame is shown.

CowonEdit Screenshot

Up to now only the iAudio 7 player is supported by this program, but I guess other, simillar players are trivial to add. So if you want just send me your ilb file and I will see what I can do - or just send me a patch :-).


Download

CowonEdit is released under the Terms of the GPLv3. The sources can be downloaded here. After you downloaded it, please extract the archive and use the Makefile to compile it. You will need the GTK+ 2 developement files. If you are on a Debian-based system apt-get install libgtk2.0-dev should be sufficient.