fix(audio): apply host_env outermost to the pw-record spawn
CI / security (pull_request) Successful in 1m11s
CI / lint (pull_request) Successful in 22s
CI / ai-review (pull_request) Successful in 8s

host_env() now wraps the whole child environment, and the
stream.capture.sink property is merged inside it, which is the form the
host_process convention expects. The two capture tests patch os.environ
instead of host_env.

Fixes #41
This commit is contained in:
2026-11-07 00:02:41 +05:30
parent 71b97fe633
commit 5201383638
2 changed files with 3 additions and 6 deletions
+1 -1
View File
@@ -401,7 +401,7 @@ class PipeWireCaptureSource:
],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL,
env=_capture_sink_env(host_env()),
env=host_env(_capture_sink_env(os.environ)),
)
def reopen(
+2 -5
View File
@@ -355,7 +355,7 @@ class TestPipeWireCaptureSource(unittest.TestCase):
calls: List[Tuple[List[str], Dict[str, Any]]] = []
with (
patch("vocalinux.audio.pipewire.resolve_pipewire_source", return_value=_source()),
patch("vocalinux.audio.pipewire.host_env", return_value={"PATH": "/usr/bin"}),
patch.dict("os.environ", {"PATH": "/usr/bin"}, clear=True),
):
capture = PipeWireCaptureSource(
device_index=PIPEWIRE_INDEX_BASE,
@@ -374,10 +374,7 @@ class TestPipeWireCaptureSource(unittest.TestCase):
user_props = "{ node.latency = 1024/48000 }"
with (
patch("vocalinux.audio.pipewire.resolve_pipewire_source", return_value=_source()),
patch(
"vocalinux.audio.pipewire.host_env",
return_value={"PIPEWIRE_PROPS": user_props},
),
patch.dict("os.environ", {"PIPEWIRE_PROPS": user_props}, clear=True),
):
capture = PipeWireCaptureSource(
device_index=PIPEWIRE_INDEX_BASE,