From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id BDA1827730; Mon, 28 Jul 2025 23:13:46 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 90F272772B; Mon, 28 Jul 2025 23:13:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_PASS,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=4.0.1 Received: from mail-qk1-x730.google.com (mail-qk1-x730.google.com [IPv6:2607:f8b0:4864:20::730]) by atuin.qyliss.net (Postfix) with ESMTPS id 5D3D127727 for ; Mon, 28 Jul 2025 23:13:43 +0000 (UTC) Received: by mail-qk1-x730.google.com with SMTP id af79cd13be357-7e6399d0654so234281585a.0 for ; Mon, 28 Jul 2025 16:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1753744422; x=1754349222; darn=spectrum-os.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xYiSi6ggwpnG92mNNFn+vEN54en432xE6mylScGp2Gk=; b=DhVlILw7WZV3WedR+XqIjyj2/S6aRfseZ0WRNvcyoL3T0BytYDGbAb8lju5W0ju9KK RidkwvuITXy8NtB0DhO/R4WbwJLB6+uX/RhuULg1t+R/yIHiwP9KSPGe5mQtp0W2VoTl 6vtPn9ss/pBxJJrMgH/adObAwcQiLiHSMzhxhiyEWeHZr2lANPEq6aM0Vw7EF0C2l9jq kSwSoL5zBXIRIN7g3Q+XQXLfBkWsFtzSAQ5jgcjgcIqiPU6M+BO8SyWL7l8QnvbOVSY6 jQtnZdaenDkd1beDzLI37SLwbzUtwZXom3DRzFOYRgwWQZw5it7ZDVA4pq0zZ5OBJTpO 4lvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753744422; x=1754349222; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xYiSi6ggwpnG92mNNFn+vEN54en432xE6mylScGp2Gk=; b=d8CxbQLqVwlXS3nMPTiQWNLRrwGkU+fuZ83cJ4ioryB/V2D+FvdBKQsLJg29NmFFph vthyR15MLOLjFPbe2PruvnjmOnnmKIwsbwMx79S9y7EvMlQJbmvC/Bkp7UTxRnHuxmU6 AVTuIJmB5XOPQYtjXupqCovCqZk6I/gYbhLfKpqiYbWQfKNY4/MqIwf8VlEv45f3w6NO RAknFNgUB8cDG7X3FImNpnimDr7EU51/4xSp3jTLr0OQHEg7S5quDYk4NeRr8vg93RHB PzwP7PPljCOMkFd7EJ2qSLycmF2lC7U2XcVdRNukLPO+Hwny3GqrbadJA9x3E6WTAYvm Wuww== X-Gm-Message-State: AOJu0Yz+ZBNxfSCfHrA3cRWaNzeFdj9xMblHBQXbDjSu488gZhOJNjo6 PEbV8jTsdyfweyg2nDma+BUVmPMTotp5Wd45PaUsATjAIe5YDewktExnR67YOw== X-Gm-Gg: ASbGncuvCeYJumC9dn3++ORXSi7KXMuR+hRfFuRANUPPd69NeMr6p71G6PcOf+eGF1x 3Y/A+s20GaBrrsgxejkQkptKItqcKfZ7k2+onbHgeKxesrO5cblYhiLj3blGIll+j/Y0DIN/NK0 Abr+HXhNSoFiGrcOqTwv5ncul5nPIjTh05Zw0iF/LNk4FJOeMRQhUrlxlVExX1toEouhc8B22/M opbZK+bZibXl1/l6gVkqs74sMmy37GFuLep6fKh6ILTkonXdXkwDwx7iidwgGaGZorE18AxJZnR azetGWbmnCZ5AEyNm586nSpbIjQFGQJvvgjjsgRK9HgBj6GwOEWXiJA+FtXYYgNA/yBZkDwwBU/ ELVHTgHmgtiEze/tx37hrFMR/iU0= X-Google-Smtp-Source: AGHT+IHDKIC/IoDtA6ClzKoLDVulAUok6avVBOz6BI3FD+fZka3pLq+rGZamBaas9LnPfm/3iiVTHg== X-Received: by 2002:a05:620a:a51b:b0:7e3:46da:9e12 with SMTP id af79cd13be357-7e63c1bb2e0mr1721877685a.57.1753744421827; Mon, 28 Jul 2025 16:13:41 -0700 (PDT) Received: from very-personal ([89.187.178.201]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7e6431ddec9sm349337485a.0.2025.07.28.16.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Jul 2025 16:13:41 -0700 (PDT) From: Demi Marie Obenour To: Spectrum OS Development Subject: [PATCH v8 0/2] Sound support in Spectrum VMs Date: Mon, 28 Jul 2025 19:13:00 -0400 Message-ID: <20250728231303.2416-1-demiobenour@gmail.com> X-Mailer: git-send-email 2.50.1 In-Reply-To: <263f81f2-9e86-4bb1-be80-41f7731a9a63@gmail.com> References: <263f81f2-9e86-4bb1-be80-41f7731a9a63@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: DT6HUOKEOSUDZJ4YQ2F4Z4P3U44U42LC X-Message-ID-Hash: DT6HUOKEOSUDZJ4YQ2F4Z4P3U44U42LC X-MailFrom: demiobenour@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Demi Marie Obenour , Alyssa Ross X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Patch 1 creates directories that PipeWire, WirePlumber, and applications need early in boot to avoid ordering problems. Patch 2 adds working (and tested) support for audio in the VM via PipeWire. This only works when running in a VM, as Spectrum OS has no sound on the host yet. --- Changes since v7: - Give the capture node a higher priority.session than the playback node, so WirePlumber links recording applications to the capture node instead of the monitor of the playback node. - Give the capture node a higher priority.driver than the playback node, so PipeWire has the capture node drive the graph. This is better because capture xruns lead to permanently corrupted data, whereas playback xruns do not. - Re-enable monitor node creation in WirePlumber. Changes since v6: - Add missing S-o-b to directory creation patch. - Add comments explaining why each directory needs to be created. - Fix spelling errors in commit messages. - Sort lines in Makefile. - Don't disable support.settings as a comment in wireplumber.conf says to not do that. Instead, tell WirePlumber to not create monitor nodes. This is a workaround for WirePlumber bug 829. - Don't remove "-cpu host" from make run-qemu's QEMU command line. This was needed for local testing with KVM disabled but should not have been submitted upstream. Hardware with KVM support should be used instead. Changes since v5: - Move changes to startup scripts into a single patch. - Remove "directories" service in favor of creating the directories from rc.init. - Use VM_DIRS to create /run/user and /run/wait. - Create /run/user and /run/wait on the host as well, using the same mechanism as for the VM (though with a different variable name in the makefile). - Use a drop-in configuration file for WirePlumber instead of overriding wireplumber.conf. This should be more robust to future WirePlumber changes. Demi Marie Obenour (2): img/app: Create needed directories in early boot img/app: Run PipeWire and WirePlumber in the VMs img/app/Makefile | 16 +- img/app/default.nix | 3 + img/app/etc/mdev.conf | 1 + img/app/etc/pipewire/pipewire.conf | 218 ++++++++++++++++++ img/app/etc/s6-linux-init/scripts/rc.init | 13 ++ .../etc/s6-rc/app/dependencies.d/wireplumber | 0 .../etc/s6-rc/pipewire/dependencies.d/dbus | 0 img/app/etc/s6-rc/pipewire/notification-fd | 1 + .../s6-rc/pipewire/notification-fd.license | 2 + img/app/etc/s6-rc/pipewire/run | 23 ++ img/app/etc/s6-rc/pipewire/type | 1 + img/app/etc/s6-rc/pipewire/type.license | 2 + img/app/etc/s6-rc/wayland-proxy-virtwl/run | 10 - .../etc/s6-rc/wireplumber/dependencies.d/dbus | 0 .../s6-rc/wireplumber/dependencies.d/pipewire | 0 img/app/etc/s6-rc/wireplumber/run | 4 + img/app/etc/s6-rc/wireplumber/type | 1 + img/app/etc/s6-rc/wireplumber/type.license | 2 + .../wireplumber.conf.d/99_spectrum.conf | 42 ++++ 19 files changed, 327 insertions(+), 12 deletions(-) create mode 100644 img/app/etc/pipewire/pipewire.conf create mode 100644 img/app/etc/s6-rc/app/dependencies.d/wireplumber create mode 100644 img/app/etc/s6-rc/pipewire/dependencies.d/dbus create mode 100644 img/app/etc/s6-rc/pipewire/notification-fd create mode 100644 img/app/etc/s6-rc/pipewire/notification-fd.license create mode 100644 img/app/etc/s6-rc/pipewire/run create mode 100644 img/app/etc/s6-rc/pipewire/type create mode 100644 img/app/etc/s6-rc/pipewire/type.license create mode 100644 img/app/etc/s6-rc/wireplumber/dependencies.d/dbus create mode 100644 img/app/etc/s6-rc/wireplumber/dependencies.d/pipewire create mode 100644 img/app/etc/s6-rc/wireplumber/run create mode 100644 img/app/etc/s6-rc/wireplumber/type create mode 100644 img/app/etc/s6-rc/wireplumber/type.license create mode 100644 img/app/etc/wireplumber/wireplumber.conf.d/99_spectrum.conf base-commit: 560fd878ba1bbd8df0fe28488e72948f28940948 -- Sincerely, Demi Marie Obenour (she/her/hers)