Re: [LAD] Libraries for simple audio programming, libao, other options?

From: nick thomas <jesuswaffle@email-addr-hidden>
Date: Thu May 03 2007 - 05:58:50 EEST

On 5/2/07, Stephen Cameron <smcameron@email-addr-hidden> wrote:
>
> Oh yeah I do see it now, so, nevermind.
>
> Looking at pa_multi_sine.c, I can see that
> each stream can have multiple channels, and an example
> of doing it interleaved and not interleaved.
>
> So, portaudio looks like it's just what I needed.
>
Hmm, not quite on the mark. Multiple channels give you more speakers;
for one channel, you have mono, for two channels, you have stereo, for
7 channels, you have surround sound, etc. However, you were right on
the mark with your code sample in the previous email. Just integrate
that into your program, and you should have a working audio engine.

The only wrinkle is the race condition you noted when accessing the
sources list. In a normal situation, you'd obviously solve the problem
using locks, but that's not an option in this case, since the
PortAudio callback isn't allowed to do any potentially blocking
operations (such as acquiring a lock). You need to use some sort of
lock-free synchronization algorithm. I've never tackled that sort of
problem with PortAudio in particular, but you may look at this page
(from the creator of PortAudio) for some pointers:

http://www.audiomulch.com/~rossb/code/lockfree/
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo.cgi/linux-audio-dev
Received on Thu May 3 08:15:02 2007

This archive was generated by hypermail 2.1.8 : Thu May 03 2007 - 08:15:02 EEST