From: Markus Armbruster <armbru@redhat.com>
To: marcandre.lureau@redhat.com
Cc: qemu-devel@nongnu.org, "Gerd Hoffmann" <kraxel@redhat.com>,
"Thomas Huth" <huth@tuxfamily.org>,
"Akihiko Odaki" <odaki@rsg.ci.i.u-tokyo.ac.jp>,
"Alexandre Ratchov" <alex@caoua.org>,
dirty.ice.hu@gmail.com,
"Christian Schoenebeck" <qemu_oss@crudebyte.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Volker Rümelin" <vr_qemu@t-online.de>,
"Eric Blake" <eblake@redhat.com>,
"Manos Pitsidianakis" <manos.pitsidianakis@linaro.org>,
qemu-rust@nongnu.org (open list:Rust-related patc...)
Subject: Re: [RFC 24/24] WIP: rust/audio: add GStreamer backend
Date: Mon, 01 Dec 2025 14:12:05 +0100 [thread overview]
Message-ID: <87pl8y1h3u.fsf@pond.sub.org> (raw)
In-Reply-To: <20251201112309.4163921-25-marcandre.lureau@redhat.com> (marcandre lureau's message of "Mon, 1 Dec 2025 15:23:05 +0400")
marcandre.lureau@redhat.com writes:
> From: Marc-André Lureau <marcandre.lureau@redhat.com>
>
> This patch introduce a rust/audio crate that replaces QEMU audio/
> mixing/resampling code with GStreamer and Rust. It could potentially
> remove the need for all the system-specific audio API implementation,
> since GStreamer has audio elements for
> ALSA/Pipewire/PulseAudio/jack/OSX/WASAPI etc (removing ~10k loc).
>
> TODO:
> - test on various system, with various configuration to see if this
> backend can replace the other QEMU audio backends
> - add a spicesink/spicesrc to handle spice, or rewrite spice to use
> the capture approach used by VNC code. Or drop capture support, and
> use custom qemusrc/qemusink for both Spice and VNC, lowering the feature
> and behaviour disparity.
> - build-sys: make gstreamer optional
> - build-sys: loadable module support
> - investigate dropping get_buffer_size_out()
> - investigate improving emulated devices to not require regular
> timers (appsrc need-data is called once)
> - add generic audio backend tests
> - more tests for the mixing/liveadder behaviour (synchronization)
> - other: replace audio/dbus with a rust implementation (not using gstreamer)
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> ---
> qapi/audio.json | 29 +
> audio/audio-driver_template.h | 2 +
> rust/audio/wrapper.h | 27 +
> audio/audio.c | 5 +
> Cargo.lock | 572 ++++++++++++++++--
> Cargo.toml | 6 +
> audio/trace-events | 5 +
> rust/audio/Cargo.toml | 29 +
> rust/audio/build.rs | 49 ++
> rust/audio/meson.build | 75 +++
> rust/audio/src/audio.rs | 516 ++++++++++++++++
> rust/audio/src/bindings.rs | 32 +
> rust/audio/src/gstreamer.rs | 1070 +++++++++++++++++++++++++++++++++
> rust/audio/src/lib.rs | 99 +++
> rust/meson.build | 6 +
> 15 files changed, 2467 insertions(+), 55 deletions(-)
> create mode 100644 rust/audio/wrapper.h
> create mode 100644 rust/audio/Cargo.toml
> create mode 100644 rust/audio/build.rs
> create mode 100644 rust/audio/meson.build
> create mode 100644 rust/audio/src/audio.rs
> create mode 100644 rust/audio/src/bindings.rs
> create mode 100644 rust/audio/src/gstreamer.rs
> create mode 100644 rust/audio/src/lib.rs
>
> diff --git a/qapi/audio.json b/qapi/audio.json
> index 2df87b9710..76dc7cbfa6 100644
> --- a/qapi/audio.json
> +++ b/qapi/audio.json
> @@ -128,6 +128,33 @@
> '*out': 'AudiodevAlsaPerDirectionOptions',
> '*threshold': 'uint32' } }
>
> + ##
> + # @AudiodevGStreamerOptions:
> + #
> + # Options of the GStreamer audio backend.
> + #
> + # @in: options of the capture stream
> + #
> + # @out: options of the playback stream
> + #
> + # @sink: the name of the GStreamer sink element to use
> + # (default 'autoaudiosink')
> + #
> + # @source: the name of the GStreamer source element to use
> + # (default 'autoaudiosrc')
Are 'autoaudiosink' and 'autoaudiosrc' well-known GStreamer names, or
arbitrary?
> + #
> + # Since: 11.0
> + ##
> + { 'struct': 'AudiodevGStreamerOptions',
> + 'data': {
> + '*in': 'AudiodevPerDirectionOptions',
> + '*out': 'AudiodevPerDirectionOptions',
> + '*sink': 'str',
> + '*source': 'str'
> + }
> + }
Unindent by four, and format the doc comment like this:
##
# @AudiodevGStreamerOptions:
#
# Options of the GStreamer audio backend.
#
# @in: options of the capture stream
#
# @out: options of the playback stream
#
# @sink: the name of the GStreamer sink element to use
# (default 'autoaudiosink')
#
# @source: the name of the GStreamer source element to use
# (default 'autoaudiosrc')
#
# Since: 11.0
##
> +
> +
> ##
> # @AudiodevSndioOptions:
> #
> @@ -484,6 +511,7 @@
> { 'name': 'sdl', 'if': 'CONFIG_AUDIO_SDL' },
> { 'name': 'sndio', 'if': 'CONFIG_AUDIO_SNDIO' },
> { 'name': 'spice', 'if': 'CONFIG_SPICE' },
> + { 'name': 'gstreamer' },
Short form suffices:
'gstreamer',
> 'wav' ] }
>
> ##
> @@ -530,6 +558,7 @@
> 'if': 'CONFIG_AUDIO_SNDIO' },
> 'spice': { 'type': 'AudiodevGenericOptions',
> 'if': 'CONFIG_SPICE' },
> + 'gstreamer': { 'type': 'AudiodevGStreamerOptions' },
Short form suffices:
'gstreamer': 'AudiodevGStreamerOptions',
> 'wav': 'AudiodevWavOptions' } }
>
> ##
[...]
next prev parent reply other threads:[~2025-12-01 13:12 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-01 11:22 [RFC 00/24] audio: add GStreamer backend marcandre.lureau
2025-12-01 11:22 ` [RFC 01/24] rust: patch thiserror to work with meson marcandre.lureau
2025-12-01 11:22 ` [RFC 02/24] audio: remove obsolete/obscure functions marcandre.lureau
2025-12-10 14:02 ` Akihiko Odaki
2025-12-01 11:22 ` [RFC 03/24] audio/dbus: make "dbus" the default backend when using -display dbus marcandre.lureau
2025-12-10 14:03 ` Akihiko Odaki
2025-12-01 11:22 ` [RFC 04/24] qemu-options.hx: clarify default audio backend selection marcandre.lureau
2025-12-01 11:22 ` [RFC 05/24] audio: introduce AudioDriver marcandre.lureau
2025-12-11 5:22 ` Akihiko Odaki
2025-12-01 11:22 ` [RFC 06/24] audio: simplify audio_init() marcandre.lureau
2025-12-01 11:22 ` [RFC 07/24] audio: move object creation to audio_driver_init() marcandre.lureau
2025-12-01 11:22 ` [RFC 08/24] audio: add QOM module-objects for each backend marcandre.lureau
2025-12-01 13:20 ` BALATON Zoltan
2025-12-01 18:43 ` Marc-André Lureau
2025-12-01 11:22 ` [RFC 09/24] audio: remove set_dbus_server from audio_driver marcandre.lureau
2025-12-01 11:22 ` [RFC 10/24] audio: lookup "audio-" object types, and realize them marcandre.lureau
2025-12-01 11:22 ` [RFC 11/24] audio: switch to module-object, drop audio driver registration marcandre.lureau
2025-12-01 11:22 ` [RFC 12/24] module: remove audio module support marcandre.lureau
2025-12-01 11:22 ` [RFC 13/24] audio: keep a strong reference on the backend marcandre.lureau
2025-12-01 11:22 ` [RFC 14/24] audio: make list type declaration private marcandre.lureau
2025-12-01 11:22 ` [RFC 15/24] audio: make create_pdos() private marcandre.lureau
2025-12-01 11:22 ` [RFC 16/24] replay: remove dependency on audio/ marcandre.lureau
2025-12-01 11:22 ` [RFC 17/24] audio: make all the backend-specific APIs take the be marcandre.lureau
2025-12-01 11:22 ` [RFC 18/24] audio: make AudioBackend truely abstract marcandre.lureau
2025-12-01 11:23 ` [RFC 19/24] audio: split AudioBackend marcandre.lureau
2025-12-01 11:23 ` [RFC 20/24] audio: AUD_ -> audio_be_ marcandre.lureau
2025-12-01 11:23 ` [RFC 21/24] audio-be: add common pre-conditions marcandre.lureau
2025-12-01 11:23 ` [RFC 22/24] audio-be: add some state trace marcandre.lureau
2025-12-01 11:23 ` [RFC 23/24] audio: split AudioDriver code in audio-driver.c marcandre.lureau
2025-12-01 11:23 ` [RFC 24/24] WIP: rust/audio: add GStreamer backend marcandre.lureau
2025-12-01 13:12 ` Markus Armbruster [this message]
2025-12-01 18:26 ` Marc-André Lureau
2025-12-01 13:02 ` [RFC 00/24] audio: " BALATON Zoltan
2025-12-01 13:41 ` Christian Schoenebeck
2025-12-01 18:20 ` Marc-André Lureau
2025-12-01 19:30 ` BALATON Zoltan
2025-12-01 19:44 ` Daniel P. Berrangé
2025-12-02 12:01 ` BALATON Zoltan
2025-12-01 20:58 ` Alexandre Ratchov
2025-12-02 7:55 ` Paolo Bonzini
2025-12-02 12:03 ` BALATON Zoltan
2025-12-02 12:25 ` Geoffrey McRae
2025-12-02 12:44 ` Marc-André Lureau
2025-12-02 13:25 ` Geoffrey McRae
2025-12-02 14:14 ` Marc-André Lureau
2025-12-02 14:33 ` Neal Gompa
2025-12-02 14:43 ` Geoffrey McRae
2025-12-02 14:52 ` Markus Armbruster
2025-12-03 9:19 ` Akihiko Odaki
2025-12-02 15:39 ` Christian Schoenebeck
2025-12-03 8:06 ` Alexandre Ratchov
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=87pl8y1h3u.fsf@pond.sub.org \
--to=armbru@redhat.com \
--cc=alex@caoua.org \
--cc=dirty.ice.hu@gmail.com \
--cc=eblake@redhat.com \
--cc=huth@tuxfamily.org \
--cc=kraxel@redhat.com \
--cc=manos.pitsidianakis@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=odaki@rsg.ci.i.u-tokyo.ac.jp \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-rust@nongnu.org \
--cc=qemu_oss@crudebyte.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).