-
-
Notifications
You must be signed in to change notification settings - Fork 54
pulse: connect recording stream only when recording is allowed #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
OpenQA test summaryComplete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025062603-4.3&flavor=pull-requests Test run included the following:
New failures, excluding unstableCompared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2025061004-4.3&flavor=update
Failed tests13 failures
Fixed failuresCompared to: https://openqa.qubes-os.org/tests/142375#dependencies 10 fixed
Unstable testsPerformance TestsPerformance degradation:6 performance degradations
Remaining performance tests:66 tests
|
This makes streams list in pulseaudio/pipewire less cluttered (no streams that wouldn't really record), but also fixes recording indicator in xfce (which looks at connected streams, regardless of their corked state). Move stream creation to a separate function (connect_disconnect_rec_stream) and call it instead of just uncorking the stream. And also, still call it on pulseaudio connection, if recording was allowed initially. Since the stream connection is asynchronous, the "allow recording" logic is split into two parts, and both are put into connect_disconnect_rec_stream - selected by the state_callback parameter. This mechanism is a bit fragile, as there are quite a few states. Introduce rec_stream_connect_in_progress variable that is set when stream connect/disconnect is in progress. In that case, do not schedule another connect/disconnect, but at stream state change callback will check if the requested state didn't change in the meantime. This also means that if rec_stream_connect_in_progress is set, the rec_allowed value is unreliable (it may be a stream that is created but not connected yet for example) - so, if rec_stream_connect_in_progress is set, do not send any data. Since recording stream isn't initially connected now, decouple adding recording vchan callback from it - since that vchan is also used for commands. And adjust that callback to not assume the stream is always connected (do not use pa_stream_is_corked, don't assert for stream before checking if recording is allowed etc). This change allows commands to be handled before playback stream is connected, so add a variable to keep "corked" state to be set/restored on stream connection (connecting the stream resets its corked state). This should also fix preserving corked state in case of pulseaudio daemon crash/restart. And also drop pa_stream_cork in vchan error hander - the process quits few lines below anyway. Fixes QubesOS/qubes-issues#9999
f596c69 to
9cb7792
Compare
This makes streams list in pulseaudio/pipewire less cluttered (no
streams that wouldn't really record), but also fixes recording
indicator in xfce (which looks at connected streams, regardless of their
corked state).
More details in the commit message.
This requires a bit more testing, and also updating automated tests (they do assume currently the recording stream is always there).
And also some extra review would be nice.
Fixes QubesOS/qubes-issues#9999