On 2020-05-12 00:53, Stefan Hajnoczi wrote:
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 <ge...@hostfission.com>
---
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 now use the ICH9 device, however, I had buffer size issues with
usbaudio.
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?
Sure.
+static inline int qjack_buffer_used(QJackBuffer *buffer)
+{
+ assert(buffer->data);
+ return atomic_load_explicit(&buffer->used, memory_order_relaxed);
+}
Is this function used?
Nope, left behind from a prior implementation, I will remove it.