How do I set default volume level?

On my TW/KDE system a while ago I noticed my volume level would be altered on boot up and dropped to about 75%, I do not want this I have quite low powered speakers in my monitor and need the default set to 120%. I have as yet not found a way to set this as default on boot up. How do I accomplish this?

Stuart

First thing of course to find out if it is on boot or on login that it is reset. You say “on boot”, but have you really tested that it stays as you want after a logout - login sequence?

Well good point… I just logged out and back in again and the volume stayed where I put it at 120%, so it would seem it is boot up that does it.

Stuart

That would then point to the system level.

Did you check what is configured in YaST > Hardware > Sound? There is an menu Other bottom right and that has a menu item Volume. I assume that that is the default starting value for any user that logs in.

That screen show nothing but Master Volume Test button and the panel under that says Other Channels but show nothing else.

Stuart

I have 15.2 here and I assumed that it should not be very different with Tumbleweed, but who knows. Here it shows a Master volume ruler (which is at 51). And indeed a Test button. and then a ruler PCM (whatever that may be) which is at 100. Then a divider and below that Other Devices. rulers for several devices. So basically it looks the same, but you do not have a settable ruler for Master-Volume at the top?

Well I just fired up my laptop which has TW/KDE on it and I can see all that stuff you mention on that one but nothing on my desktop on that panel. Now my laptop is an Intel cpu and my desktop is an AMD and it shows two sound cards the one which is configured is a Family 17h Audio Controller and the one which is not configure shows a Raven HDMI Audio Controller.


2a:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Raven/Raven2/Fenghuang HDMI/DP Audio Controller 
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 9b86 
        Flags: bus master, fast devsel, latency 0, IRQ 101, IOMMU group 10 
        Memory at fce88000 (32-bit, non-prefetchable) [size=16] 
        Capabilities: [48] Vendor Specific Information: Len=08 <?> 
        Capabilities: [50] Power Management version 3 
        Capabilities: [64] Express Legacy Endpoint, MSI 00 
        Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ 
        Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> 
        Kernel driver in use: snd_hda_intel 
        Kernel modules: snd_hda_intel 

2a:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h (Models 10h-1fh) HD Audio Controller 
        Subsystem: Micro-Star International Co., Ltd. [MSI] Device 9b86 
        Flags: bus master, fast devsel, latency 0, IRQ 102, IOMMU group 10 
        Memory at fce80000 (32-bit, non-prefetchable) [size=32] 
        Capabilities: [48] Vendor Specific Information: Len=08 <?> 
        Capabilities: [50] Power Management version 3 
        Capabilities: [64] Express Endpoint, MSI 00 
        Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+ 
        Capabilities: [100] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?> 
        Kernel driver in use: snd_hda_intel 
        Kernel modules: snd_hda_intel

It is the second one which got configured.

Stuart
[/size][/size]

In KDE Plasma, click on the Loudspeaker icon in the System Tray –

  • You should see options to set the standard device – click on the standard device option for the device you want to use as the standard one – it’s a button which may be well not nicely highlighted if it’s active – at most a rectangular border …
  • If you click again, you’ll deactivate the selection (no default standard audio device :open_mouth: ) – the rectangular border will disappear – click again to activate the selection …

I am unable to find any such button, there are several wrench icons but none of them seem to show such an action. It must be using the correct device as I have sound OK it just messes with the volume level when I boot up.

Stuart

Thanks for this. I didn’t have any sound problem but checked this out and found my sound card wasn’t configured! I selected quick-automatic and a bunch of settings became available.

Well I’ve finally found a solution. I have a script running at KDE autostart which uses the amixer to set the master volume to 100% which does more or less what I want, 100% is OK. So I think this was something to do with KDE/Alsa but dont know exactly why. Anyway this gets round the issue sort of! I think I only need the Master to be set but doing the others does no harm.

Stuart

#!/bin/bash
#Sound2 100 Percent
#Set Master volume to 100%
amixer set 'Master',0  100% unmute
#
#Set Front to zero
amixer set 'Front',0  100%
#
#Set Surround to zero
amixer set 'Surround',0  100%
#
#Set Center to zero
amixer set 'Center',0  100%

Thank you for your advice. I totally forgot about this setting in YaST.
I also had the problem with setting of volume level. In my case, it was constantly changing to the same high level even when I plugged and unplugged the headphones.
Now it seems to be working as should be.

Checked with a default English language test user – standard Breeze desktop, icons, etc, etc –

  • There’s some text to the left of the Hamburger “settings” icon at the right hand side of the drop-down window – “✭ Default device” – this a button – click it.
  • If you’re using Oxygen or whatever else then, the “settings” icon is no longer a Hamburger – it’s a wrench.

Well my fix only lasted a few days. Now on boot up despite my having the script as an auto start in KDE settings my sound volume is back at 74%, running the script manually gets it back to 100% So something is wrong again, either the script is not running or something else resets the sound volume afterwards but I have no idea what that might be. Really frustrating.

Anyone any ideas please?

Stuart

Does your KDE desktop session start from new (start with empty session), or from settings saved in previous session? Are you able to set the desired levels with pavucontrol? Does that survive a reboot?

You could try removing

rm -f ~/.config/pulse/*

then restart the desktop. Any different?

It might also be interesting to examine…

grep -i volume ~/.local/state/pipewire/media-session.d/*
[FONT=monospace]sudo journalctl -b |grep pipewire[/FONT]

[FONT=monospace]

[/FONT]

I’ll see what happens after removing the pulse directory in .local. As for the second command it shows nothing and looking at the directory it shows it has just bluez-autoswitch in it. The journal only shows stuff relevant to bluetooth nothing else. Bluetooth is installed and I do have an adapter but it is disabled right now.

I’ll update again when I’ve tried the first thing.

Stuart

A logout/login and the volume level stays where it was set via PulseAudio Volume Control, however a reboot sets it back to 74%!

Stuart

There are udev rules that restore sound state on boot (/usr/lib/udev/rules.d/90-alsa-restore.rules) and service alsa-restore.service that saves/restores state and is called from another udev rule (sound.target Wants alsa-restore.service):

bor@tw:~> grep -rF sound.target /usr/lib/udev/rules.d/
/usr/lib/udev/rules.d/99-systemd.rules:SUBSYSTEM=="sound", KERNEL=="controlC*", TAG+="systemd", ENV{SYSTEMD_WANTS}+="sound.target", ENV{SYSTEMD_USER_WANTS}+="sound.target"
bor@tw:~> 

Try disabling them and see if it makes any difference. What “sytsemctl status alsa-restore.service” says?

That command says


systemctl status alsa-restore.service  
**●** alsa-restore.service - Save/Restore Sound Card State 
     Loaded: loaded (/usr/lib/systemd/system/alsa-restore.service; static) 
     Active: **active (exited)** since Sun 2021-12-05 13:09:50 GMT; 2h 16min ago 
    Process: 1073 ExecStart=/usr/sbin/alsactl restore (code=exited, status=0/SUCCESS) 
   Main PID: 1073 (code=exited, status=0/SUCCESS) 
        CPU: 3ms 

Dec 05 13:09:50 Tumbleweed systemd[1]: Starting Save/Restore Sound Card State... 
Dec 05 13:09:50 Tumbleweed alsactl[1073]: alsa-lib parser.c:242:(error_node) UCM is not supported for this HDA model (HD-Audio Generic at 0xfce88000 irq 101) 
Dec 05 13:09:50 Tumbleweed alsactl[1073]: alsa-lib main.c:1405:(snd_use_case_mgr_open) error: failed to import hw:0 use case configuration -6 
Dec 05 13:09:50 Tumbleweed alsactl[1073]: alsa-lib parser.c:242:(error_node) UCM is not supported for this HDA model (HD-Audio Generic at 0xfce80000 irq 102) 
Dec 05 13:09:50 Tumbleweed alsactl[1073]: alsa-lib main.c:1405:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -6 
Dec 05 13:09:50 Tumbleweed systemd[1]: Finished Save/Restore Sound Card State.

not tried anything else yet.

Stuart

From what I’ve read the UCM error is informative only…

However, some users have been impacted by recent pipewire behaviour as described here (and many other places)…