The MP3 Project

 

Project Participants:

Nick Noack

Michael Nelson

 

Project Objective:

To create support for playing MP3 audio files on the Intrinsyc CerfBoard.

 

Project Progression:

To accomplish our objective, we needed to find an MP3 decoding library compatible with the SA1100’s Linux OS vs. 2.4.1 and determine the proper interface for the decoder with the CerfBoard’s audio device.  An MP3 decoding library was found from http://www.mpg123.de/ .  The decoder took a filename argument, opened the file, decoded the MP3, and wrote the decoded bit stream to the audio driver. 

 

This came to be problematic, as the CerfBoard in its standard form lacks a working audio device driver.  So it became necessary to look into either writing an audio driver, or finding one compatible with the SA1100.  It should be noted that the 2.4.1 source tree did come with an audio driver, however it was non-functional.  This non-functional driver was approximately 100 pages in length.  It was decided at this time that the prudent thing to do would be to search for a functioning audio driver before attempting to write one of our own.

 

In searching for an audio driver, we found the work of a fellow University of Washington student Albert Wong.  His work can be found at http://www.cs.washington.edu/homes/awong/lindrivers.html .  It seemed to be his opinion, along with a few other individuals online, that the problem the audio driver had was an IRQ conflict with the touch screen ucb1200_MCP drivers. 

 

Patches to allow audio support for the 2.4.5 kernel were found that included a new version of the UDC1200_audio.c driver.  We decided one way to mitigate our problem would be to patch and build the 2.4.5 kernel and put it on the CerfBoard.  This was done; however upon completion the CerfBoard failed to boot.  Numerous attempts to fix this, including trying later versions of the kernel, were made, none yielding any results. 

 

The only remaining course of action seemed to be keeping the 2.4.1 kernel.  We decided to take the audio related files from the patch of the 2.4.5 kernel (patch found at http://kernel.pe.kr/pub/armlinux/people/nico/ ) and make them compatible with the 2.4.1 kernel.  The modifications we felt necessary were made and the resulting files were added to the 2.4.1 source tree and built as modules.  After some debugging and some assistance from Matt Cosand, our exceptionally helpful TA, the audio module was built and properly instantiated.  The code files modified can be located at driver.zip, and dropped into the linux/drivers/char folder of any 2.4.1 kernel patched to be ARM compatible.  Note that the kernel must be configured with sound support, and select the ucb1200 modules in the Character Device menu.  OSS support is also recommended.

 

Unfortunately, there were errors with the sound.o module, which provides the interface to the Open Sound System (OSS).  OSS is the general API interface for most audio devices to provide standard control.  The MPG123 libraries, as well as most other audio applications, depend on this sound module.  Upon loading of the sound.o module, we receive an error that sa1100_data_node is not defined.  While we spent time in an attempt to fix this problem, a solution has not been found.  The ucb1200_audio.o driver provides the OSS template functions however, and by loading this module as the sound driver, OSS support was obtained.  It is not known to what degree of support is achieved.

 

 

 

Future Work:

In future work, we’d like to see the OSS sound module work, to remove the hack of directly using the ucb1200_audio.o driver.  This would streamline the process, and make setting up audio drivers on the CerfBoard similar to other Linux systems.  In addition, due to the memory constraints of the CerfBoard, only 11 seconds of audio could be produced.  The addition of a Flash card, or other storage device would be nice to allow several complete MP3’s to be played.  Finally, compatibility with the touch screen driver could allow for a complete standalone MP3 player, with a useful UI.