From 899943bfcf9677dc18351484a937a54757176d6f Mon Sep 17 00:00:00 2001 From: Pauli Virtanen Date: Sun, 26 Jan 2025 21:18:18 +0200 Subject: [PATCH] monitors: disable stream-restore for device loopback nodes stream-restore should not be touching node properties of the Bluetooth mic / device set / offload / ALSA UCM split loopback nodes. Those are controlled by Route settings on the device. Set device.routes and state.restore-props=false as appropriate to avoid that. --- src/scripts/monitors/alsa.lua | 1 + src/scripts/monitors/bluez.lua | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua index bfb2d8a7..69dc03bb 100644 --- a/src/scripts/monitors/alsa.lua +++ b/src/scripts/monitors/alsa.lua @@ -109,6 +109,7 @@ function createSplitPCMLoopback(parent, id, obj_type, factory, properties) ["node.passive"] = true, ["node.dont-fallback"] = true, ["node.linger"] = true, + ["state.restore-props"] = false, ["target.object"] = properties["api.alsa.split.name"], } diff --git a/src/scripts/monitors/bluez.lua b/src/scripts/monitors/bluez.lua index 33b1354a..52b404fb 100644 --- a/src/scripts/monitors/bluez.lua +++ b/src/scripts/monitors/bluez.lua @@ -94,6 +94,7 @@ function createOffloadScoNode(parent, id, type, factory, properties) args["playback.props"] = Json.Object { ["node.passive"] = true, ["node.pause-on-idle"] = false, + ["state.restore-props"] = false, } elseif factory:find("source") then local playback_args = { @@ -110,6 +111,7 @@ function createOffloadScoNode(parent, id, type, factory, properties) args["capture.props"] = Json.Object { ["node.passive"] = true, ["node.pause-on-idle"] = false, + ["state.restore-props"] = false, } args["playback.props"] = Json.Object(playback_args) else @@ -204,6 +206,7 @@ function createSetNode(parent, id, type, factory, properties) ["create-stream"] = Json.Object { ["media.class"] = stream_class, ["audio.position"] = Json.Array (member["channels"]), + ["state.restore-props"] = false, } }, } @@ -427,7 +430,8 @@ function CreateDeviceLoopbackSource (dev_name, dec_desc, dev_id) ["stream.dont-remix"] = true, ["node.passive"] = true, ["node.dont-fallback"] = true, - ["node.linger"] = true + ["node.linger"] = true, + ["state.restore-props"] = false, }, ["playback.props"] = Json.Object { ["node.name"] = string.format ("bluez_input.%s", dev_name), @@ -436,6 +440,7 @@ function CreateDeviceLoopbackSource (dev_name, dec_desc, dev_id) ["media.class"] = "Audio/Source", ["device.id"] = dev_id, ["card.profile.device"] = DEVICE_SOURCE_ID, + ["device.routes"] = "1", ["priority.driver"] = 2010, ["priority.session"] = 2010, ["bluez5.loopback"] = true,