This patch series adds support to multiple audio backends. Afterwards I add support to multiple backends. Audio fronteds gain a new audiodev option to specify the id of the audiodev to use. The audiodev= option is required, unless you use the old environment variable based configuration, in that case it must not used (and you can't use multiple backends).
Finally I also make mixeng usage optional, it can save us some useless format converting when not needed. Also makes easier to support formats currently not supported by qemu (as only the backend has to support it, not the mixeng). For easier testing pull https://github.com/DirtYiCE/qemu.git tag audio-multi-v2. Please review. --- Changes from v1: * added qemu_opts_print patch as it's still not merged * splitted the big -audiodev and remove mixeng from backend commits * tons of bugfixes and typo fixing Kővágó, Zoltán (49): opts: produce valid command line in qemu_opts_print qapi: support implicit structs in OptsVisitor qapi: convert NumaOptions into a flat union net: remove NetLegacy struct net: use Netdev instead of NetClientOptions in client init qapi: change Netdev into a flat union qapi: reorder NetdevBase and Netdev qapi: qapi for audio backends qapi: support nested structs in OptsVisitor audio: use qapi AudioFormat instead of audfmt_e audio: -audiodev command line option: documentation audio: -audiodev command line option basic implementation alsaaudio: port to -audiodev config coreaudio: port to -audiodev config dsoundaudio: port to -audiodev config noaudio: port to -audiodev config ossaudio: port to -audiodev config paaudio: port to -audiodev config sdlaudio: port to -audiodev config spiceaudio: port to -audiodev config wavaudio: port to -audiodev config audio: -audiodev command line option: cleanup audio: reduce glob_audio_state usage audio: basic support for multi backend audio audio: add audiodev properties to frontends audio: audiodev= parameters no longer optional when -audiodev present paaudio: do not create multiple connections to the same server paaudio: do not move stream when sink/source name is specified paaudio: properly disconnect streams in fini_* audio: remove audio_MIN, audio_MAX audio: do not run each backend in audio_run paaudio: fix playback glitches audio: remove read and write pcm_ops audio: use size_t where makes sense audio: api for mixeng code free backends alsaaudio: port to the new audio backend api coreaudio: port to the new audio backend api dsoundaudio: port to the new audio backend api noaudio: port to the new audio backend api ossaudio: port to the new audio backend api paaudio: port to the new audio backend api sdlaudio: port to the new audio backend api spiceaudio: port to the new audio backend api wavaudio: port to the new audio backend api audio: remove remains of the old backend api audio: unify input and output mixeng buffer management audio: remove hw->samples, buffer_size_in/out pcm_ops audio: common rate control code for timer based outputs audio: split ctl_* functions into enable_* and volume_* Makefile | 4 +- audio/Makefile.objs | 3 +- audio/alsaaudio.c | 740 +++++----------- audio/audio.c | 1390 +++++++++++++++---------------- audio/audio.h | 66 +- audio/audio_int.h | 121 +-- audio/audio_legacy.c | 333 ++++++++ audio/audio_pt_int.c | 173 ---- audio/audio_pt_int.h | 22 - audio/audio_template.h | 89 +- audio/audio_win_int.c | 18 +- audio/coreaudio.c | 198 ++--- audio/dsound_template.h | 59 +- audio/dsoundaudio.c | 445 +++------- audio/mixeng.h | 11 +- audio/noaudio.c | 98 +-- audio/ossaudio.c | 588 +++++-------- audio/paaudio.c | 828 +++++++----------- audio/rate_template.h | 2 +- audio/sdlaudio.c | 183 ++-- audio/spiceaudio.c | 283 +++---- audio/wavaudio.c | 156 +--- audio/wavcapture.c | 8 +- block.c | 2 +- configure | 5 - hmp-commands.hx | 11 +- hw/arm/musicpal.c | 2 +- hw/arm/omap2.c | 2 +- hw/audio/ac97.c | 13 +- hw/audio/adlib.c | 7 +- hw/audio/cs4231a.c | 11 +- hw/audio/es1370.c | 17 +- hw/audio/gus.c | 9 +- hw/audio/hda-codec.c | 19 +- hw/audio/lm4549.c | 6 +- hw/audio/milkymist-ac97.c | 16 +- hw/audio/pcspk.c | 5 +- hw/audio/pl041.c | 1 + hw/audio/sb16.c | 17 +- hw/audio/wm8750.c | 14 +- hw/core/qdev-properties-system.c | 59 +- hw/input/tsc210x.c | 2 +- hw/net/allwinner_emac.c | 2 +- hw/net/cadence_gem.c | 2 +- hw/net/dp8393x.c | 2 +- hw/net/e1000.c | 2 +- hw/net/eepro100.c | 2 +- hw/net/etraxfs_eth.c | 2 +- hw/net/fsl_etsec/etsec.c | 2 +- hw/net/lan9118.c | 2 +- hw/net/lance.c | 2 +- hw/net/mcf_fec.c | 2 +- hw/net/milkymist-minimac2.c | 2 +- hw/net/mipsnet.c | 2 +- hw/net/ne2000-isa.c | 2 +- hw/net/ne2000.c | 2 +- hw/net/opencores_eth.c | 2 +- hw/net/pcnet-pci.c | 2 +- hw/net/rocker/rocker_fp.c | 2 +- hw/net/rtl8139.c | 2 +- hw/net/smc91c111.c | 2 +- hw/net/spapr_llan.c | 2 +- hw/net/stellaris_enet.c | 2 +- hw/net/vhost_net.c | 18 +- hw/net/virtio-net.c | 6 +- hw/net/vmxnet3.c | 2 +- hw/net/xen_nic.c | 2 +- hw/net/xgmac.c | 2 +- hw/net/xilinx_axienet.c | 2 +- hw/net/xilinx_ethlite.c | 2 +- hw/usb/dev-audio.c | 3 +- hw/usb/dev-network.c | 2 +- include/hw/qdev-properties.h | 3 + include/net/net.h | 4 +- monitor.c | 26 +- net/clients.h | 20 +- net/dump.c | 8 +- net/hub.c | 24 +- net/l2tpv3.c | 8 +- net/net.c | 129 ++- net/netmap.c | 6 +- net/slirp.c | 8 +- net/socket.c | 10 +- net/tap-win32.c | 8 +- net/tap.c | 28 +- net/vde.c | 8 +- net/vhost-user.c | 14 +- numa.c | 2 +- qapi-schema.json | 132 +-- qapi/audio.json | 263 ++++++ qapi/opts-visitor.c | 131 ++- qemu-options.hx | 227 ++++- tests/qapi-schema/qapi-schema-test.json | 9 +- tests/qapi-schema/qapi-schema-test.out | 6 +- tests/qemu-iotests/017.out | 2 +- tests/qemu-iotests/018.out | 2 +- tests/qemu-iotests/019.out | 2 +- tests/qemu-iotests/020.out | 2 +- tests/qemu-iotests/024.out | 2 +- tests/qemu-iotests/028.out | 4 +- tests/qemu-iotests/034.out | 2 +- tests/qemu-iotests/037.out | 2 +- tests/qemu-iotests/038.out | 2 +- tests/qemu-iotests/039.out | 2 +- tests/qemu-iotests/043.out | 12 +- tests/qemu-iotests/046.out | 2 +- tests/qemu-iotests/049.out | 22 +- tests/qemu-iotests/050.out | 2 +- tests/qemu-iotests/051.out | 2 +- tests/qemu-iotests/061.out | 10 +- tests/qemu-iotests/069.out | 2 +- tests/qemu-iotests/073.out | 2 +- tests/qemu-iotests/079.out | 18 +- tests/qemu-iotests/082.out | 4 +- tests/qemu-iotests/085.out | 38 +- tests/qemu-iotests/095.out | 4 +- tests/qemu-iotests/097.out | 16 +- tests/qemu-iotests/098.out | 8 +- tests/qemu-iotests/110.out | 4 +- tests/qemu-iotests/112.out | 4 +- tests/qemu-iotests/114.out | 2 +- tests/qemu-iotests/115.out | 2 +- tests/qemu-iotests/121.out | 4 +- tests/qemu-iotests/122.out | 6 +- tests/qemu-iotests/130.out | 4 +- tests/qemu-iotests/common.filter | 2 +- tests/test-opts-visitor.c | 34 + ui/vnc.c | 29 +- ui/vnc.h | 2 + util/qemu-option.c | 29 +- vl.c | 11 +- 131 files changed, 3578 insertions(+), 3910 deletions(-) create mode 100644 audio/audio_legacy.c delete mode 100644 audio/audio_pt_int.c delete mode 100644 audio/audio_pt_int.h create mode 100644 qapi/audio.json -- 2.5.0