How do I set the output volume of a device to 0 on startup?
As title states, I just need to find the best way to set the volume to 0 when the device boots up, before the gamescope startup movie plays.
15 Replies
I love this idea, playing with it rn
I would absolutely adore if someone could find a way, because trying to make heads or tails of the pipewire/wireplumber documentation is messing me up bad
I tried systemd user service (which worked when I ran it myself but did not run on it's own at boot), I tried putting it in a pipewire config, I tried setting props on the device...none of it stopped pipewire from just grabbing whatever the previous volume was and restoring it
you have to wait for gamescope to set the default, then mute it right after I think
ok heres what I've got, gonna see about making a ujust toggle to automate but help me validate, only tried on my ally x
put this in the .sh
make exec
chmod +x ~/.local/bin/mute-audio.sh
make a service
mkdir -p ~/.config/systemd/user
nano ~/.config/systemd/user/mute-audio.service
with:
enable and reload that hoe
systemctl --user daemon-reexec
systemctl --user daemon-reload
systemctl --user enable mute-audio.service
then you can systemctl reboot and check the tmp log at cat /tmp/mute.log
to see whats up
should see something like
Trying this now on my Ally (non-x), just need to fire up sshd and copy it in
this is all pretty close to what I tried with the service before, but I just had a one-liner for
amixer sset Master 0%
(and a couple other one-liners I tried)
you could be right that we need to wait. Someone else suggested I try a sleep on the service to delay it but I was out of juice by then and just didn't have any more in me
I assume /home/bazzite
is just meant to be my home directory for whatever account?oh shoot yeah should fix that
have a more robust implement drafted here https://github.com/ublue-os/bazzite/pull/2725/files
but lmk how this manual one works for you
works when I start it, rebooting now to test running at boot
It did mute the output, but did not change the volume. checking mute.log now
pactl set-sink-volume "$DEFAULT" 0%
does work when I run it myself though, in both desktop and gamescope
isn't that the desired behavior? muted but volume state preserved?
for me at least, the desire is that the volume be at 0, I'm not necessarily concerned with it being muted
when I run mute-audio.sh myself, it sets the volume to 0 (from the line
pactl set-sink-volume "$DEFAULT" 0%
) and mutes, which would still be totally acceptable for my usecase
but when I reboot and let the service do it, it behaves differently, preserving the volume level but still mutingweird, can you reboot and get me that log just for the boot action not you doing it manual?
that is the log for the boot action
What is it you're trying to achieve?
That the boot video doesn't play audio?
Because that can solved by just replacing the boot video with one that doesn't contain an audio track
which can easily be made into an ujust with a very simple script
I would be very much happy with a simple ujust for doing that, but we gotta make sure it doesn't interfere with the current method of replacing the boot video
I personally do want a mute or set to 0 on boot and/or wake from suspend toggle though, like muOS on anbernic devices for example. Would be nice for cases where I had it cranked but now I wake from suspend at night in bed and it’s still cranked
Fair warning when I was playing around with variants of the boot script and service above I somehow got Steam and gamescope permanently muted and did a reinstall to fix lmao. Will try again later
The issue right now is that I have to use the same audio output (with the same shared volume level) for handheld speakers, headphones, and docked to a TV.
For the TV, I have the volume all the way up so that the TV can be the volume control. But, if I forget to turn down the volume on the handheld when I’m done, I get blasted with sound when turning it back on
I’m just trying to remove the forgetfulness/human element of it by making my output device at 0% on bootup