Skip to content

Introduce audio-volume feature#405

Open
alimirjamali wants to merge 1 commit intoQubesOS:mainfrom
alimirjamali:issue-2724-domu-speaker-volume
Open

Introduce audio-volume feature#405
alimirjamali wants to merge 1 commit intoQubesOS:mainfrom
alimirjamali:issue-2724-domu-speaker-volume

Conversation

@alimirjamali
Copy link
Copy Markdown
Contributor

Allowing user to set the default audio volume per qube via audio-volume feature. By default it is 100% (except some select qubes which will be always muted).

resolves: QubesOS/qubes-issues#2724

@codecov
Copy link
Copy Markdown

codecov Bot commented Dec 18, 2025

Codecov Report

❌ Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.07%. Comparing base (a5ea121) to head (1149895).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
qubesadmin/tools/qvm_start_daemon.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #405      +/-   ##
==========================================
- Coverage   76.10%   76.07%   -0.04%     
==========================================
  Files          53       53              
  Lines        9287     9291       +4     
==========================================
  Hits         7068     7068              
- Misses       2219     2223       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marmarek
Copy link
Copy Markdown
Member

pulseaudio / pipewire (or rather wireplumber) has similar feature already - it already remembers volume of each stream. You can adjust it in pavucontrol and it should be preserved across qube restart. Overriding it via qubes-specific feature isn't great, will lead to problems and unexpected situations (like needing to re-adjust volume at each qube start again, GUI tools for volume control no longer effective etc).

There is probably a way to set it also for future streams. Quick search suggests it's stored in ~/.local/state/wireplumber/stream-properties, but editing it directly sounds like a very bad idea. Maybe wpctl or pactl can do that, or some other related tool.

@alimirjamali alimirjamali force-pushed the issue-2724-domu-speaker-volume branch from db194f3 to be18d7f Compare December 18, 2025 20:11
@alimirjamali
Copy link
Copy Markdown
Contributor Author

alimirjamali commented Dec 18, 2025

pulseaudio / pipewire (or rather wireplumber) has similar feature already - it already remembers volume of each stream. You can adjust it in pavucontrol and it should be preserved across qube restart. Overriding it via qubes-specific feature isn't great, will lead to problems and unexpected situations (like needing to re-adjust volume at each qube start again, GUI tools for volume control no longer effective etc).

There is probably a way to set it also for future streams. Quick search suggests it's stored in ~/.local/state/wireplumber/stream-properties, but editing it directly sounds like a very bad idea. Maybe wpctl or pactl can do that, or some other related tool.

How should it be dealt with DispVMs based on whonix-workstation-xx-dvm? Shouldn't they be muted by default?

For those we do not want to set and we want pulse to remember the previous setting, I could easily adjust pacat-simple-vchan to pass NULL (like before) to pa_stream_connect_playback if audio-volume feature is not set. So the previous volume is preserved.

@marmarek
Copy link
Copy Markdown
Member

Should it be maybe called audio-initial-volume? It's just about the state at the qube startup after all.

And also, can you add some integration tests for this? See qubes/tests/integ/audio.py in core-admin. It's probably enough to check if audio stream is in desired state initially (especially for numerical value). But if want to check if really nothing got played, there are similar tests for microphone already (search for audio_rec_muted).

@alimirjamali alimirjamali force-pushed the issue-2724-domu-speaker-volume branch from 44eec34 to 1149895 Compare December 21, 2025 14:06
@alimirjamali
Copy link
Copy Markdown
Contributor Author

Should it be maybe called audio-initial-volume? It's just about the state at the qube startup after all.

This is done. Salt formula PR is also amended accordingly

And also, can you add some integration tests for this? See qubes/tests/integ/audio.py in core-admin. It's probably enough to check if audio stream is in desired state initially (especially for numerical value). But if want to check if really nothing got played, there are similar tests for microphone already (search for audio_rec_muted).

I submitted a patch to add the integration unittests. It currently only checks the audio volume and muting status:

https://github.com/QubesOS/qubes-core-admin/pull/768/files

@qubesos-bot
Copy link
Copy Markdown

qubesos-bot commented Dec 26, 2025

OpenQA test summary

Complete test suite and dependencies: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026031319-4.3-debian&flavor=pull-requests

Test run included the following:

New failures, excluding unstable

Compared to: https://openqa.qubes-os.org/tests/overview?distri=qubesos&version=4.3&build=2026020304-devel&flavor=update

Failed tests

No failures!

Fixed failures

Compared to: https://openqa.qubes-os.org/tests/166096#dependencies
Nothing fixed

Unstable tests

Details

Performance Tests

Performance degradation:

No issues

Remaining performance tests:

13 tests
  • debian-13-xfce_dom0-dispvm-api (mean:6.539): 78.47 🟢 ( previous job: 79.83, improvement: 98.29%)
  • debian-13-xfce_dom0-dispvm-gui-api (mean:7.827): 93.92 🔻 ( previous job: 92.49, degradation: 101.55%)
  • debian-13-xfce_dom0-dispvm-preload-2-api (mean:3.149): 37.79 🟢 ( previous job: 44.94, improvement: 84.08%)
  • debian-13-xfce_dom0-dispvm-preload-2-delay-0-api (mean:2.917): 35.00 🟢 ( previous job: 41.46, improvement: 84.42%)
  • debian-13-xfce_dom0-dispvm-preload-2-delay-minus-1d2-api (mean:3.307): 39.69 🟢 ( previous job: 47.01, improvement: 84.43%)
  • debian-13-xfce_dom0-dispvm-preload-4-api (mean:2.284): 27.41 🟢 ( previous job: 37.67, improvement: 72.75%)
  • debian-13-xfce_dom0-dispvm-preload-4-delay-0-api (mean:2.809): 33.71 🟢 ( previous job: 36.76, improvement: 91.71%)
  • debian-13-xfce_dom0-dispvm-preload-4-delay-minus-1d2-api (mean:2.441): 29.29 🟢 ( previous job: 37.87, improvement: 77.36%)
  • debian-13-xfce_dom0-dispvm-preload-2-gui-api (mean:4.989): 59.87 🔻 ( previous job: 55.58, degradation: 107.71%)
  • debian-13-xfce_dom0-dispvm-preload-4-gui-api (mean:4.135): 49.62 🔻 ( previous job: 47.73, degradation: 103.97%)
  • debian-13-xfce_dom0-dispvm-preload-6-gui-api (mean:4.198): 50.38 🔻 ( previous job: 47.11, degradation: 106.93%)
  • debian-13-xfce_dom0-vm-api (mean:0.038): 0.45 🔻 ( previous job: 0.41, degradation: 109.93%)
  • debian-13-xfce_dom0-vm-gui-api (mean:0.039): 0.47 🟢 ( previous job: 0.48, improvement: 96.67%)

Allowing user to set the default audio volume per qube via
`audio-volume` feature. By default it is 100% (except some select qubes
which will be always muted).

resolves: QubesOS/qubes-issues#2724
@alimirjamali alimirjamali force-pushed the issue-2724-domu-speaker-volume branch from 1149895 to 791d573 Compare December 27, 2025 08:24
@alimirjamali
Copy link
Copy Markdown
Contributor Author

PipelineRetryFailed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Disable speaker output for domUs by default

3 participants