How to change default volume in pasystray

Hi! I’ve sys-audio qube created following the audio qube guide by neowutran. I’m happy with it but there are a couple of things I’d like to change. One of them is that every time sys-audio starts, in the pasystray the default sink entry shows

default_sink

But with this value, even if speakers volume is set to 100% the volume is very low. So I have to manually adjust the values every time I start sys-audio.

How can I set a new default value for the default sink? I thought it would be super easy but after reading a lot I still don’t know how to do it. In sys-audio I’ve tried:

  $ amixer set Master 80%
  $ sudo alsactl store 0

the new configuration is stored in /var/lib/alsa/asound.state. I’ve copied this file to the audio-template so it is available to sys-audio every time it starts. And it is, but the default sink volume keeps being 40%.

How can I achieve my goal? TIA!

I use volumeicon, so this may not work for you. But I just open the dvm sys-audio is based on and set the audio volume. Since it persists, sys-audio will be reset to that volume on each boot.

This can be a feature: I have mine set to mute, so I never have to worry if an unwelcome sound will play before I allow it, and I don’t have to remember what I had it set to last time.

I think the sink volume is stored in ~/.local/state/wireplumber/restore-stream.
You can change the channelVolumes for your sink there.

I’ve made the change suggested by @apparatus and my ~/.local/state/wireplumber/restore-stream is now:

[restore-stream]
Audio/Sink:media.name:Qubes\sSink:channelMap=FL;FR;
Audio/Sink:media.name:Qubes\sSink:channelVolumes=1.0;1.0;
Audio/Sink:media.name:Qubes\sSink:mute=false
Audio/Sink:media.name:Qubes\sSink:volume=1.0
Audio/Sink:node.name:auto_null:channelMap=FL;FR;
Audio/Sink:node.name:auto_null:channelVolumes=1.0;1.0;
Audio/Sink:node.name:auto_null:mute=false
Audio/Sink:node.name:auto_null:volume=1.0
Audio/Source:media.name:Qubes\sSource:channelMap=FL;FR;
Audio/Source:media.name:Qubes\sSource:channelVolumes=1.0;1.0;
Audio/Source:media.name:Qubes\sSource:mute=false
Audio/Source:media.name:Qubes\sSource:volume=1.0
Input/Audio:application.id:org.PulseAudio.pavucontrol:channelMap=MONO;
Input/Audio:application.id:org.PulseAudio.pavucontrol:channelVolumes=1.0;
Input/Audio:application.id:org.PulseAudio.pavucontrol:mute=false

so my sink volume should be 100%. But again it is 40%. I’ve tried:

$ wpctl set-volume 48 80%

and it changes the sink volume but the change doesn’t persist between sessions.

I’ve searched the config files in /usr/share/wireplumber but I’m not able to see where the sink volume is set. Also I’m reading wireplumber docs but cannot find the solution to this problem so I still need help with it.

Check the file, maybe your changes were overwritten since the service was running?
This works for me:
Stop pipewire service:

systemctl --user stop pipewire.socket

Change the sink channelVolumes in ~/.local/state/wireplumber/restore-stream.
Start pipewire service:

systemctl --user start pipewire.socket

Nope, changing the file is not working here. I’ve even reinstalled the whole sys-audio thing just to be sure I’ve a clean starting point, but it didn’t help.

What template did you use?

I’m using debian12 template.

Which one specifically?
debian-12
debian-12-xfce
debian-12-minimal

Sorry, debian-12.

I guess it’s some issue with GNOME template, it works fine for me in debian-12-xfce and debian-12-minimal templates.

OK. I’ll try them and let you know how it works. Thanks.

I’ve deleted my previous sys-audio and created a new one based on debian-12-minimal. Same problem. The file restore-stream is silently ignored, even if I stop/start the pipewire service. The current file contents are:

[restore-stream]
Audio/Sink:node.name:auto_null:channelMap=FL;FR;
Audio/Sink:node.name:auto_null:channelVolumes=0.80000001192093;0.80000001192093;
Audio/Sink:node.name:auto_null:mute=false
Audio/Sink:node.name:auto_null:volume=1.0
Input/Audio:application.id:org.PulseAudio.pavucontrol:channelMap=MONO;
Input/Audio:application.id:org.PulseAudio.pavucontrol:channelVolumes=1.0;
Input/Audio:application.id:org.PulseAudio.pavucontrol:mute=false
Input/Audio:application.id:org.PulseAudio.pavucontrol:volume=1.0

but in the pasystray the sink volume is still 40%.

I’ve created a fresh sys-audio based on debian-12-minimal and have this content in ~/.local/state/wireplumber/restore-stream in sys-audio:

[restore-stream]
Audio/Sink:media.name:Qubes\sSink:channelMap=FL;FR;
Audio/Sink:media.name:Qubes\sSink:channelVolumes=1.0;1.0;
Audio/Sink:media.name:Qubes\sSink:mute=false
Audio/Sink:media.name:Qubes\sSink:volume=1.0
Audio/Sink:node.name:auto_null:channelMap=FL;FR;
Audio/Sink:node.name:auto_null:channelVolumes=1.0;1.0;
Audio/Sink:node.name:auto_null:mute=false
Audio/Sink:node.name:auto_null:volume=1.0
Audio/Source:media.name:Qubes\sSource:channelMap=FL;FR;
Audio/Source:media.name:Qubes\sSource:channelVolumes=1.0;1.0;
Audio/Source:media.name:Qubes\sSource:mute=false
Audio/Source:media.name:Qubes\sSource:volume=1.0
Input/Audio:application.id:org.PulseAudio.pavucontrol:channelMap=MONO;
Input/Audio:application.id:org.PulseAudio.pavucontrol:channelVolumes=1.0;
Input/Audio:application.id:org.PulseAudio.pavucontrol:mute=false
Input/Audio:application.id:org.PulseAudio.pavucontrol:volume=1.0

If I change the values for a dummy Qubes sink in this line:

Audio/Sink:media.name:Qubes\sSink:channelVolumes=1.0;1.0;

Then I can see that volume is changed in pasystray and in pavucontrol.

Well, this is weird. Now there is a new file named default-routes in ~/.local/state/wireplumber. I don’t know how it was created. Its contents are:

[default-routes]
alsa_card.pci-0000_00_06.0:output:analog-output-speaker:channelMap=FL;FR;
alsa_card.pci-0000_00_06.0:output:analog-output-speaker:channelVolumes=0.79999077320099;0.79999077320099;
alsa_card.pci-0000_00_06.0:output:analog-output-speaker:latencyOffsetNsec=0
alsa_card.pci-0000_00_06.0:profile:output:analog-stereo+input:analog-stereo=analog-output-speaker;

Changing the values in the output-speaker:channelVolumes line and restarting pipewire.socket changes volume in pasystray.

I’d really like to understand what’s happening here but I’m very confused :confused: