How to manage playlist data in MP3 player embedded software

The JVC Company in Japan sought to simplify data management software development in its new XA-HD500 digital audio player. Data management lies at the heart of these devices, which exist to provide instant access to thousands of songs according to the "metadata" of artist, album, title, genre, and custom playlist. As a walking music database, an MP3 player's data design presents sorting, storing and retrieval needs that are relatively simple. However, the devices must operate under severe memory and CPU constraints – and this calls for development of exceedingly efficient data management.

Both manufacturing economics and consumers’ demand for performance drive the need for software efficiency in MP3 players. Using less memory reduces the device’s component cost, which, in turn, supports a lower retail price. In addition, a substantial portion of the RAM within the device is reserved for the playback buffer that caches the MP3 stream. Manufacturers also seek to incorporate low-end CPUs in portable music player to reduce cost. Minimizing embedded software’s demand for CPU cycles supports this end, and affords the additional benefit of a longer playback period per recharge.

Early on, the JVC engineers determined they could best meet their tight development schedule by integrating a commercial, off-the-shelf database management system (DBMS) within the MP3 player’s embedded software, rather than writing data management code from scratch. However, the database would have to perform needed search, storage and retrieval tasks within the device’s RAM and CPU limitations, which meant that not every available DBMS technology would prove a good "fit."

One option was to select an embedded database modeled after office/corporate data repositories, which cache frequently requested data in memory – for faster access – but to write database changes through the cache to be saved to disk. Another alternative was an in-memory database system (IMDS), which eliminates disk access and stores data in main memory, flushing to disk only upon command by the application. Both types of database can be found in a variety of embedded applications.

In-memory data management emerged as the better alternative for JVC's MP3 player. To understand why, it is helpful to view an example data model for a portable media player as shown in figure 1. This is a generalization and simplified from the data model that would be used in any commercial product.

Figure 1: Example data model for a portable media player .

The ability to create and edit custom playlists—to organize songs for playback based on personal tastes—is central to the portable media player’s consumer appeal. Each PlayList contains one or more references to a PlayListSong (a song). The PlayListSong references the PlayList it belongs to and the Track that describes the song, and PlayListSong also contains the item’s order in the PlayList (i.e. it is the 14th item in the PlayList).