From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306144; cv=none; d=zohomail.com; s=zohoarc; b=HbshKsDu0wra6ANk3HK45SWYhxvjo+zOOgj46kgpynjDsIKzeXKhX7uKo7fjp8VrGwhLITCsARUpvoBYd+cGwtJ/ez/N6SgJkW8vfLgD9+25mti+Ca5T2lF0eoOQk7R8ld82LuIt4a6Ik5jO7GbNPYxXzfdi+vxpWStjHt87yVs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306144; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=ls0bepPgan6SXopc401jXzwdANvz23800COR8K8r76A=; b=Fh5d+T0IrfIl1NmcItF+JYjLMsZQPB6Hc6j96QU1xGQ6qAdSiuMhF0PvyESg6jMejxshO9yt37uviZF3LF4LK0keBPaoWlgeQn7HDC0B7HP/vKA5zV2chl0Qakg0bt2ruaSYWmf6FHacp1clEFiXa/65S2WCNowxl2TcwCW9l2w= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306143685659.5044768262059; Mon, 16 Feb 2026 21:29:03 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcr-0002cP-9y; Tue, 17 Feb 2026 00:27:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcm-0002aa-OD for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDci-0006cD-Mf for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 561578850B; Tue, 17 Feb 2026 08:27:43 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-ia88aOt0; Tue, 17 Feb 2026 08:27:42 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306062; bh=ls0bepPgan6SXopc401jXzwdANvz23800COR8K8r76A=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=hhznRAKEvTF2eXcPYZ5ytvDNDsU0GQX08HQt6UnUfvC6CkuM4tRjvf3dfYJU9Bmn6 CvzPgqcRPVgNdojefbqL/8BZ2fm/F90cQ3SpiGl8JqVeGnekK9TUL/d4lptRp7Pe+h 1b7H78E//OOcCtFXeg+82869BxSpbQgqm8yyE+gk= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 1/8] audio: add `audio` build option for meson and Kconfig Date: Tue, 17 Feb 2026 10:27:33 +0500 Message-Id: <20260217052740.114117-2-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306148725158500 Content-Type: text/plain; charset="utf-8" This patch adds the `audio` option to meson_options.txt. It is propagated into Kconfig as AUDIO. It is enabled by default. The corresponding `--disable-audio` and `--enable-audio` options for `configure` are also added. For now, this option does nothing. In subsequent patches, it will gradually disable audio in different places. The final goal is to stop building sources from `audio/` and `hw/audio/` and other audio-related files (except for some stubs). Note that this intent is different from `-audio none`, which mutes audio but still compiles the audio subsystem. Signed-off-by: Sergei Heifetz --- Kconfig.host | 3 +++ configure | 4 ++++ meson.build | 3 +++ meson_options.txt | 3 +++ 4 files changed, 13 insertions(+) diff --git a/Kconfig.host b/Kconfig.host index 933425c74b..ec129aa4fc 100644 --- a/Kconfig.host +++ b/Kconfig.host @@ -29,6 +29,9 @@ config IVSHMEM config TPM bool =20 +config AUDIO + bool + config FDT bool =20 diff --git a/configure b/configure index 4b61fd3bbf..ff391c79a1 100755 --- a/configure +++ b/configure @@ -762,6 +762,10 @@ for opt do ;; --wasm64-32bit-address-limit) ;; + --enable-audio) meson_option_add -Daudio=3Dtrue + ;; + --disable-audio) meson_option_add -Daudio=3Dfalse + ;; # everything else has the same name in configure and meson --*) meson_option_parse "$opt" "$optarg" ;; diff --git a/meson.build b/meson.build index 8c6c0a9a32..69aa7cd189 100644 --- a/meson.build +++ b/meson.build @@ -68,6 +68,8 @@ foreach target : target_dirs endforeach have_user =3D have_linux_user or have_bsd_user =20 +audio_enabled =3D get_option('audio') + ############ # Programs # ############ @@ -3244,6 +3246,7 @@ disassemblers =3D { have_ivshmem =3D config_host_data.get('CONFIG_EVENTFD') host_kconfig =3D \ (get_option('fuzzing') ? ['CONFIG_FUZZ=3Dy'] : []) + \ + (audio_enabled ? ['CONFIG_AUDIO=3Dy'] : []) + \ (have_tpm ? ['CONFIG_TPM=3Dy'] : []) + \ (pixman.found() ? ['CONFIG_PIXMAN=3Dy'] : []) + \ (spice.found() ? ['CONFIG_SPICE=3Dy'] : []) + \ diff --git a/meson_options.txt b/meson_options.txt index 2836156257..172ed10ead 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -71,6 +71,9 @@ option('malloc_trim', type : 'feature', value : 'auto', option('malloc', type : 'combo', choices : ['system', 'tcmalloc', 'jemallo= c'], value: 'system', description: 'choose memory allocator to use') =20 +option('audio', type: 'boolean', value: true, + description: 'Audio support') + option('kvm', type: 'feature', value: 'auto', description: 'KVM acceleration support') option('mshv', type: 'feature', value: 'auto', --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306158; cv=none; d=zohomail.com; s=zohoarc; b=HeV47cK0RoP8sdpgT2aE26FH8mx6rj/639/NTp0SXh39spXwRbF7kylJPkyvgKW1jB1r4cgg2L9BXRsjAnncvAcXme0WVQOSijw0Aw/CGqaeAsy57V/4oAX+l0RacY0LxoanFcwQpjW6rmtS3SCg9ugypOCdJr7m4lU5YRjHDRw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306158; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fYgqFZ4oPOcspu6TbeYRGEKZTYe+Bf86zf84nP7o7zQ=; b=YeddKSNOzMg81AdCf/8rX30OJRJFOv+22BIItl3LjFtUI2D5yjzkQ+Z9l1VN0haiBspBM+DS+XkOkXWaZuTBy/y5Dtw7/1TNSXUfvA1Zhmx2oV0VInEtRm7N02+U+CGAKtS6OxSUxTIKaydwggzN3RDxsXtm1D35vq6Lt6fd1QI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306158467233.37953931443144; Mon, 16 Feb 2026 21:29:18 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcs-0002cb-5k; Tue, 17 Feb 2026 00:27:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcm-0002ac-Pj for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDci-0006cE-Ok for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 75B6E8078A; Tue, 17 Feb 2026 08:27:44 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-khrc0VDj; Tue, 17 Feb 2026 08:27:43 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306064; bh=fYgqFZ4oPOcspu6TbeYRGEKZTYe+Bf86zf84nP7o7zQ=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=hAcY0duxyb4wFoqatHaIJG+Xch4pm0lnEhfTU5NxDt4oL7/EM0vYjVPLcSEEFJczF guUouZLXmU9eHT2UpOuIbF1CItnmq90VEwRt3N/4EHihwUvNU7HkQ6kBVlxDCpogAD QdS8d1SSxfn7Cqi/vzT7S35QAfj/q6snr0mczHYU= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 2/8] ui/vnc: disable audio feature when configured with --disable-audio Date: Tue, 17 Feb 2026 10:27:34 +0500 Message-Id: <20260217052740.114117-3-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306162994154100 Content-Type: text/plain; charset="utf-8" Disable the audio feature in VNC when QEMU is configured with `--disable-audio`. Do not compile the corresponding audio-related code. Signed-off-by: Sergei Heifetz --- ui/vnc.c | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index a61a4f937d..8212d3ce81 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1072,6 +1072,7 @@ static void vnc_update_throttle_offset(VncState *vs) size_t offset =3D vs->client_width * vs->client_height * vs->client_pf.bytes_per_pix= el; =20 +#ifdef CONFIG_AUDIO if (vs->audio_cap) { int bps; switch (vs->as.fmt) { @@ -1091,6 +1092,7 @@ static void vnc_update_throttle_offset(VncState *vs) } offset +=3D vs->as.freq * bps * vs->as.nchannels; } +#endif =20 /* Put a floor of 1MB on offset, so that if we have a large pending * buffer and the display is resized to a small size & back again @@ -1214,6 +1216,7 @@ static int vnc_update_client(VncState *vs, int has_di= rty) return n; } =20 +#ifdef CONFIG_AUDIO /* audio */ static void audio_capture_notify(void *opaque, audcnotification_e cmd) { @@ -1293,6 +1296,7 @@ static void audio_del(VncState *vs) vs->audio_cap =3D NULL; } } +#endif =20 static void vnc_disconnect_start(VncState *vs) { @@ -1332,7 +1336,9 @@ void vnc_disconnect_finish(VncState *vs) #ifdef CONFIG_VNC_SASL vnc_sasl_client_cleanup(vs); #endif /* CONFIG_VNC_SASL */ +#ifdef CONFIG_AUDIO audio_del(vs); +#endif qkbd_state_lift_all_keys(vs->vd->kbd); =20 if (vs->mouse_mode_notifier.notify !=3D NULL) { @@ -2097,6 +2103,7 @@ static void send_ext_key_event_ack(VncState *vs) vnc_flush(vs); } =20 +#ifdef CONFIG_AUDIO static void send_ext_audio_ack(VncState *vs) { vnc_lock_output(vs); @@ -2110,6 +2117,7 @@ static void send_ext_audio_ack(VncState *vs) vnc_unlock_output(vs); vnc_flush(vs); } +#endif =20 static void send_xvp_message(VncState *vs, int code) { @@ -2197,10 +2205,15 @@ static void set_encodings(VncState *vs, int32_t *en= codings, size_t n_encodings) send_ext_key_event_ack(vs); break; case VNC_ENCODING_AUDIO: +#ifdef CONFIG_AUDIO if (vs->vd->audio_be) { vnc_set_feature(vs, VNC_FEATURE_AUDIO); send_ext_audio_ack(vs); } +#else + VNC_DEBUG("Audio encoding received with audio subsystem " + "disabled\n"); +#endif break; case VNC_ENCODING_WMVi: vnc_set_feature(vs, VNC_FEATURE_WMVI); @@ -2394,7 +2407,9 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) { int i; uint16_t limit; - uint32_t freq; + #ifdef CONFIG_AUDIO + uint32_t freq; + #endif VncDisplay *vd =3D vs->vd; =20 if (data[0] > 3) { @@ -2571,7 +2586,9 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) vnc_client_error(vs); break; } - +#ifndef CONFIG_AUDIO + abort(); +#else if (len =3D=3D 2) return 4; =20 @@ -2626,7 +2643,7 @@ static int protocol_client_msg(VncState *vs, uint8_t = *data, size_t len) break; } break; - +#endif default: VNC_DEBUG("Msg: %d\n", read_u16(data, 0)); vnc_client_error(vs); @@ -3369,10 +3386,12 @@ static void vnc_connect(VncDisplay *vd, QIOChannelS= ocket *sioc, vs->last_x =3D -1; vs->last_y =3D -1; =20 +#ifdef CONFIG_AUDIO vs->as.freq =3D 44100; vs->as.nchannels =3D 2; vs->as.fmt =3D AUDIO_FORMAT_S16; vs->as.endianness =3D 0; +#endif =20 qemu_mutex_init(&vs->output_mutex); vs->bh =3D qemu_bh_new(vnc_jobs_bh, vs); @@ -3645,9 +3664,11 @@ static QemuOptsList qemu_vnc_opts =3D { },{ .name =3D "non-adaptive", .type =3D QEMU_OPT_BOOL, +#ifdef CONFIG_AUDIO },{ .name =3D "audiodev", .type =3D QEMU_OPT_STRING, +#endif },{ .name =3D "power-control", .type =3D QEMU_OPT_BOOL, @@ -4080,7 +4101,9 @@ void vnc_display_open(const char *id, Error **errp) const char *saslauthz; int lock_key_sync =3D 1; int key_delay_ms; +#ifdef CONFIG_AUDIO const char *audiodev; +#endif const char *passwordSecret; =20 if (!vd) { @@ -4238,6 +4261,7 @@ void vnc_display_open(const char *id, Error **errp) } vd->ledstate =3D 0; =20 +#ifdef CONFIG_AUDIO audiodev =3D qemu_opt_get(opts, "audiodev"); if (audiodev) { vd->audio_be =3D audio_be_by_name(audiodev, errp); @@ -4247,6 +4271,7 @@ void vnc_display_open(const char *id, Error **errp) } else { vd->audio_be =3D audio_get_default_audio_be(NULL); } +#endif =20 device_id =3D qemu_opt_get(opts, "display"); if (device_id) { --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306120; cv=none; d=zohomail.com; s=zohoarc; b=OWC7UxUTAy65qF/fb/QJq4SjoK8FOsG3xpHEAAif3MNDlb1QfV9QMSIwVCKePPYKqrdX93mfRFzBX2pLPIeKlCQJytAC2XxEqWLVn1L/9ZPQAorRCoUqO9IO2xjU2Ek0L2qUnHZR6/TvL1XXFZ042No6a83fp0CMkYi9SA5x3T4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306120; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=gVDsyAnPvKXIrppFpAPLU1Dx6eIyY1uxNTAGYrBtVlU=; b=oAUJaLevFkc9zGppuGRjIF48uA866iO01UduV+3HC+sxcwio4r9qT5Io4NuDKkUktlAlo+3tNM/QIWRCZwCj4zsnEf1guypYO59nzwVbsby927oKM78FYsnlzj1YD96Wgh475cRVSKE/lrwn8Lw2iNn1u7+iS2+/1RYfTdyesL4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306120019847.659198954461; Mon, 16 Feb 2026 21:28:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcn-0002aj-9G; Tue, 17 Feb 2026 00:27:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcl-0002aE-Bi for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:51 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDci-0006cK-Kz for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:51 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id 86C3E88506; Tue, 17 Feb 2026 08:27:45 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-aBVbQoCC; Tue, 17 Feb 2026 08:27:45 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306065; bh=gVDsyAnPvKXIrppFpAPLU1Dx6eIyY1uxNTAGYrBtVlU=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=M6bsAfAhEVYxA75/oPestTC//JczciLolGM8zQouHHkK7AR/zAZdMkgvk5amMYesG vdY0ZG4peqEmmtWxgw1oDCsj6CGFumvLFA6hxob28tfDvCRPvNw+xFkcb9VQk4D6Eo skj6YTPLMxUGQc+xspxKF4UvERVEWAvc3xXN53D0= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 3/8] tests/qtest: remove -audio none when configured with --disable-audio Date: Tue, 17 Feb 2026 10:27:35 +0500 Message-Id: <20260217052740.114117-4-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306123757154100 Content-Type: text/plain; charset="utf-8" It does not matter much whether `-audio none` is passed. In the future, support for `-audio none` with `--disable-audio` will be dropped, so we should remove it beforehand. Signed-off-by: Sergei Heifetz Reviewed-by: Thomas Huth --- tests/qtest/libqtest.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 794d870085..adb968f40e 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -464,7 +464,9 @@ gchar *qtest_qemu_args(const char *extra_args) "-chardev socket,path=3D%s,id=3Dchar0 " "-mon chardev=3Dchar0,mode=3Dcontrol " "-display none " +#ifdef CONFIG_AUDIO "-audio none " +#endif "%s" "%s" " -accel qtest", --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306120; cv=none; d=zohomail.com; s=zohoarc; b=XoGm04E5wgb2RR7qyVGNZSBQQgnC4ONiFpfhUNyrI0iVJ/XIcNc1mW2VqbdI1GEc+iNHgb8EPyYBC3lacORImzCL48ZZyJgxFAhjH7fUAj7DLudLVS0Y8iijWJqTy3zD2BU83zf2cjYN0pbB07hbeF7RWD1GDQYQN/DyJp8I6I4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306120; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=af12Emi/cCgStn/UwxBq6KWZOfBbIxl3KK7Jm000Jrw=; b=hdUBiDbLdIQhD9PPT7qfG84gRnUvQDJJLo3YCzo2fkBDWoE1jA4qRq9fnSqEZYRrKkmUBUGxCgazXdb23Ts408DRSA2fhdVXRsmv2RZkQHWtiBfmnvtWKOU4gQxMuhYVcWOwbLDxCUicsH9BhYAire1yWE/exjkIcynuMK+kHP4= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306120046461.31516786482916; Mon, 16 Feb 2026 21:28:40 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcq-0002c5-KX; Tue, 17 Feb 2026 00:27:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcm-0002ab-OS for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcj-0006cS-Mc for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id A73C488503; Tue, 17 Feb 2026 08:27:46 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-no4eOMdv; Tue, 17 Feb 2026 08:27:46 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306066; bh=af12Emi/cCgStn/UwxBq6KWZOfBbIxl3KK7Jm000Jrw=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=SURyeHnvSEZV/Cw7htk6hFT91JgzgDqGty7JuzLp0yo23bgQKQ/GC6TSqxHBQa7sW 8NErywTjVtw+lamF6sbcnVHOCy1Vv8n9GTxMBHV/4nglxA7OchVUa10oepWVyOicHC aXyL7zoWJJn3lV4PJBMIWW+EnK+tMf02IJNihl7k= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 4/8] hw/audio/pcspk: change PCSPK behaviour with --disable-audio Date: Tue, 17 Feb 2026 10:27:36 +0500 Message-Id: <20260217052740.114117-5-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306123894154100 Content-Type: text/plain; charset="utf-8" PCSPK (PC Speaker) is an embedded audio device. We don't want it to use aud= io when QEMU is configured with `--disable-audio`. This is achieved with minim= al, non-invasive changes to the code. In essence, the changes ensure that PCSPK does not use the corresponding audio backend, while functioning the same way in non-audio aspects. Signed-off-by: Sergei Heifetz --- hw/audio/pcspk.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hw/audio/pcspk.c b/hw/audio/pcspk.c index 916c56fa4c..03fe816024 100644 --- a/hw/audio/pcspk.c +++ b/hw/audio/pcspk.c @@ -36,10 +36,12 @@ #include "qom/object.h" #include "trace.h" =20 +#ifdef CONFIG_AUDIO #define PCSPK_BUF_LEN 1792 #define PCSPK_SAMPLE_RATE 32000 #define PCSPK_MAX_FREQ (PCSPK_SAMPLE_RATE >> 1) #define PCSPK_MIN_COUNT DIV_ROUND_UP(PIT_FREQ, PCSPK_MAX_FREQ) +#endif =20 OBJECT_DECLARE_SIMPLE_TYPE(PCSpkState, PC_SPEAKER) =20 @@ -48,18 +50,25 @@ struct PCSpkState { =20 MemoryRegion ioport; uint32_t iobase; +#ifdef CONFIG_AUDIO uint8_t sample_buf[PCSPK_BUF_LEN]; +#endif AudioBackend *audio_be; +#ifdef CONFIG_AUDIO SWVoiceOut *voice; +#endif PITCommonState *pit; +#ifdef CONFIG_AUDIO unsigned int pit_count; unsigned int samples; unsigned int play_pos; +#endif uint8_t data_on; uint8_t dummy_refresh_clock; bool migrate; }; =20 +#ifdef CONFIG_AUDIO static const char *s_spk =3D "pcspk"; =20 static inline void generate_samples(PCSpkState *s) @@ -131,6 +140,7 @@ static int pcspk_audio_init(PCSpkState *s) =20 return 0; } +#endif =20 static uint64_t pcspk_io_read(void *opaque, hwaddr addr, unsigned size) @@ -161,11 +171,13 @@ static void pcspk_io_write(void *opaque, hwaddr addr,= uint64_t val, =20 s->data_on =3D (val >> 1) & 1; pit_set_gate(s->pit, 2, gate); +#ifdef CONFIG_AUDIO if (s->voice) { if (gate) /* restart */ s->play_pos =3D 0; AUD_set_active_out(s->voice, gate & s->data_on); } +#endif } =20 static const MemoryRegionOps pcspk_io_ops =3D { @@ -196,10 +208,12 @@ static void pcspk_realizefn(DeviceState *dev, Error *= *errp) =20 isa_register_ioport(isadev, &s->ioport, s->iobase); =20 +#ifdef CONFIG_AUDIO if (s->audio_be && AUD_backend_check(&s->audio_be, errp)) { pcspk_audio_init(s); return; } +#endif } =20 static bool migrate_needed(void *opaque) --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306164; cv=none; d=zohomail.com; s=zohoarc; b=WbphukIoWQmJjMso0MN9WGoJ0aeVjMYR1qlNbi+rwlGtYac000kcSBoN6RcDc6HCdbFMMwB3DMwbvHHJytCAFd6y6FsoQsoC00Rt0cRWO+AN5i9PtZScKW0nk4FBS3aoXCQ+KiC9LQmDTS25OkXkI6d7aL0BGdhHupjPYDHWP2I= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306164; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=hpaly3QuMCqYCSPy1XIc8jC8cujtpc/PHUO3JbzcXqo=; b=QrvW6rjd3i77pcOdBW6387OFrWoZRdb0F1RLMUTHmPxrhHYKpDZ8mMSq2+Wcbi3EY5DltphUNf8iJ6TaM3WoKm4tBit2pBXSB5VMOX3aGizRt81QSkhnEBQKa3NlDDzlxbc07dwfBlvDjM2L4WMQJHOHQZYWKYAVVJZQTwC0aco= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306164678554.0237549908632; Mon, 16 Feb 2026 21:29:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcs-0002cc-68; Tue, 17 Feb 2026 00:27:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcm-0002ad-Pr for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcj-0006cW-17 for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id AD5D788516; Tue, 17 Feb 2026 08:27:47 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-a7MO7L5T; Tue, 17 Feb 2026 08:27:47 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306067; bh=hpaly3QuMCqYCSPy1XIc8jC8cujtpc/PHUO3JbzcXqo=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=fTjumWIlCOLbSUWS8ivAgqBn/UL45OoyWpVmiFBfwbUvjrKJ/t7mHeobo0uLA+qyz gHyc7K0yvi7dhVcRCBL1uzHhp2ufQ/L9ODdnT4wg81l0nhY16KqB5uvEXPWoJqYWJO 2VN8uflETZ3Cq7S9LuVLSA61DGj/Ftpk9aYlD+bA= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 5/8] Kconfig: add AUDIO dependency to audio-related devices Date: Tue, 17 Feb 2026 10:27:37 +0500 Message-Id: <20260217052740.114117-6-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306167316154100 Content-Type: text/plain; charset="utf-8" The idea of the `--disable-audio` option is to stop building audio-related source files. Although this is not yet implemented, we can already make the existing AUDIO Kconfig option a dependency for a number of devices so that the build does not break when we remove `audio/` and other sources. Note that some machines have embedded audio devices and therefore cannot be used with `--disable-audio` at all. `-audio none` should be used for such machines if audio needs to be muted. The only device that is purposefully not included in this patch is PCSPK (PC speaker), because its code has already been modified to work with `--disable-audio`. Signed-off-by: Sergei Heifetz Reviewed-by: Thomas Huth --- hw/audio/Kconfig | 21 ++++++++++++--------- hw/usb/Kconfig | 2 +- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/hw/audio/Kconfig b/hw/audio/Kconfig index daf060e1be..0479818e3f 100644 --- a/hw/audio/Kconfig +++ b/hw/audio/Kconfig @@ -1,37 +1,37 @@ config SB16 bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config ES1370 bool default y if PCI_DEVICES - depends on PCI + depends on PCI && AUDIO =20 config AC97 bool default y if PCI_DEVICES - depends on PCI + depends on PCI && AUDIO =20 config ADLIB bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config GUS bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config CS4231A bool default y - depends on ISA_BUS + depends on ISA_BUS && AUDIO =20 config HDA bool default y if PCI_DEVICES - depends on PCI + depends on PCI && AUDIO =20 config PCSPK bool @@ -40,18 +40,21 @@ config PCSPK =20 config WM8750 bool - depends on I2C + depends on I2C && AUDIO =20 config PL041 bool + depends on AUDIO =20 config CS4231 bool + depends on AUDIO =20 config ASC bool + depends on AUDIO =20 config VIRTIO_SND bool default y - depends on VIRTIO + depends on VIRTIO && AUDIO diff --git a/hw/usb/Kconfig b/hw/usb/Kconfig index de95686720..e370585892 100644 --- a/hw/usb/Kconfig +++ b/hw/usb/Kconfig @@ -98,7 +98,7 @@ config USB_STORAGE_UAS config USB_AUDIO bool default y - depends on USB + depends on USB && AUDIO =20 config USB_SERIAL bool --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306128; cv=none; d=zohomail.com; s=zohoarc; b=AQXp9946Iy2ofZMLqhcERDLWdei0WD75J9qT/sob7+aXwUTbjMkeMiNFZFSY3Q9K7lTRCZ6PHrBwor40suuE5gRLMuKXR+dUbQxQPjA3L1CqUZFABAVurEqJ9FyUBi7PHDKx9wzXaaxqsjaK8Zs8CPkMSFt0V13xyd4U8VSbzcM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306128; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=DtG4qrnXYpar9yRTqdDK14JALo4UMhi3utRTPaLQXtc=; b=Ql4mClOOVV3o99X+zXfP7hsIE9TI46zjQGw6EO+fkhBdXMc8g30u6jbh6USUchxHlUhdMf9gqS1hZ0BkopnrVC/OcLxhcDVWA+wkOXBjNNczU8gkkAUA2tMGkkXHKoHjzhNlEnps/l0BvEm78zjnm/BWefQWrfmxs7pFh6yVBxk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306128645812.3173140461649; Mon, 16 Feb 2026 21:28:48 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcq-0002c7-FC; Tue, 17 Feb 2026 00:27:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcm-0002aZ-Lm for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcj-0006ca-Se for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:52 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id A86EF88521; Tue, 17 Feb 2026 08:27:48 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-1IK7YrqY; Tue, 17 Feb 2026 08:27:48 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306068; bh=DtG4qrnXYpar9yRTqdDK14JALo4UMhi3utRTPaLQXtc=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=a6RDPZ48IqpcOqwbP1hIR3xhLaO0EL3nY67RGQ3rR0WbGeWJ3z+pp3biaPoNdEreZ jkNhZW3pE5jPArON1j7sIC2lTzXIePXzQUO2b9diiQ+5jZwE2+gM40Sdwr2s0Htx/m i3htSN56oAWZExaMLGtadQmuUgDiG+y4MT2OD598= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 6/8] system/vl: remove audio and audiodev options when audio is disabled Date: Tue, 17 Feb 2026 10:27:38 +0500 Message-Id: <20260217052740.114117-7-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306130705154100 Content-Type: text/plain; charset="utf-8" Remove the audio and audiodev runtime options when QEMU is configured with `--disable-audio`. Signed-off-by: Sergei Heifetz --- system/vl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/system/vl.c b/system/vl.c index aa9a155041..b4f0c3b2f3 100644 --- a/system/vl.c +++ b/system/vl.c @@ -2248,7 +2248,9 @@ static int global_init_func(void *opaque, QemuOpts *o= pts, Error **errp) static bool is_qemuopts_group(const char *group) { if (g_str_equal(group, "object") || +#ifdef CONFIG_AUDIO g_str_equal(group, "audiodev") || +#endif g_str_equal(group, "machine") || g_str_equal(group, "smp-opts") || g_str_equal(group, "boot-opts")) { @@ -2265,6 +2267,7 @@ static void qemu_record_config_group(const char *grou= p, QDict *dict, object_option_add_visitor(v); visit_free(v); =20 +#ifdef CONFIG_AUDIO } else if (g_str_equal(group, "audiodev")) { Audiodev *dev =3D NULL; Visitor *v =3D qobject_input_visitor_new_keyval(QOBJECT(dict)); @@ -2272,6 +2275,7 @@ static void qemu_record_config_group(const char *grou= p, QDict *dict, audio_add_audiodev(dev); } visit_free(v); +#endif =20 } else if (g_str_equal(group, "machine")) { /* @@ -3059,6 +3063,7 @@ void qemu_init(int argc, char **argv) } break; #endif +#ifdef CONFIG_AUDIO case QEMU_OPTION_audiodev: default_audio =3D 0; audio_parse_option(optarg); @@ -3099,6 +3104,7 @@ void qemu_init(int argc, char **argv) } break; } +#endif case QEMU_OPTION_h: help(0); break; --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306171; cv=none; d=zohomail.com; s=zohoarc; b=E5v1KbUVg3svM+uXc/9nbDa0LTHwrSOICI1o5g+2ccDojSBwxATNstilyQzM+TeUPVdlfRWUN81+LGZ4mG5mqFuiVh61j/s151Tt1t8Lur5rFUAqv4PdJDX691z8CjMG93BH45uiBgKrtNBPJl2irr5iGDrOGDUiWybBdlWWFOw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306171; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=KOIC+LeyRr+/hCkiVzFTFc9lUuFTGE4xjJnMyvrIrZo=; b=SjwmIFhflxDoSQgArEc04L2GKZGQqQIyjy51VkQPDNXTX0wxKGweNB0bWrsgHBA9oVV2S8pV35sYmBbb3O7q365Z+9Lz8PH6raqTttZU90wu9zi1Qg9DbEG5vVzyjSrFdqYePkmuUx+CCcKXmcdPWIeQACIrV+jKM3yyF8fIeJc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1771306170701384.74994722272527; Mon, 16 Feb 2026 21:29:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcs-0002ce-97; Tue, 17 Feb 2026 00:27:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcn-0002bH-UI for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:54 -0500 Received: from forwardcorp1b.mail.yandex.net ([178.154.239.136]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcl-0006cf-0K for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:53 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id C194B88512; Tue, 17 Feb 2026 08:27:49 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-vRBzQ9c3; Tue, 17 Feb 2026 08:27:49 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306069; bh=KOIC+LeyRr+/hCkiVzFTFc9lUuFTGE4xjJnMyvrIrZo=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=fihEtUMMqawgP7lWr3b396EpVGug+Amj1lArchR8/HsUdhChFTXEnt+qnpiOYMks8 +ht0xYUWppwA0Y5aKoUdXVKyri0gdtKfTKQkS/kKv0iZ7AN1O1W3HRHR4lVy6bE+rG uZQBbb3aMmkATLo4r6z5lpa3KXb8y3qZcY5t+ROY= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 7/8] audio: do not build audio-related sources with --disable-audio Date: Tue, 17 Feb 2026 10:27:39 +0500 Message-Id: <20260217052740.114117-8-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=178.154.239.136; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306184994158500 Content-Type: text/plain; charset="utf-8" When QEMU is configured with `--disable-audio`, do not build any audio-related sources. - audio/meson.build and replay/meson.build: Exclude audio-related sources when audio is disabled. - audio/audio-stub.c: Provide a minimal set of straightforward stubs. - replay/replay-audio-stub.c: Move the existing stubs from replay/stubs-system.c into a separate file. - qapi/audio.json: Remove the QMP `query-audiodevs` command. - audio/audio-hmp-cmds-stub.c: Provide meaningful messages for audio-related HMP commands: stopcapture, wavcapture, info capture. Signed-off-by: Sergei Heifetz --- audio/audio-hmp-cmds-stub.c | 28 ++++++++++++++++++++++++++++ audio/audio-stub.c | 35 +++++++++++++++++++++++++++++++++++ audio/meson.build | 5 +++++ qapi/audio.json | 3 ++- replay/meson.build | 9 ++++++++- replay/replay-audio-stub.c | 16 ++++++++++++++++ replay/stubs-system.c | 6 ------ 7 files changed, 94 insertions(+), 8 deletions(-) create mode 100644 audio/audio-hmp-cmds-stub.c create mode 100644 audio/audio-stub.c create mode 100644 replay/replay-audio-stub.c diff --git a/audio/audio-hmp-cmds-stub.c b/audio/audio-hmp-cmds-stub.c new file mode 100644 index 0000000000..2f94f1c8dd --- /dev/null +++ b/audio/audio-hmp-cmds-stub.c @@ -0,0 +1,28 @@ +/* + * Stub for audio-hmp-cmds.c + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "audio_int.h" +#include "monitor/hmp.h" +#include "monitor/monitor.h" +#include "qapi/error.h" +#include "qobject/qdict.h" +#include "qemu/error-report.h" + +void hmp_info_capture(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, "audio subsystem is disabled at compile time"); +} + +void hmp_stopcapture(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, "audio subsystem is disabled at compile time"); +} + +void hmp_wavcapture(Monitor *mon, const QDict *qdict) +{ + monitor_puts(mon, "audio subsystem is disabled at compile time"); +} diff --git a/audio/audio-stub.c b/audio/audio-stub.c new file mode 100644 index 0000000000..0c9e2446e0 --- /dev/null +++ b/audio/audio-stub.c @@ -0,0 +1,35 @@ +/* + * Stub for audio.c + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "qapi/qapi-commands-audio.h" +#include "qemu/audio.h" +#include "qapi/error.h" + +void audio_cleanup(void) {} + +AudioBackend *audio_be_by_name(const char *name, Error **errp) +{ + error_setg( + errp, + "trying to find audiodev '%s' by name with audio component disabled", + name); + return NULL; +} + +const char *audio_be_get_id(AudioBackend *be) { return ""; } + +bool audio_be_set_dbus_server(AudioBackend *be, + GDBusObjectManagerServer *server, bool p2p, + Error **errp) +{ + error_setg(errp, "trying to set dbus server with audio component disable= d"); + return false; +} + +void audio_init_audiodevs(void) {} + +void audio_create_default_audiodevs(void) {} diff --git a/audio/meson.build b/audio/meson.build index b2dca2c640..ea1f88fb6f 100644 --- a/audio/meson.build +++ b/audio/meson.build @@ -1,3 +1,8 @@ +if not audio_enabled + system_ss.add(files('audio-stub.c', 'audio-hmp-cmds-stub.c')) + subdir_done() +endif + system_ss.add(files( 'audio.c', 'mixeng.c', diff --git a/qapi/audio.json b/qapi/audio.json index 2df87b9710..28fda7c8ac 100644 --- a/qapi/audio.json +++ b/qapi/audio.json @@ -540,4 +540,5 @@ # Since: 8.0 ## { 'command': 'query-audiodevs', - 'returns': ['Audiodev'] } + 'returns': ['Audiodev'], + 'if': 'CONFIG_AUDIO' } diff --git a/replay/meson.build b/replay/meson.build index 4b4175e8dd..7f8b5dca61 100644 --- a/replay/meson.build +++ b/replay/meson.build @@ -7,7 +7,14 @@ system_ss.add(when: 'CONFIG_TCG', if_true: files( 'replay-char.c', 'replay-snapshot.c', 'replay-net.c', - 'replay-audio.c', 'replay-random.c', 'replay-debugging.c', ), if_false: files('stubs-system.c')) + +if audio_enabled + system_ss.add(when: 'CONFIG_TCG', + if_true: files('replay-audio.c'), + if_false: files('replay-audio-stub.c')) +else + system_ss.add(files('replay-audio-stub.c')) +endif diff --git a/replay/replay-audio-stub.c b/replay/replay-audio-stub.c new file mode 100644 index 0000000000..303e5075f4 --- /dev/null +++ b/replay/replay-audio-stub.c @@ -0,0 +1,16 @@ +/* + * Stub for replay-audio.c + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "qemu/osdep.h" +#include "system/replay.h" + +void replay_audio_in(size_t *recorded, st_sample *samples, + size_t *wpos, size_t size) +{ +} +void replay_audio_out(size_t *played) +{ +} diff --git a/replay/stubs-system.c b/replay/stubs-system.c index 7f85764936..454415ae8e 100644 --- a/replay/stubs-system.c +++ b/replay/stubs-system.c @@ -15,12 +15,6 @@ void replay_input_sync_event(void) void replay_add_blocker(const char *feature) { } -void replay_audio_in(size_t *recorded, st_sample *samples, size_t *wpos, s= ize_t size) -{ -} -void replay_audio_out(size_t *played) -{ -} void replay_breakpoint(void) { } --=20 2.34.1 From nobody Sun Apr 12 04:23:24 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=yandex-team.com ARC-Seal: i=1; a=rsa-sha256; t=1771306145; cv=none; d=zohomail.com; s=zohoarc; b=JoMy+QOhLUvaNTo0xZ/VcJBa4m57AHk0D1wdcLLJJSPDrg7Z4NWJ1BBsxvjgr36xZ8nT4NF/bL3XxjKjCzzUMYBffJijPUu06KAeNy5SXFGsIFOX1TlYm4naou+aZHevlVe0zL60Em0opy5F4GQIstfO0ZnBztIdU4VCZNshTr4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771306145; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=cW96GpRtxrwmpHjA3rFfk5LGg/7cNAQbpRSdRXk6Veo=; b=dbHAZcvOuFRGMI4Or2/O5BEB/e/g63Brdli7XeZ5NEaNaos7yxWKhh08S85eTpoqRzcOsn6ne8x+Z51ph5LFouq+fud28ywFt9zTFdG0BinXDn4j220/fyqBzKxKd5lj+OkL2FamXaiHZBw8oTQNuFWSe8dK/iKtdUqhxUWtkkA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 177130614508064.31946302559345; Mon, 16 Feb 2026 21:29:05 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vsDcs-0002ck-Mo; Tue, 17 Feb 2026 00:27:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDco-0002bI-0e for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:54 -0500 Received: from forwardcorp1b.mail.yandex.net ([2a02:6b8:c02:900:1:45:d181:df01]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vsDcm-0006cm-5y for qemu-devel@nongnu.org; Tue, 17 Feb 2026 00:27:53 -0500 Received: from mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net [IPv6:2a02:6b8:c37:8aa5:0:640:e6ae:0]) by forwardcorp1b.mail.yandex.net (Yandex) with ESMTPS id E90A78852A; Tue, 17 Feb 2026 08:27:50 +0300 (MSK) Received: from heifetz-lin.yandex-team.ru (unknown [2a02:6bf:8080:b54::1:2f]) by mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net (smtpcorp/Yandex) with ESMTPSA id eRRjrX2Ak0U0-BEQR34Gh; Tue, 17 Feb 2026 08:27:50 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex-team.com; s=default; t=1771306070; bh=cW96GpRtxrwmpHjA3rFfk5LGg/7cNAQbpRSdRXk6Veo=; h=Message-Id:Date:In-Reply-To:Cc:Subject:References:To:From; b=B6yNRU49+hngQyNX40/rrbl+kLZgpYohiOF6T4KqYn4Kr/dXS6Dt1d35WHr/Hqo+c VzuEGXtkuNzGCr0rBs//lq4FIblA/mCwQQowuFfnmYh8yOmfSocB30X5HnwaC/WSDk UxcVHRtLktGSjaMGckLcigkrHY25zTepq2aq+tww= Authentication-Results: mail-nwsmtp-smtp-corp-canary-81.sas.yp-c.yandex.net; dkim=pass header.i=@yandex-team.com From: Sergei Heifetz To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , =?UTF-8?q?Alex=20Benn=C3=A9e?= , Eric Blake , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Markus Armbruster , Fabiano Rosas , Paolo Bonzini , Thomas Huth , Gerd Hoffmann , Laurent Vivier Subject: [PATCH 8/8] meson.build: ignore audio drivers when configured with --disable-audio Date: Tue, 17 Feb 2026 10:27:40 +0500 Message-Id: <20260217052740.114117-9-heifetz@yandex-team.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20260217052740.114117-1-heifetz@yandex-team.com> References: <20260217052740.114117-1-heifetz@yandex-team.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a02:6b8:c02:900:1:45:d181:df01; envelope-from=heifetz@yandex-team.com; helo=forwardcorp1b.mail.yandex.net X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @yandex-team.com) X-ZM-MESSAGEID: 1771306148893158500 Content-Type: text/plain; charset="utf-8" When QEMU is configured with `--disable-audio`, we do not need to add the audio drivers list to config_host_data. We also do not need to print this list. Signed-off-by: Sergei Heifetz --- meson.build | 80 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 35 deletions(-) diff --git a/meson.build b/meson.build index 69aa7cd189..a1224c9695 100644 --- a/meson.build +++ b/meson.build @@ -2266,46 +2266,55 @@ endif config_host_data =3D configuration_data() =20 config_host_data.set('CONFIG_HAVE_RUST', have_rust) -audio_drivers_selected =3D [] -if have_system - audio_drivers_available =3D { - 'alsa': alsa.found(), - 'coreaudio': coreaudio.found(), - 'dsound': dsound.found(), - 'jack': jack.found(), - 'oss': oss.found(), - 'pa': pulse.found(), - 'pipewire': pipewire.found(), - 'sdl': sdl.found(), - 'sndio': sndio.found(), - } - foreach k, v: audio_drivers_available - config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v) - endforeach +config_host_data.set('CONFIG_AUDIO', audio_enabled) +if audio_enabled + audio_drivers_selected =3D [] + if have_system + audio_drivers_available =3D { + 'alsa': alsa.found(), + 'coreaudio': coreaudio.found(), + 'dsound': dsound.found(), + 'jack': jack.found(), + 'oss': oss.found(), + 'pa': pulse.found(), + 'pipewire': pipewire.found(), + 'sdl': sdl.found(), + 'sndio': sndio.found(), + } + foreach k, v: audio_drivers_available + config_host_data.set('CONFIG_AUDIO_' + k.to_upper(), v) + endforeach =20 - # Default to native drivers first, OSS second, SDL third - audio_drivers_priority =3D \ - [ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \ - (host_os =3D=3D 'linux' ? [] : [ 'sdl' ]) - audio_drivers_default =3D [] - foreach k: audio_drivers_priority - if audio_drivers_available[k] - audio_drivers_default +=3D k - endif - endforeach + # Default to native drivers first, OSS second, SDL third + audio_drivers_priority =3D \ + [ 'pa', 'coreaudio', 'dsound', 'sndio', 'oss' ] + \ + (host_os =3D=3D 'linux' ? [] : [ 'sdl' ]) + audio_drivers_default =3D [] + foreach k: audio_drivers_priority + if audio_drivers_available[k] + audio_drivers_default +=3D k + endif + endforeach =20 + foreach k: get_option('audio_drv_list') + if k =3D=3D 'default' + audio_drivers_selected +=3D audio_drivers_default + elif not audio_drivers_available[k] + error('Audio driver "@0@" not available.'.format(k)) + else + audio_drivers_selected +=3D k + endif + endforeach + endif + config_host_data.set('CONFIG_AUDIO_DRIVERS', + '"' + '", "'.join(audio_drivers_selected) + '", ') +else foreach k: get_option('audio_drv_list') - if k =3D=3D 'default' - audio_drivers_selected +=3D audio_drivers_default - elif not audio_drivers_available[k] - error('Audio driver "@0@" not available.'.format(k)) - else - audio_drivers_selected +=3D k + if k !=3D 'default' + error('Audio drivers are not supported because audio is disabled.') endif endforeach endif -config_host_data.set('CONFIG_AUDIO_DRIVERS', - '"' + '", "'.join(audio_drivers_selected) + '", ') =20 have_host_block_device =3D (host_os !=3D 'darwin' or cc.has_header('IOKit/storage/IOMedia.h')) @@ -4660,7 +4669,8 @@ if enable_modules summary_info +=3D {'alternative module path': get_option('module_upgrade= s')} endif summary_info +=3D {'fuzzing support': get_option('fuzzing')} -if have_system +summary_info +=3D {'Audio': get_option('audio')} +if have_system and audio_enabled summary_info +=3D {'Audio drivers': ' '.join(audio_drivers_selected)} endif summary_info +=3D {'Trace backends': ','.join(get_option('trace_backend= s'))} --=20 2.34.1