From 48a4ffc63f306a8167eb5b9bac177e2bd7a61064 Mon Sep 17 00:00:00 2001 From: selikhov Date: Sat, 3 Oct 2026 02:35:43 +0300 Subject: [PATCH] voelin-media: keep the PipeWire test off the machine's real speakers The application-capture test runs a private PipeWire and WirePlumber, but WirePlumber's default profile still monitors the sound cards, Bluetooth and cameras. On a desktop with a sound card its 0.3-amplitude test tones could therefore be routed to the real speakers or headphones. Disable the hardware monitors (the 0.5 profile and the 0.4 Lua fragments) and give the null sink the highest priority, so the private graph holds nothing but the test sink. Co-Authored-By: Claude Opus 5.5 --- crates/voelin-media/tests/pipewire_apps.rs | 29 +++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/crates/voelin-media/tests/pipewire_apps.rs b/crates/voelin-media/tests/pipewire_apps.rs index da12d5a..94e0f37 100644 --- a/crates/voelin-media/tests/pipewire_apps.rs +++ b/crates/voelin-media/tests/pipewire_apps.rs @@ -200,7 +200,34 @@ impl Daemons { std::fs::write( conf.join("voelin-test-sink.conf"), "context.objects = [ { factory = adapter args = { factory.name = support.null-audio-sink \ - node.name = voelin-test-sink media.class = Audio/Sink audio.position = [ FL FR ] } } ]\n", + node.name = voelin-test-sink media.class = Audio/Sink audio.position = [ FL FR ] \ + priority.session = 3000 priority.driver = 3000 } } ]\n", + ) + .unwrap(); + // No hardware: WirePlumber's default profile monitors the sound + // cards, Bluetooth and cameras, and the tones would play on the + // machine's real speakers. 0.5 reads the profile, 0.4 the Lua + // fragments; each ignores the other's files. + let wireplumber_conf = dir.join("config/wireplumber"); + for sub in ["wireplumber.conf.d", "main.lua.d", "bluetooth.lua.d"] { + std::fs::create_dir_all(wireplumber_conf.join(sub)).unwrap(); + } + std::fs::write( + wireplumber_conf.join("wireplumber.conf.d/voelin-test.conf"), + "wireplumber.profiles = { main = { hardware.audio = disabled \ + hardware.bluetooth = disabled hardware.video-capture = disabled } }\n", + ) + .unwrap(); + std::fs::write( + wireplumber_conf.join("main.lua.d/51-voelin-test.lua"), + "if alsa_monitor then alsa_monitor.enabled = false end\n\ + if v4l2_monitor then v4l2_monitor.enabled = false end\n\ + if libcamera_monitor then libcamera_monitor.enabled = false end\n", + ) + .unwrap(); + std::fs::write( + wireplumber_conf.join("bluetooth.lua.d/51-voelin-test.lua"), + "if bluez_monitor then bluez_monitor.enabled = false end\n", ) .unwrap(); let mut command = Command::new(pipewire);