[linux-audio-dev] General strategies for RT Audio Thread
paul at linuxaudiosystems.com
Fri May 2 07:44:00 UTC 2003
>On Fri, May 02, 2003 at 10:51:27AM +0200, Alexander Lenhardt wrote:
>> I'm trying to write very simple software synthesizer under Linux just for my
>> own educational purpose.
>> but one problem i came over is the following:
>> I made the audio thread shced_fifo with max priority. My GUI thread is
>> sched_other. To allow the GUI to rerspond, I thought i could just put the
>> audio thread to sleep for the playing length of the buffer (7ms).
>There's something fundamentally wrong here. Normally, the audio thread
>synchronises with the audio (ALSA) driver. It will be waiting most of the
>time, giving other threads a chance to run, and the problem you describe
>then does not exist. This is really the first thing you should get right.
if you use the JACK Audio Connection Kit (http://jackit.sf.net/) you
won't have to worry about any of this stuff. you just write the code
to generate chunks of audio, and JACK takes care of just about
everything else. in addition, if you simple software synth mutates
into something more interesting, it will then be able to route audio to the
many other applications that use JACK.
More information about the Linux-audio-dev