|
@@ -20,6 +20,7 @@ from observe_pipewire import (
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
CAPTURE_0 = "alsa_input.hw_U192k_0:capture_AUX0"
|
|
CAPTURE_0 = "alsa_input.hw_U192k_0:capture_AUX0"
|
|
|
|
|
+CAPTURE_1 = "alsa_input.hw_U192k_0:capture_AUX1"
|
|
|
CAPTURE_2 = "alsa_input.hw_U192k_0:capture_AUX2"
|
|
CAPTURE_2 = "alsa_input.hw_U192k_0:capture_AUX2"
|
|
|
CAPTURE_3 = "alsa_input.hw_U192k_0:capture_AUX3"
|
|
CAPTURE_3 = "alsa_input.hw_U192k_0:capture_AUX3"
|
|
|
AMP_INPUT = "effect_0:input"
|
|
AMP_INPUT = "effect_0:input"
|
|
@@ -28,6 +29,18 @@ CAB_INPUT = "effect_1:in"
|
|
|
CAB_OUTPUT = "effect_1:out"
|
|
CAB_OUTPUT = "effect_1:out"
|
|
|
MIX_INPUT_0 = "rigforge.direct-mix.input:playback_AUX0"
|
|
MIX_INPUT_0 = "rigforge.direct-mix.input:playback_AUX0"
|
|
|
MIX_INPUT_2 = "rigforge.direct-mix.input:playback_AUX2"
|
|
MIX_INPUT_2 = "rigforge.direct-mix.input:playback_AUX2"
|
|
|
|
|
+MIX_INPUT_4 = "rigforge.direct-mix.input:playback_AUX4"
|
|
|
|
|
+MIX_INPUT_5 = "rigforge.direct-mix.input:playback_AUX5"
|
|
|
|
|
+MIX_INPUT_6 = "rigforge.direct-mix.input:playback_AUX6"
|
|
|
|
|
+MIX_INPUT_7 = "rigforge.direct-mix.input:playback_AUX7"
|
|
|
|
|
+LOOPER_INPUT_1 = "sooperlooper:loop0_in_1"
|
|
|
|
|
+LOOPER_INPUT_2 = "sooperlooper:loop0_in_2"
|
|
|
|
|
+LOOPER_INPUT_3 = "sooperlooper:loop0_in_3"
|
|
|
|
|
+LOOPER_INPUT_4 = "sooperlooper:loop0_in_4"
|
|
|
|
|
+LOOPER_OUTPUT_1 = "sooperlooper:loop0_out_1"
|
|
|
|
|
+LOOPER_OUTPUT_2 = "sooperlooper:loop0_out_2"
|
|
|
|
|
+LOOPER_OUTPUT_3 = "sooperlooper:loop0_out_3"
|
|
|
|
|
+LOOPER_OUTPUT_4 = "sooperlooper:loop0_out_4"
|
|
|
MIX_OUTPUT = "rigforge.direct-mix.output:capture_FL"
|
|
MIX_OUTPUT = "rigforge.direct-mix.output:capture_FL"
|
|
|
PLAYBACK_0 = "alsa_output.hw_U192k_0:playback_AUX0"
|
|
PLAYBACK_0 = "alsa_output.hw_U192k_0:playback_AUX0"
|
|
|
|
|
|
|
@@ -35,7 +48,20 @@ PLAYBACK_0 = "alsa_output.hw_U192k_0:playback_AUX0"
|
|
|
class PipeWireObserverTests(unittest.TestCase):
|
|
class PipeWireObserverTests(unittest.TestCase):
|
|
|
@classmethod
|
|
@classmethod
|
|
|
def setUpClass(cls):
|
|
def setUpClass(cls):
|
|
|
- cls.state = load_state(ROOT / "config" / "desired-state.yaml")
|
|
|
|
|
|
|
+ cls.desired_state = load_state(ROOT / "config" / "desired-state.yaml")
|
|
|
|
|
+ cls.state = copy.deepcopy(cls.desired_state)
|
|
|
|
|
+ existing_test_edges = {
|
|
|
|
|
+ (CAPTURE_0, AMP_INPUT),
|
|
|
|
|
+ (AMP_OUTPUT, CAB_INPUT),
|
|
|
|
|
+ (CAB_OUTPUT, MIX_INPUT_0),
|
|
|
|
|
+ (CAPTURE_2, MIX_INPUT_2),
|
|
|
|
|
+ (MIX_OUTPUT, PLAYBACK_0),
|
|
|
|
|
+ }
|
|
|
|
|
+ cls.state["routing"]["managed_links"] = [
|
|
|
|
|
+ link
|
|
|
|
|
+ for link in cls.state["routing"]["managed_links"]
|
|
|
|
|
+ if (link["from"], link["to"]) in existing_test_edges
|
|
|
|
|
+ ]
|
|
|
|
|
|
|
|
def test_empty_managed_set_ignores_wireplumber_hardware_links(self):
|
|
def test_empty_managed_set_ignores_wireplumber_hardware_links(self):
|
|
|
state = copy.deepcopy(self.state)
|
|
state = copy.deepcopy(self.state)
|
|
@@ -116,6 +142,28 @@ class PipeWireObserverTests(unittest.TestCase):
|
|
|
self.assertEqual(validate_managed_links(self.state), [])
|
|
self.assertEqual(validate_managed_links(self.state), [])
|
|
|
self.assertEqual(observe(self.state, links), [])
|
|
self.assertEqual(observe(self.state, links), [])
|
|
|
|
|
|
|
|
|
|
+ def test_desired_graph_keeps_direct_guitar_and_routes_looper_channels_through_mix(self):
|
|
|
|
|
+ links = {
|
|
|
|
|
+ (link["from"], link["to"])
|
|
|
|
|
+ for link in self.desired_state["routing"]["managed_links"]
|
|
|
|
|
+ }
|
|
|
|
|
+ self.assertIn((CAB_OUTPUT, MIX_INPUT_0), links)
|
|
|
|
|
+ self.assertIn((CAB_OUTPUT, LOOPER_INPUT_1), links)
|
|
|
|
|
+ self.assertIn((CAPTURE_1, LOOPER_INPUT_2), links)
|
|
|
|
|
+ self.assertIn((CAPTURE_2, LOOPER_INPUT_3), links)
|
|
|
|
|
+ self.assertIn((CAPTURE_3, LOOPER_INPUT_4), links)
|
|
|
|
|
+ self.assertTrue(
|
|
|
|
|
+ {
|
|
|
|
|
+ (LOOPER_OUTPUT_1, MIX_INPUT_4),
|
|
|
|
|
+ (LOOPER_OUTPUT_2, MIX_INPUT_5),
|
|
|
|
|
+ (LOOPER_OUTPUT_3, MIX_INPUT_6),
|
|
|
|
|
+ (LOOPER_OUTPUT_4, MIX_INPUT_7),
|
|
|
|
|
+ }
|
|
|
|
|
+ <= links
|
|
|
|
|
+ )
|
|
|
|
|
+ self.assertEqual(validate_managed_links(self.desired_state), [])
|
|
|
|
|
+ self.assertEqual(observe(self.desired_state, links), [])
|
|
|
|
|
+
|
|
|
def test_reports_missing_voice_mix_link_without_expectation_of_dry_guitar(self):
|
|
def test_reports_missing_voice_mix_link_without_expectation_of_dry_guitar(self):
|
|
|
links = {
|
|
links = {
|
|
|
(CAPTURE_0, AMP_INPUT),
|
|
(CAPTURE_0, AMP_INPUT),
|