qemu-cr16/include
Manos Pitsidianakis 18a752810f virtio-sound: implement audio output (TX)
Handle output IO messages in the transmit (TX) virtqueue.

It allocates a VirtIOSoundPCMBuffer for each IO message and copies the
data buffer to it. When the IO buffer is written to the host's sound
card, the guest will be notified that it has been consumed.

The lifetime of an IO message is:

1. Guest sends IO message to TX virtqueue.
2. QEMU adds it to the appropriate stream's IO buffer queue.
3. Sometime later, the host audio backend calls the output callback,
   virtio_snd_pcm_out_cb(), which is defined with an AUD_open_out()
   call. The callback gets an available number of bytes the backend can
   receive. Then it writes data from the IO buffer queue to the backend.
   If at any time a buffer is exhausted, it is returned to the guest as
   completed.
4. If the guest releases the stream, its buffer queue is flushed by
   attempting to write any leftover data to the audio backend and
   releasing all IO messages back to the guest. This is how according to
   the spec the guest knows the release was successful.

Based-on: 5a2f350eec
Signed-off-by: Igor Skalkin <Igor.Skalkin@opensynergy.com>
Signed-off-by: Anton Yakovlev <Anton.Yakovlev@opensynergy.com>
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Tested-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <b7c6fc458c763d09a4abbcb620ae9b220afa5b8f.1698062525.git.manos.pitsidianakis@linaro.org>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2023-11-07 03:39:10 -05:00
..
authz
block blockjob: query driver-specific info via a new 'query' driver method 2023-10-31 18:20:29 +01:00
chardev
crypto
disas
exec tcg: Drop unused tcg_temp_free define 2023-10-23 14:45:46 -07:00
fpu
gdbstub
hw virtio-sound: implement audio output (TX) 2023-11-07 03:39:10 -05:00
io
libdecnumber
migration migration: per-mode blockers 2023-11-01 16:13:59 +01:00
monitor
net
qapi
qemu util/defer-call: move defer_call() to util/ 2023-10-31 15:41:42 +01:00
qom
scsi
semihosting
standard-headers
sysemu dump: Allow directly outputting raw kdump format 2023-11-02 18:05:02 +04:00
tcg tcg: Export tcg_gen_ext_{i32,i64,tl} 2023-10-22 16:32:28 -07:00
ui ui/input: Constify QemuInputHandler structure 2023-10-19 23:13:28 +02:00
user
elf.h
glib-compat.h
qemu-io.h
qemu-main.h