Re: [LAD] Realtime inter-thread communication

From: Len Ovens <len@email-addr-hidden>
Date: Mon Feb 29 2016 - 17:27:45 EET

On Mon, 29 Feb 2016, Sebastian Gesemann wrote:

> I've started writing a software synthesizer in C++ (using SDL2 for
> now) for kicks and giggles and ran into the problem of having the
> event loop thread that listens for keyboard events communicate with
> the audio callback.
>
> Are there any recommendations for how to pass real-time events (note
> on, note off, etc) to such an audio callback? I figured, this is
> already a solved problem and that I could benefit from your
> experiences. Maybe you know of some nice open-source C++ queue
> implementation that is suitable in such a situation.

I have used jackd ringbuffer for that.

If you don't want to link against jack you could probably pull the code
out to use in your application. the ring buffer is a polled setup, so
every time you do some audio processing you need to check the ring buffer
to see if there are any new bytes to process.

--
Len Ovens
www.ovenwerks.net
_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Feb 29 20:15:02 2016

This archive was generated by hypermail 2.1.8 : Mon Feb 29 2016 - 20:15:02 EET