Fatrat's BeOS Projects - Maestro3/Allegro-1 Audio Driver

Current version: (none)


Project notes...

2004.06.14 -- OK, this project is now officially dead, though it had been stagnant for so long that I can't imagine anyone thought it was ever going to get done :P Anyway, Marcus never quite got this finished, but he made a decent amount of progress. Maybe someday someone can resurrect the project and get the driver working with the code he left behind when he gave up on it :/


2002.07.25 -- Picked up on this project again, unfortunately RL had me away from all fun stuff for awhile there... Anyway, debug messages now work, some IOCTL's being handled, and I have the basic init code for the hardware in place; still no actual audio, that's the next thing to tackle. Found some problems where a semaphore was being set but never played, so the media server would eventually hang -- fixed that. Currently the media server seems to be sending me chunks of 0-length data to play, which is odd. Something with the preferred sizes, etc. for buffers isn't being set (not surprised.) Overall it's coming along, put in a few hours tonight and made some real progress.

The bulk of the helper functions that had to be ported from the BSD source are done, so integrating the rest of it shouldn't bee too much trouble. One of the main things that needs doing is coming up with some good structs for the record/playback channels, card info, etc. I hope that one more good session of coding should result in at least some very basic audio playback abilities (even just buzzy noise would make me happy at this point! :) ) Then I'm going to need to take some time to go back and clean up all of the quick hacks, plan out the data structures in ways that make sense, etc. Also need to look for leaked resources, I'm sure I've got extra semaphores sitting around somewhere...

I unfortunately fell out of contact with Marco when I was busy RL, so I have no idea how far he's progressed in the mean time; I know he has some audio working from the CD drive last we talked, and that was probably almost a month ago... We shall see :)


2002.06.24 -- I'm working with Marco Moschetti on this project, since he is already working on the same driver and has managed to get some sound out of the card in certain situations! Unfortunately I have had NO time to work on this lately, but Marco is working on it bit-by-bit, so a driver may still be completed and available before 2003 ;) Stay tuned...


2002.06.02 -- Spent the evening with my nose in books and web pages, managed to get the skeleton of a driver done and compiling OK; right now it just does the simple task of walking the PCI bus looking for the card, and tells the OS whether it found the hardware or not for the card - all of the other functions just return without doing anything... (Not much, at least it compiles...)

I'm finding that the BSD driver source code out there is a bit more readable than the Linux source. I think I finally understand how the whole process needs to work for the driver to talk to the soundcard, etc. There's some funky things that need to be done in terms of setting up "lists" that the DSP grabs for playing/recording the audio data. We'll see soon if I've managed to absorb everything. With luck the next time I get a chance to sit down and work on code for this (later this week maybe?) I'll be able to initialize the card and make some noises...

I do wish I had something other than my laptop to test this on; it's slow and tedious to reboot it, and I know many crashes are in my future :(


2002.05.31 -- Finally getting a chance to work on this, and get the web pages and various resources I've found to help with this driver together in one place.

So, on to the good stuff. The goal of this little project is to write a BeOS audio driver capable of providing at least basic audio functionality (i.e., playback only) for the ESS1988 sound chipset, which I happen to have in my Compaq Presario 1700T laptop :) There are existing Linux drivers and BSD drivers for this chipset, so I have a good baseline to work from. Also, the spec sheet for the ESS1988 chipset is available, though it's pretty dense and not very useful for the actual process of writing a driver (it's apparently indended more for the hardware integration of the chipset.) The 1998 and 199a chipsets should also work with this sound driver when completed, from the indications of the existing Linux drivers out there.

In fact, the Linux driver supposedly works on all of these:


I should be so lucky as to get it to work on all of these!!

The thing that I worry about the most for completing this is the refernces in the Linux source that I've flipped through to "AC97 codec", partially because I know very little about it, and more so because I'm afriad it isn't implemented on BeOS... The source for the Linux driver makes reference to existing Linux AC97 codec code, hopefully if it's needed I can easily port what has already been done...

Anyway, my first goal for coding this will be to implement a skeleton driver that can walk down the PCI bus and find the sound card, and put stubs in place for all of the hook functions and IOCTL calls that the sound driver needs to implement. After that, I'll look into actually implementing the stuff that makes noise :)

The Linux code has a very nice description at the top of how the Maestro3 chipsets work -- there is some magical DSP code that gets copied into the card, and that DSP code controls the bulk of the work that the card does. The driver just points at entry points for this DSP code for each function, and sets up data in the right places for the card to grab/output. The DSP code is not in any form that I can understand (it's some kind of DSP machine language, i.e., just a big set of hex numbers), but apparently we're allowed to use it like this without violating any licenses... A side note, the drivers on Linux that I'm working from are GPL, so the resulting driver here should I complete the project will also be GPL'd.


Back to the main projects page