On Wed, Apr 29, 2020 at 03:53:58PM +1000, Geoffrey McRae wrote: > This commit adds a new audiodev backend to allow QEMU to use JACK as > both an audio sink and source. > > Signed-off-by: Geoffrey McRae > --- > audio/Makefile.objs | 5 + > audio/audio.c | 1 + > audio/audio_template.h | 2 + > audio/jackaudio.c | 677 +++++++++++++++++++++++++++++++++++++++++ > configure | 17 ++ > qapi/audio.json | 56 +++- > 6 files changed, 756 insertions(+), 2 deletions(-) > create mode 100644 audio/jackaudio.c Cool! Out of interest, which emulated audio device do you use and have you had issues with buffer sizes/latency? I haven't reviewed in depth but in general this looks good. > +typedef struct QJackBuffer { > + int channels; > + int frames; > + _Atomic(int) used; stdatomic.h isn't used directly in QEMU. Can you use "qemu/atomic.h" instead? > +static inline int qjack_buffer_used(QJackBuffer *buffer) > +{ > + assert(buffer->data); > + return atomic_load_explicit(&buffer->used, memory_order_relaxed); > +} Is this function used?