On 2020-04-29 22:59, Eric Blake wrote:
On 4/29/20 12:53 AM, 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 | 615
+++++++++++++++++++++++++++++++++++++++++
configure | 17 ++
qapi/audio.json | 50 +++-
Focusing just on UI:
+++ b/qapi/audio.json
@@ -152,6 +152,51 @@
'*out': 'AudiodevPerDirectionOptions',
'*latency': 'uint32' } }
+##
+# @AudiodevJackPerDirectionOptions:
+#
+# Options of the JACK backend that are used for both playback and
+# recording.
+#
+# @server_name: select from among several possible concurrent server
instances.
+# If unspecified, use "default" unless $JACK_DEFAULT_SERVER is
defined in the
+# process environment.
Our convention is to prefer '-' over '_' except in cases of
pre-existing consistency. This should be 'server-name' unless you
have an example of what we have to be consistent with.
No reason at all just didn't think about it, I will correct it :)
+#
+# @client_name: the client name to use. The server will modify this
name to
+# create a unique variant, if needed unless @exact_name is true.
+#
+# @start_server: set to true to start a jack server instance if one
is not
+# present.
+#
+# @exact_name: use the exact name requested otherwise JACK
automatically
+# generates a unique one, if needed.
Ditto for these three.
+#
+# Since: 4.0
The earliest this will be added is 5.1, not 4.0.
Yup, copy & paste error :)
+##
+{ 'struct': 'AudiodevJackPerDirectionOptions',
+ 'base': 'AudiodevPerDirectionOptions',
+ 'data': {
+ '*server_name': 'str',
+ '*client_name': 'str',
+ '*start_server': 'bool',
+ '*exact_name': 'bool' } }
+
+##
+# @AudiodevJackOptions:
+#
+# Options of the JACK audio backend.
+#
+# @in: options of the capture stream
+#
+# @out: options of the playback stream
+#
+# Since: 4.0
5.1
+##
+{ 'struct': 'AudiodevJackOptions',
+ 'data': {
+ '*in': 'AudiodevJackPerDirectionOptions',
+ '*out': 'AudiodevJackPerDirectionOptions' } }
+
##
# @AudiodevOssPerDirectionOptions:
#
@@ -300,8 +345,8 @@
# Since: 4.0
##
{ 'enum': 'AudiodevDriver',
- 'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'oss', 'pa',
'sdl',
- 'spice', 'wav' ] }
+ 'data': [ 'none', 'alsa', 'coreaudio', 'dsound', 'jack', 'oss',
'pa',
+ 'sdl', 'spice', 'wav' ] }
It's worth adding a doc comment that @jack was added in 5.1 (I didn't
check if audio.json has an example of adding to an enum, but other
.json files do)
No worries, I will see if I can figure this out.
-Geoff