Pandemonium
Lijsterbeslaan 3
B-2940 Stabroek, Belgium
IBAN: BE78 9794 3692 5286
BIC: ARSPBE22XXX
KBO: 0314.595.348
VAT: BE 0 881.023.185
request blrootsales@pandemonium.be
ID:  Pass:    [ Not logged in. ]

 ALSA: blocking, nonblocking, libjack, or threads? 
 Doom
Joined 2008-04-27 21:01:25.
(3558 Days old)

ALSA: blocking, nonblocking, libjack, or threads?

Posted on: 2011-02-07 11:49:57 
IP: Logged 
I am interested to know some good practices for dealing with ALSA.

The documentation for it is very very lacking and I know you guys are using a very advanced implementation.
  Showing entry "ALSA: blocking, nonblocking, libjack, or threads?".
Pandemonium 2009

 ALSA: blocking, nonblocking, libjack, or threads? 
 Dave Driesen
Joined 2007-05-18 20:59:14.
(3903 Days old)

ALSA: blocking, nonblocking, libjack, or threads?

Posted on: 2011-02-11 11:44:14 
IP: Logged 
 Well we actually started off using some blocking code just for tests.

Then moved to nonblocking around the second or third commit of the code IIRC.

Third party libraries are all good and well I guess, but you really don't need them. I wouldn't say it's simple to code for ALSA without external libs but it is doable. IMO the bigger problem isn't so much ALSA, but making sure your audio streams (if you are using streams) stitch up nicely and are in the correct format.

We were using nonblocking ALSA for quite a while because the code was there and functional, and I remember it was somewhat tedious to keep refilling the buffers (which were round robin at the time) on every tick while keeping track of all the samples and all. But it was an amazing feat really and good for morale.

Nowadays we use threaded multichannel soundsystems with low channel process priorities, structurally very similar across the different supported platforms. The channels have queues which get filled up by the main thread (or other threads, whatever). It's state of the art and we're all very proud of course, but still I'm a bit sentimental about those early days with nonblocking ALSA. Somehow it seemed more fulfilling at the time.

  Showing entry "ALSA: blocking, nonblocking, libjack, or threads?".
Pandemonium 2009

 Which language/platform? 
 Krasula
Joined 2007-05-14 20:59:48.
(3907 Days old)

Which language/platform?

Posted on: 2011-02-11 06:37:55 
IP: Logged 
Um what language/platform are you building for though?

I still do a lot of plain C in which nonblocking mode works nicely for me. I also don't have a very good threading implementation in my C++ libbase, which contributes to my preference somewhat.
  Showing entry "Which language/platform?".
Pandemonium 2009

 C++ 
 Doom
Joined 2008-04-27 21:01:25.
(3558 Days old)

C++

Posted on: 2011-02-11 08:27:41 
IP: Logged 
I'm building C++ on gentoo so it's cool, no worries.
  Showing entry "C++".
Pandemonium 2009

 :/ 
 Krasula
Joined 2007-05-14 20:59:48.
(3907 Days old)

:/

Posted on: 2011-02-21 12:52:27 
IP: Logged 
I hate gentoo :/
  Showing entry ":/".
Pandemonium 2009


These pages are the intellectual property of the Pandemonium crew.
Welcome to Pandemonium.be - Antwerp based development studio providing development and administration services. Developers and maintainers of the Pyromasaur 3D framework.
Secure
"