-
Notifications
You must be signed in to change notification settings - Fork 74
Audio server utils module (New) #2131
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
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #2131 +/- ##
==========================================
+ Coverage 53.81% 54.35% +0.54%
==========================================
Files 406 408 +2
Lines 43288 43847 +559
Branches 7997 8075 +78
==========================================
+ Hits 23296 23834 +538
- Misses 19179 19195 +16
- Partials 813 818 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9f11017 to
93e736d
Compare
c428002 to
533afc7
Compare
Hook25
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ok, consider adding a bit more end 2 end tests.
checkbox-support/checkbox_support/helpers/tests/test_audio_server_utils.py
Show resolved
Hide resolved
checkbox-support/checkbox_support/helpers/audio_server_utils.py
Outdated
Show resolved
Hide resolved
checkbox-support/checkbox_support/helpers/tests/test_audio_server_utils.py
Show resolved
Hide resolved
Introduces a unified interface for working with PulseAudio and PipeWire audio servers without requiring deep knowledge of either system. Features: - AudioServerUtils factory that auto-detects the running audio server - PipewireUtils: Full support for PipeWire's device/profile/node hierarchy - PulseaudioUtils: Support for PulseAudio sink/source management - Node abstraction representing audio sinks and sources - Methods to list, iterate, set default, and control volume of audio nodes - CLI interface for listing and interactively selecting audio nodes The iterator pattern (iter_sinks/iter_sources) automatically activates profiles before yielding nodes, making them immediately usable.
Comprehensive test coverage for the audio_server_utils module: - NodeTests: Basic Node class instantiation - AudioServerUtilsTests: Factory pattern and server detection - PipewireUtilsTests: PipeWire-specific functionality including pw-dump parsing, device/profile/node handling, and volume control - PulseaudioUtilsTests: PulseAudio-specific functionality including pactl parsing, sink/source management, and volume control Signed-off-by: Paolo Gentili <paolo.gentili@canonical.com>
Signed-off-by: Paolo Gentili <paolo.gentili@canonical.com>
Signed-off-by: Paolo Gentili <paolo.gentili@canonical.com>
Signed-off-by: Paolo Gentili <paolo.gentili@canonical.com>
533afc7 to
920fc1a
Compare
Description
This PR introduces a new utility module in checkbox support to scan and control sources and sinks using both Pipewire and Pulseaudio in a transparent way.
The
mainfunctions explains a bit how to use it, but in general:It's non trivial to control nodes outside of the iteration, especially with Pipewire: Nodes are ephemeral, and there's no identifier that is guaranteed to survive after changing device profile.
Resolved issues
N/A
Documentation
N/A
Tests
Run it as a script, and check if the sink on your machine changes.
NB: there are sinks that are available but not actually usable: your settings panel might not update the displayed value in this case.