Re: [LAU] Linux audio app design: The nature of xruns

From: Dominic Sacré <dominic.sacre@email-addr-hidden>
Date: Mon Dec 28 2009 - 17:00:04 EET

On Monday 28 of December 2009 13:24:24 lanas wrote:
> Third, same song w/o xruns. I terminate jackmix and Qarecord
> and launch Ardour. I run all outputs into Ardour, and run the
> electric guitar as well. Add some Freeverb and MultiEQ. Record.
> No xruns at all in the resulting .wav file.

I don't know about Qarecord, but unfortunately JackMix is an example of
a JACK app that does not "follow the rules".

> My question is, is there a guide/HOWTO around that addresses
> the proper design of audio/jack applications or, is - in 2009 -
> the only to know about that is by actually going through the source
> code of successful Linux audio/jack applications ?

The rules are quite simple, but in many cases not exactly easy to
implement.

Inside the JACK process callback, you may not call anything that might
block, i.e. that might suspend the calling thread indefinitely. That
includes:
- memory allocations (and deallocations)
- waiting for mutexes etc.
- file IO, printing to the console, etc.

The main difficulty lies in the fact that these things are often hidden
deep inside some library code. So you should either verify that a
function is safe to use in realtime code, or avoid using it in this
context.

As for common solutions to these problems, the link to the previous
thread David posted should be a good start.

Dominic
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Mon Dec 28 20:15:01 2009

This archive was generated by hypermail 2.1.8 : Mon Dec 28 2009 - 20:15:01 EET