PDA

View Full Version : Need urgent help/pointers with ALSA programming



eye776
09-02-2011, 12:01 PM
First of all, sorry for asking this question here. I lurked around for a bit and saw that
the community is pretty knowledgeable, so here goes.

Oh crap, how do I even begin ?

I got employed not too long ago and my employer has currently (T)asked me to port an Android game to
a device running Linux (under NDA).

The device has a horrendous sound API and I had to fix this, and I did, after finding out the SDK has libasound (ALSA),
by dynamically linking Audiere with the project after fixing the ALSA device and it worked great.

My employer's lawyers problem is that Audiere is LGPL and they want to hear none of it.
And they already refused to let the devs use OpenAL for Android, but android has the AudioTrack class.

So I have to, pretty much write a minimal sound library using only ALSA (and whatever other non LGPL
or GPL libraries I can find, if any) and can do the following:
1) Mix up to 4 sounds
2) Supports panning
3) Supports streaming
4) Supports ogg files

I've read the tutorial 16bit PCM 44.1 KHz playback with ALSA alone, and it's already a bit too much to take in.

Do you guys know of any BSD/MIT libraries that can do what I need ?
Or some ALSA documentation that's geared to someone who's NOT necessarily a sound engineer ?

Seth
09-05-2011, 11:06 PM
Hmm, good questions. I currently have skipped linux with my cross platform stuff so far (well, except for console apps, for my server) so I really don't know what's out there.

Maybe it's possible to take Clanlib's linux audio mixing stuff and make it work, basically all you need that would be ALSA specific is the code to init and fill the mixing buffer, the rest is going to be cross platform friendly.

eye776
09-06-2011, 10:32 AM
Took this question to a few other forums as well and, not to my surprise, I didn't manage to get any kind of help.
Clanlib's LGPL, same as Audiere so no go.
I also found PortAudio, which is licensed under MIT, to be interesting but I have to see if it can be made to compile
under the SDK I have to use at work.

Edit: Seems my info on ClanLib was old, and it's licensed under zlib :D I'll take a look at it then :)
Edit2: Dang, this forum doesn't support strikeout.

Seth
09-06-2011, 10:36 AM
Interesting. One correction though, Clanlib is not LGPL anymore, both 1.x and 2.x are released under the Clanlib License (http://clanlib.org/wiki/License) which is similar to zlib.

EDIT: Oops.. hehehe.