mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
audio: Add sndio backend
sndio is the native API used by OpenBSD, although it has been ported to other *BSD's and Linux (packages for Ubuntu, Debian, Void, Arch, etc.). Signed-off-by: Brad Smith <brad@comstyle.com> Signed-off-by: Alexandre Ratchov <alex@caoua.org> Reviewed-by: Volker Rümelin <vr_qemu@t-online.de> Tested-by: Volker Rümelin <vr_qemu@t-online.de> Message-Id: <YxibXrWsrS3XYQM3@vm1.arverb.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
committed by
Gerd Hoffmann
parent
f3def4dd42
commit
663df1cc68
@@ -2438,6 +2438,7 @@ X: audio/jackaudio.c
|
||||
X: audio/ossaudio.c
|
||||
X: audio/paaudio.c
|
||||
X: audio/sdlaudio.c
|
||||
X: audio/sndioaudio.c
|
||||
X: audio/spiceaudio.c
|
||||
F: qapi/audio.json
|
||||
|
||||
@@ -2482,6 +2483,12 @@ R: Thomas Huth <huth@tuxfamily.org>
|
||||
S: Odd Fixes
|
||||
F: audio/sdlaudio.c
|
||||
|
||||
Sndio Audio backend
|
||||
M: Gerd Hoffmann <kraxel@redhat.com>
|
||||
R: Alexandre Ratchov <alex@caoua.org>
|
||||
S: Odd Fixes
|
||||
F: audio/sndioaudio.c
|
||||
|
||||
Block layer core
|
||||
M: Kevin Wolf <kwolf@redhat.com>
|
||||
M: Hanna Reitz <hreitz@redhat.com>
|
||||
|
||||
@@ -2030,6 +2030,7 @@ void audio_create_pdos(Audiodev *dev)
|
||||
CASE(OSS, oss, Oss);
|
||||
CASE(PA, pa, Pa);
|
||||
CASE(SDL, sdl, Sdl);
|
||||
CASE(SNDIO, sndio, );
|
||||
CASE(SPICE, spice, );
|
||||
CASE(WAV, wav, );
|
||||
|
||||
|
||||
@@ -336,6 +336,8 @@ AudiodevPerDirectionOptions *glue(audio_get_pdo_, TYPE)(Audiodev *dev)
|
||||
return qapi_AudiodevPaPerDirectionOptions_base(dev->u.pa.TYPE);
|
||||
case AUDIODEV_DRIVER_SDL:
|
||||
return qapi_AudiodevSdlPerDirectionOptions_base(dev->u.sdl.TYPE);
|
||||
case AUDIODEV_DRIVER_SNDIO:
|
||||
return dev->u.sndio.TYPE;
|
||||
case AUDIODEV_DRIVER_SPICE:
|
||||
return dev->u.spice.TYPE;
|
||||
case AUDIODEV_DRIVER_WAV:
|
||||
|
||||
@@ -17,6 +17,7 @@ foreach m : [
|
||||
['pa', pulse, files('paaudio.c')],
|
||||
['sdl', sdl, files('sdlaudio.c')],
|
||||
['jack', jack, files('jackaudio.c')],
|
||||
['sndio', sndio, files('sndioaudio.c')],
|
||||
['spice', spice, files('spiceaudio.c')]
|
||||
]
|
||||
if m[1].found()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
+8
-1
@@ -675,6 +675,11 @@ if not get_option('jack').auto() or have_system
|
||||
jack = dependency('jack', required: get_option('jack'),
|
||||
method: 'pkg-config', kwargs: static_kwargs)
|
||||
endif
|
||||
sndio = not_found
|
||||
if not get_option('sndio').auto() or have_system
|
||||
sndio = dependency('sndio', required: get_option('sndio'),
|
||||
method: 'pkg-config', kwargs: static_kwargs)
|
||||
endif
|
||||
|
||||
spice_protocol = not_found
|
||||
if not get_option('spice_protocol').auto() or have_system
|
||||
@@ -1591,6 +1596,7 @@ if have_system
|
||||
'oss': oss.found(),
|
||||
'pa': pulse.found(),
|
||||
'sdl': sdl.found(),
|
||||
'sndio': sndio.found(),
|
||||
}
|
||||
foreach k, v: audio_drivers_available
|
||||
config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v)
|
||||
@@ -1598,7 +1604,7 @@ if have_system
|
||||
|
||||
# Default to native drivers first, OSS second, SDL third
|
||||
audio_drivers_priority = \
|
||||
[ 'pa', 'coreaudio', 'dsound', 'oss' ] + \
|
||||
[ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \
|
||||
(targetos == 'linux' ? [] : [ 'sdl' ])
|
||||
audio_drivers_default = []
|
||||
foreach k: audio_drivers_priority
|
||||
@@ -3922,6 +3928,7 @@ if vnc.found()
|
||||
endif
|
||||
if targetos not in ['darwin', 'haiku', 'windows']
|
||||
summary_info += {'OSS support': oss}
|
||||
summary_info += {'sndio support': sndio}
|
||||
elif targetos == 'darwin'
|
||||
summary_info += {'CoreAudio support': coreaudio}
|
||||
elif targetos == 'windows'
|
||||
|
||||
+3
-1
@@ -21,7 +21,7 @@ option('tls_priority', type : 'string', value : 'NORMAL',
|
||||
option('default_devices', type : 'boolean', value : true,
|
||||
description: 'Include a default selection of devices in emulators')
|
||||
option('audio_drv_list', type: 'array', value: ['default'],
|
||||
choices: ['alsa', 'coreaudio', 'default', 'dsound', 'jack', 'oss', 'pa', 'sdl'],
|
||||
choices: ['alsa', 'coreaudio', 'default', 'dsound', 'jack', 'oss', 'pa', 'sdl', 'sndio'],
|
||||
description: 'Set audio driver list')
|
||||
option('block_drv_rw_whitelist', type : 'string', value : '',
|
||||
description: 'set block driver read-write whitelist (by default affects only QEMU, not tools like qemu-img)')
|
||||
@@ -240,6 +240,8 @@ option('oss', type: 'feature', value: 'auto',
|
||||
description: 'OSS sound support')
|
||||
option('pa', type: 'feature', value: 'auto',
|
||||
description: 'PulseAudio sound support')
|
||||
option('sndio', type: 'feature', value: 'auto',
|
||||
description: 'sndio sound support')
|
||||
|
||||
option('vhost_kernel', type: 'feature', value: 'auto',
|
||||
description: 'vhost kernel backend support')
|
||||
|
||||
+24
-1
@@ -106,6 +106,28 @@
|
||||
'*out': 'AudiodevAlsaPerDirectionOptions',
|
||||
'*threshold': 'uint32' } }
|
||||
|
||||
##
|
||||
# @AudiodevSndioOptions:
|
||||
#
|
||||
# Options of the sndio audio backend.
|
||||
#
|
||||
# @in: options of the capture stream
|
||||
#
|
||||
# @out: options of the playback stream
|
||||
#
|
||||
# @dev: the name of the sndio device to use (default 'default')
|
||||
#
|
||||
# @latency: play buffer size (in microseconds)
|
||||
#
|
||||
# Since: 7.2
|
||||
##
|
||||
{ 'struct': 'AudiodevSndioOptions',
|
||||
'data': {
|
||||
'*in': 'AudiodevPerDirectionOptions',
|
||||
'*out': 'AudiodevPerDirectionOptions',
|
||||
'*dev': 'str',
|
||||
'*latency': 'uint32'} }
|
||||
|
||||
##
|
||||
# @AudiodevCoreaudioPerDirectionOptions:
|
||||
#
|
||||
@@ -387,7 +409,7 @@
|
||||
##
|
||||
{ 'enum': 'AudiodevDriver',
|
||||
'data': [ 'none', 'alsa', 'coreaudio', 'dbus', 'dsound', 'jack', 'oss', 'pa',
|
||||
'sdl', 'spice', 'wav' ] }
|
||||
'sdl', 'sndio', 'spice', 'wav' ] }
|
||||
|
||||
##
|
||||
# @Audiodev:
|
||||
@@ -418,5 +440,6 @@
|
||||
'oss': 'AudiodevOssOptions',
|
||||
'pa': 'AudiodevPaOptions',
|
||||
'sdl': 'AudiodevSdlOptions',
|
||||
'sndio': 'AudiodevSndioOptions',
|
||||
'spice': 'AudiodevGenericOptions',
|
||||
'wav': 'AudiodevWavOptions' } }
|
||||
|
||||
@@ -769,6 +769,9 @@ DEF("audiodev", HAS_ARG, QEMU_OPTION_audiodev,
|
||||
"-audiodev sdl,id=id[,prop[=value][,...]]\n"
|
||||
" in|out.buffer-count= number of buffers\n"
|
||||
#endif
|
||||
#ifdef CONFIG_AUDIO_SNDIO
|
||||
"-audiodev sndio,id=id[,prop[=value][,...]]\n"
|
||||
#endif
|
||||
#ifdef CONFIG_SPICE
|
||||
"-audiodev spice,id=id[,prop[=value][,...]]\n"
|
||||
#endif
|
||||
@@ -935,6 +938,19 @@ SRST
|
||||
``in|out.buffer-count=count``
|
||||
Sets the count of the buffers.
|
||||
|
||||
``-audiodev sndio,id=id[,prop[=value][,...]]``
|
||||
Creates a backend using SNDIO. This backend is available on
|
||||
OpenBSD and most other Unix-like systems.
|
||||
|
||||
Sndio specific options are:
|
||||
|
||||
``in|out.dev=device``
|
||||
Specify the sndio device to use for input and/or output. Default
|
||||
is ``default``.
|
||||
|
||||
``in|out.latency=usecs``
|
||||
Sets the desired period length in microseconds.
|
||||
|
||||
``-audiodev spice,id=id[,prop[=value][,...]]``
|
||||
Creates a backend that sends audio through SPICE. This backend
|
||||
requires ``-spice`` and automatically selected in that case, so
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# This file is generated by meson-buildoptions.py, do not edit!
|
||||
meson_options_help() {
|
||||
printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices:'
|
||||
printf "%s\n" ' alsa/coreaudio/default/dsound/jack/oss/pa/sdl)'
|
||||
printf "%s\n" ' --audio-drv-list=CHOICES Set audio driver list [default] (choices: alsa/co'
|
||||
printf "%s\n" ' reaudio/default/dsound/jack/oss/pa/sdl/sndio)'
|
||||
printf "%s\n" ' --block-drv-ro-whitelist=VALUE'
|
||||
printf "%s\n" ' set block driver read-only whitelist (by default'
|
||||
printf "%s\n" ' affects only QEMU, not tools like qemu-img)'
|
||||
@@ -144,6 +144,7 @@ meson_options_help() {
|
||||
printf "%s\n" ' slirp-smbd use smbd (at path --smbd=*) in slirp networking'
|
||||
printf "%s\n" ' smartcard CA smartcard emulation support'
|
||||
printf "%s\n" ' snappy snappy compression support'
|
||||
printf "%s\n" ' sndio sndio sound support'
|
||||
printf "%s\n" ' sparse sparse checker'
|
||||
printf "%s\n" ' spice Spice server support'
|
||||
printf "%s\n" ' spice-protocol Spice protocol support'
|
||||
@@ -393,6 +394,8 @@ _meson_option_parse() {
|
||||
--disable-smartcard) printf "%s" -Dsmartcard=disabled ;;
|
||||
--enable-snappy) printf "%s" -Dsnappy=enabled ;;
|
||||
--disable-snappy) printf "%s" -Dsnappy=disabled ;;
|
||||
--enable-sndio) printf "%s" -Dsndio=enabled ;;
|
||||
--disable-sndio) printf "%s" -Dsndio=disabled ;;
|
||||
--enable-sparse) printf "%s" -Dsparse=enabled ;;
|
||||
--disable-sparse) printf "%s" -Dsparse=disabled ;;
|
||||
--sphinx-build=*) quote_sh "-Dsphinx_build=$2" ;;
|
||||
|
||||
Reference in New Issue
Block a user