Commit 157e0693 by PLN (Algolia)

autoroute: a Master on a Bluetooth sink is not dangling

Linking it to the default speaker as well would leak the whole set into the room
when monitoring on a headset.
parent e3196836
......@@ -152,3 +152,16 @@ def test_a_link_to_the_wrong_track_does_not_count(tmp_path):
wrong = "SuperCollider:out_1\n |-> ardour:Tidal 02/audio_in 1\n"
calls, _ = _reconcile(tmp_path, CTRL_LINKED + MASTER_ON_SPEAKER + wrong)
assert "SuperCollider:out_1 ardour:Tidal 01/audio_in 1" in calls
BT_SINK = "bluez_output.70_26_05_D0_D5_90.1"
MASTER_ON_BOSE = (f"ardour:Master/audio_out 1\n |-> {BT_SINK}:playback_FL\n"
f"ardour:Master/audio_out 2\n |-> {BT_SINK}:playback_FR\n")
def test_master_on_a_bluetooth_headset_is_not_dangling(tmp_path):
"""Monitoring on the Bose while the default sink is the laptop speaker: linking
Master to the speaker as well would leak the whole set into the room."""
calls, out = _reconcile(tmp_path, CTRL_LINKED + MASTER_ON_BOSE)
assert not [c for c in calls if c.startswith("ardour:Master")]
assert out == ""
......@@ -98,10 +98,13 @@ ctrl_source() { # stdin: the `pw-link -lo` snapshot
awk '/^Midi-Bridge:Midi Through:/ && !/playback/ { print; exit }'
}
# How many alsa_output sinks Ardour Master reaches.
# How many sound devices Ardour Master reaches. A Bluetooth headset counts: if the
# set is monitored on the Bose, a Master linked only to bluez_output.* HAS an
# output, and "fixing" it by also linking the laptop speaker would leak the whole
# set into the room.
master_hw_links() { # stdin: the `pw-link -lo` snapshot
awk '/^[^ \t]/ { src = $0; next }
index(src, "ardour:Master/audio_out") == 1 && /alsa_output\./ { n++ }
index(src, "ardour:Master/audio_out") == 1 && /(alsa|bluez)_output\./ { n++ }
END { print n + 0 }'
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment