Saturday, 22 November 2008

MusicPal Sound Programming

The MusicPal has a few devices that look like they are to do with sound:
  • /dev/dsp
  • /dev/mixer
  • /dev/audio
I know very little about audio on Linux, but from a quick read I thought that these looked like OSS devices. I downloaded the simple OSS sine wave generator example singen.c. It runs ok on my laptop, and cross compiled ok, but when I tried to run it on the MusicPal I got a "/dev/dsp: No such device or address" error. This makes me think that maybe it is not OSS - I'm going to have to learn more.

A couple of hours later and I might be getting somewhere. I tried doing fuser /dev/dsp and fuser /dev/audio. These both returned nothing with the main application (nashville) sutdown. Re-starting it with /etc/init.d/mainapp start, then repeating showed that /dev/dsp was still not used, but /dev/audio was used by the 12 running versions of /bin/nashville. This has persuaded me that Freecom use /dev/audio, not /dev/dsp.

So, what is /dev/audio, and how do I use it?

The source code provided by freecom contains a directory .arch/arm/mach-mv88w8xx8/base_audio. This might be a clue. It even contains a file called audio_api.h - is this a modified version of OSS, or something unique?

Tried doing cat > /dev/audio and cat file.mp3 > /dev/audio - no sound at all if the machine had just been re-booted and nashville stopped, and had to CTRL-C to get back to the shell.

Re-started nashville, played a tune, put nashville into sleep mode, then stopped it. Repeated the cat xxx process - no sound, but dmesg showed "audio released irq disabled" messages, which come from audio.c in the base_audio directory.

Re-started nashville, and now this does not make any sound either - I'm definitely doing something to its sound driver....

Re-Booted. Set nashville playing, then stopped it with /etc/init.d/mainapp stop. Then did cat /usr/share/wakeup.mp3 > /dev/audio - got awful noise out of the speaker!

This is progress - I must have to do some initialisation to get it working, then send it data in the right format - just a matter of finding out how and what now - looks like audio.c might have some answers though...
Post a Comment