From: Emmanouil Pitsidianakis <manos.pitsidianakis@linaro.org>
To: qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>
Cc: "Emmanouil Pitsidianakis" <manos.pitsidianakis@linaro.org>,
"Igor Skalkin" <Igor.Skalkin@opensynergy.com>,
"Anton Yakovlev" <Anton.Yakovlev@opensynergy.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Volker Rümelin" <vr_qemu@t-online.de>,
"Kővágó, Zoltán" <DirtY.iCE.hu@gmail.com>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Stefano Garzarella" <sgarzare@redhat.com>
Subject: [PATCH v12 00/11] Add VIRTIO sound card
Date: Thu, 19 Oct 2023 13:03:44 +0300 [thread overview]
Message-ID: <cover.1697709630.git.manos.pitsidianakis@linaro.org> (raw)
This patch series adds an audio device implementing the recent virtio
sound spec (1.2) and a corresponding PCI wrapper device.
v12 can be found online at:
https://gitlab.com/epilys/qemu/-/tree/virtio-snd-v12
Ref c660c8427853d90784a89b6f3b0c31e19cc3be95
Main differences with v11 patch series [^v11]:
- Moved devices from hw/virtio under hw/audio.
v10[^v10] -> v11[^v11]
======================
- Rebased against upstream, which has minor changes to the AUD_* API.
- Fixed noise in playback because of invalid bounds when accessing the
audio data in the VirtQueueElement.
- Refactor invalid I/O message queue flushing into separate function.
- Removed attempt to write unwritten bytes to QEMU sound backend when
flushing: it should only happen when the stream STARTs.
- Set latency_bytes to buffer size when returning TX I/O message because
it happens immediately after writing the last bytes to the QEMU
backend, therefore there might be up to <buffer size> bytes to be
played before all the buffer data has finished playing.
- Addressed [^v10] review comments:
- Refactored VirtIOSoundPCMBuffer return code into a function instead
of using goto labels in output/input audio callbacks. (Suggested by
<philmd@linaro.org>)
v9[^v9] -> v10[^v10]
====================
- Addressed [^v9] review comments.
- Copy buffer data just before playing it on the host instead of when
the IO message arrives. This in most cases takes care of the buffer
not being populated with data from the guest application when it
firsts arrives.
v8[^v8] -> v9[^v9]
==================
- Addressed [^v8] review comments.
- Add cpu_to_le32(_) and le32_to_cpu(_) conversions for messages from/to
the guest according to the virtio spec.
- Inlined some functions and types to reduce review complexity.
- Corrected the replies to IO messages; now both Playback and Capture
work correctly for me. (If you hear cracks in pulseaudio+guest, try
pipewire+guest).
v7[^v7] -> v8[^v8]
==================
- Addressed [^v7] review comments.
Functions that were called from more than one place for code re-use
are not created until they are actually needed.
- Fixed cases where block->offset was not respected in Playback
v6[^v6] -> v7[^v7]
==================
- Removed minor stale/duplicate code.
- Addressed [^v6] review comments.
Notably, the audio driver name is now `virtio` instead of
`virtio-sound`.
- Fixed some invalid pointer logic.
- Fixed minor typos and updated documentation.
v5[^v5] -> v6[^v6]
==================
- Free any existing PCM stream resources before allocating a new one.
- Add docs.
v4[^v4] -> v5[^v5]
==================
- Use ERRP_GUARD() to propagate errors.
- Use virtio_add_feature() instead of XORing constants.
- Use %zu format specifier for size_t.
v3[^v3] -> v4[^v4]
==================
- Addressed review style comments.
- Split patches for easier review.
v2[^v2] -> v3[^v3]
==================
- Addressed review comments.
v1[^v1] -> v2[^v2]
==================
- Split virtio-snd and virtio-snd-pci devices to two commits
- Added audio capture support
Previously:
[^v11]:
https://lore.kernel.org/qemu-devel/cover.1696935992.git.manos.pitsidianakis@linaro.org/
[^v10]:
https://lore.kernel.org/qemu-devel/cover.1695996196.git.manos.pitsidianakis@linaro.org/
[^v9]:
https://lore.kernel.org/qemu-devel/cover.1694588927.git.manos.pitsidianakis@linaro.org/
[^v8]:
https://lore.kernel.org/qemu-devel/cover.1693252037.git.manos.pitsidianakis@linaro.org/
[^v7]:
https://lore.kernel.org/qemu-devel/cover.1692731646.git.manos.pitsidianakis@linaro.org/
[^v6]:
https://lore.kernel.org/qemu-devel/cover.1692089917.git.manos.pitsidianakis@linaro.org/
[^v5]:
https://lore.kernel.org/qemu-devel/cover.1690626150.git.manos.pitsidianakis@linaro.org/
[^v4]:
https://lore.kernel.org/qemu-devel/cover.1689857559.git.manos.pitsidianakis@linaro.org/
[^v3]:
https://lore.kernel.org/qemu-devel/cover.1689692765.git.manos.pitsidianakis@linaro.org/
[^v2]:
https://lore.kernel.org/qemu-devel/cover.1686238728.git.manos.pitsidianakis@linaro.org/
[^v1]:
https://lore.kernel.org/qemu-devel/20230526204845.673031-1-manos.pitsidianakis@linaro.org/
Emmanouil Pitsidianakis (11):
Add virtio-sound device stub
Add virtio-sound-pci device
virtio-sound: handle control messages and streams
virtio-sound: handle VIRTIO_SND_R_PCM_INFO request
virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP}
virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS
virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE
virtio-sound: handle VIRTIO_SND_R_PCM_RELEASE
virtio-sound: implement audio output (TX)
virtio-sound: implement audio capture (RX)
docs/system: add basic virtio-snd documentation
MAINTAINERS | 9 +
docs/system/device-emulation.rst | 1 +
docs/system/devices/virtio-snd.rst | 49 +
hw/audio/Kconfig | 5 +
hw/audio/meson.build | 2 +
hw/audio/trace-events | 20 +
hw/audio/virtio-snd-pci.c | 93 ++
hw/audio/virtio-snd.c | 1409 ++++++++++++++++++++++++++++
include/hw/audio/virtio-snd.h | 235 +++++
system/qdev-monitor.c | 1 +
10 files changed, 1824 insertions(+)
create mode 100644 docs/system/devices/virtio-snd.rst
create mode 100644 hw/audio/virtio-snd-pci.c
create mode 100644 hw/audio/virtio-snd.c
create mode 100644 include/hw/audio/virtio-snd.h
base-commit: deaca3fd30d3a8829160f8d3705d65ad83176800
--
2.39.2
next reply other threads:[~2023-10-19 10:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-19 10:03 Emmanouil Pitsidianakis [this message]
2023-10-19 10:03 ` [PATCH v12 01/11] Add virtio-sound device stub Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 02/11] Add virtio-sound-pci device Emmanouil Pitsidianakis
2023-10-21 9:07 ` Volker Rümelin
2023-10-22 9:58 ` Manos Pitsidianakis
2023-10-22 11:51 ` Volker Rümelin
2023-10-23 8:48 ` Manos Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 03/11] virtio-sound: handle control messages and streams Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 04/11] virtio-sound: handle VIRTIO_SND_R_PCM_INFO request Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 05/11] virtio-sound: handle VIRTIO_SND_R_PCM_{START,STOP} Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 06/11] virtio-sound: handle VIRTIO_SND_R_PCM_SET_PARAMS Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 07/11] virtio-sound: handle VIRTIO_SND_R_PCM_PREPARE Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 08/11] virtio-sound: handle VIRTIO_SND_R_PCM_RELEASE Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 09/11] virtio-sound: implement audio output (TX) Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 10/11] virtio-sound: implement audio capture (RX) Emmanouil Pitsidianakis
2023-10-19 10:03 ` [PATCH v12 11/11] docs/system: add basic virtio-snd documentation Emmanouil Pitsidianakis
2023-10-19 14:37 ` [PATCH v12 00/11] Add VIRTIO sound card Alex Bennée
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cover.1697709630.git.manos.pitsidianakis@linaro.org \
--to=manos.pitsidianakis@linaro.org \
--cc=Anton.Yakovlev@opensynergy.com \
--cc=DirtY.iCE.hu@gmail.com \
--cc=Igor.Skalkin@opensynergy.com \
--cc=alex.bennee@linaro.org \
--cc=berrange@redhat.com \
--cc=eduardo@habkost.net \
--cc=kraxel@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@redhat.com \
--cc=vr_qemu@t-online.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).