kmel_db

A parser and generator for Kenwood Music Editor Light databases that works under Linux.

Kenwood Music Editor Light is a Windows-only application that creates a database that is used by Kenwood car audio systems to allow searching by album, title, genre and artist. It also allows creation of playlists. I have successfully decoded the file format used for the database, and have written this application to do the same under Linux.

I have two issues with Kenwood Music Editor Light:

My Kenwood car audio system only supports mp3 and wma media formats, so these formats are currently the default for my implementation. This should be easily extendable, as the library I use to read the media files (hsaudiotag3k) supports the following: mp3, mp4, wma, ogg, flac and aiff.

You'll need Python version 3 or above, and the hsaudiotag3k python package installed to run.

Database Format

The kmel_db_format.md document attempts to explain the format of the database. It might be slightly behind the code.

Generator

To generate a database, just type:

./DapGen.py /path/to/your/usb/drive

If you don't specify the path, the generator will process all mounted partitions of type FAT.

Use the '-h' option to see other options.

Current limitations:

Parser

To parse a database, just type:

./KenwoodDBReader.py -i /path/to/kenwood.dap/file

It will print copious logs, used by me to analyse the database. I may ask for this output if you want me to look into a problem.

Details

Getting FAT 8.3 filenames in Python

After much searching, I use the fcntl.ioctl function and the VFAT_IOCTL_READDIR_BOTH request code to get the 8.3 DOS names for both the file and the directory. If you find that this is not getting the right result, or there are errors produced by this function call, there is a generate_ioctl.c file that you can build and run to replace the kmeldb/vfat_ioctl.py module. This works on my Linux system, but I have no idea whether it will work on BSD or OSX.

Getting media tags

I use hsaudiotag3k to get the tags from the media files. This is a pure python package, so should be easy to install with few, if any, dependencies.