Audio settings reset on logout

Every time I log in to my PC, my sound volume is too low and the correct input device is no longer selected.
I am able to select the correct input device (which is actually a pipewire/wireplumber module) from the volume control in the KDE panel. As for the volume, the volume slider in the panel shows Digital Output (S/PDIF) and it’s set to 100% even though it’s quiet. To increase the volume, I have to run alsamixer , which displays “Pipewire” as the card by default, then I press F6 and select PRO (Chip: USB Mixer, Item: PCM) and turn the gain up. Once I do that, I can control the volume from the panel just fine and 100% volume is at a good spot.
So I have to select input and change that gain setting every time I log in. How can I get it to remember these settings?

  • I’ve tried alsactl store, as well as making sure that alsa-state.service is running. I also tried switching to alsa-restore.service, making sure to delete /etc/alsa/state-daemon.conf.
  • I removed ~/.config/pulse
  • I selected the default input device in pavucontrol
  • Removed alsa-utils hoping I could remove a layer from this confusing setup and just deal with Pipewire, but the settings still reverted so I put it back how it was.

Can you change the default with wpctl? wpctl status should show what the default is currently set to.

wpctl status
...
Audio
 ├─ Devices:
 │      62. TU104 HD Audio Controller           [alsa]
 │      64. PRO                                 [alsa]
 │      76. LifeCam HD-3000                     [alsa]
 │  
 ├─ Sinks:
 │  *   74. PRO Digital Stereo (IEC958)         [vol: 1.00]
 │  
 ├─ Sources:
 │      63. PRO Mono                            [vol: 1.00]
 │  
 ├─ Filters:
 │    - filter-chain-24236-29                                       
 │      41. input.filter-chain-24236-29                                  [Stream/Input/Audio]
 │  *   42. output.filter-chain-24236-29                                 [Audio/Source]
 │  
 └─ Streams:

Video
 ├─ Devices:
 │      54. Microsoft® LifeCam HD-3000         [v4l2]
 │      66. Microsoft LifeCam HD-3000: Mi       [libcamera]
 │      75. Microsoft® LifeCam HD-3000         [v4l2]
 │  
 ├─ Sinks:
 │  
 ├─ Sources:
 │  *   60. Microsoft® LifeCam HD-3000 (V4L2) 
 │  
 ├─ Filters:
 │  
 └─ Streams:
        89. plasmashell                                                 
             88. input_1         < kwin_wayland:output_1        [init]
        90. kwin_wayland                                                
             79. output_1        > plasmashell:input_1  [init]

Settings
 └─ Default Configured Devices:
         0. Audio/Sink    alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo
         1. Audio/Source  output.filter-chain-24236-29

And here’s the output of pactl info . Not sure why i have all of these or which ones are necessary lol…

pactl info
Server String: /run/user/1000/pulse/native
Library Protocol Version: 35
Server Protocol Version: 35
Is Local: yes
Client Index: 383
Tile Size: 65472
User Name: ...
Host Name: ...
Server Name: PulseAudio (on PipeWire 1.2.7)
Server Version: 15.0.0
Default Sample Specification: float32le 2ch 48000Hz
Default Channel Map: front-left,front-right
Default Sink: alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo
Default Source: output.filter-chain-24236-29
Cookie: d33b:d005

I noticed the output volume gain resets as soon as I log in. If I leave alsamixer open, then click “switch user” and then log right back in to the same user, I see the bar at 100% for a fraction of a second before it lowers itself to 35%.

The input setting doesn’t reset with “switch user”, it only resets once I fully log out.

For the default volume, it looks like you can set that with wpctl:

$ wpctl settings device.routes.default-sink-volume
Value: 0.064
$ wpctl settings device.routes.default-sink-volume 1.0
Updated setting 'device.routes.default-sink-volume' to: 1.0
$ wpctl settings device.routes.default-sink-volume
Value: 1.0

There are a bunch of settings that appear to be about restoring defaults. I never need to mess with any of them personally.

$ wpctl settings | grep '^-'
- Name: bluetooth.use-persistent-storage
- Name: bluetooth.autoswitch-to-headset-profile
- Name: device.restore-profile
- Name: device.restore-routes
- Name: device.routes.default-sink-volume
- Name: device.routes.default-source-volume
- Name: linking.role-based.duck-level
- Name: linking.allow-moving-streams
- Name: linking.follow-default-target
- Name: monitor.camera-discovery-timeout
- Name: node.features.audio.no-dsp
- Name: node.features.audio.monitor-ports
- Name: node.features.audio.control-port
- Name: node.stream.restore-props
- Name: node.stream.restore-target
- Name: node.stream.default-playback-volume
- Name: node.stream.default-capture-volume
- Name: node.stream.default-media-role
- Name: node.filter.forward-format
- Name: node.restore-default-targets

Otherwise, maybe you can disable the audio device you don’t want it to detect somehow (e.g. via BIOS settings or via driver parameters).

I’d also remove wireplumber conf:

rm -Rf ~/'.local/state/wireplumber'

GDM with GNOME/Workstation does its own conf in ~gdm/.local/state/wireplumber but I’m not sure if SDDM/KDE does something similar. I don’t believe the different confs would cause issue, but when wiping wireplumber I also cover GDM’s:

sudo rm -Rf ~gdm/'.local/state/wireplumber' ~/'.local/state/wireplumber'

I also recall some oddity on Plasma 6 when selecting a Pro audio profile. I’m not sure if Pro offers anything worthwhile outside of Professional audio needing the hard-separation of devices, so it’s possible using Pro is causing incompatible config somewhere by exposing the extra stuff.


If the audio device is external USB or a PCI-E card, it might be loading late in the boot process and KDE does its conf sooner than the audio device arrives. I haven’t run into this, but early-loading the audio device driver with dracut/initramfs might help.

2 Likes

Admittedly I’m not 100% sure what fixed this because I also uninstalled a bunch of packages and re-installed anything alsa / pulseaudio related, but I’m happy to call this the solution because I did this too and now it’s working lol.

Thanks everyone for the suggestions.

2 Likes

I spoke too soon :frowning:
So after uninstalling any alsa/pulse/wireplumber/pipewire things I could without messing up my system too bad (didn’t go through with pipewire uninstall bc it wanted to uninstall gnome), then installing again to get sound working, the settings seemed to be remembered for a reboot or two while also the volume control in the Plasma panel was broken. Now the panel volume control fixed itself and the volume gets reset once again.
Honestly I might just re-install Fedora at this point as I think I’ve got some jank from installing Workspace edition and then switching to KDE afterwards.

If the problem is in your user profile, reinstalling the whole OS might not be necessary. Have you tried creating another local user account to see if that works around the problem?

1 Like

I created a test profile and it seems to save the output volume, but does not keep deepfilter (virtual device) as the input

Some possibly useful info:

journalctl -u
Jan 12 16:08:17 Marvin kded6[6014]: org.kde.pulseaudio: No object for name "alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo"
Jan 12 16:08:17 Marvin plasmashell[6030]: file:///usr/share/plasma/plasmoids/org.kde.plasma.volume/contents/ui/main.qml:91: TypeError: Cannot read property 'description' of undefined
Jan 12 16:08:17 Marvin plasmashell[6030]: file:///usr/share/plasma/plasmoids/org.kde.plasma.volume/contents/ui/main.qml:91: TypeError: Cannot read property 'description' of undefined
Jan 12 16:08:17 Marvin kded6[6014]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Jan 12 16:08:17 Marvin plasmashell[6030]: org.kde.pulseaudio: No object for name "alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo"
Jan 12 16:08:17 Marvin plasmashell[6030]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Jan 12 16:08:17 Marvin kded6[6014]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"
Jan 12 16:08:17 Marvin plasmashell[6030]: org.kde.pulseaudio: No object for name "@DEFAULT_SINK@"

george@Marvin:~$ pactl get-default-source
output.filter-chain-5811-29
george@Marvin:~$ pactl get-default-sink
alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo
george@Marvin:~$ pactl list | grep node.name
                node.name = "alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo"
                node.name = "alsa_output.pci-0000_01_00.1.hdmi-stereo"
                node.name = "output.filter-chain-5811-29"
                node.name = "alsa_output.usb-Logitech_PRO_000000000000-00.iec958-stereo"
                node.name = "alsa_input.usb-Logitech_PRO_000000000000-00.mono-fallback"
                node.name = "alsa_output.pci-0000_01_00.1.hdmi-stereo"
                node.name = "speech-dispatcher-dummy"
                node.name = "input.filter-chain-5811-29"

pactl subscribe during switch user which results in lower volume:

george@Marvin:~$ pactl subscribe
Event 'remove' on card #784
Event 'remove' on source #790
Event 'remove' on sink #789
Event 'remove' on source #789
Event 'change' on server #4294967295
Event 'remove' on card #783
Event 'remove' on sink #788
Event 'remove' on source #788
Event 'change' on source-output #38
Event 'change' on sink-input #118
Event 'new' on sink #804
Event 'new' on source #804
Event 'change' on server #4294967295
Event 'new' on card #811
Event 'new' on card #812
Event 'remove' on sink #804
Event 'remove' on source #804
Event 'change' on server #4294967295
Event 'change' on card #811
Event 'new' on sink #816
Event 'new' on source #816
Event 'change' on server #4294967295
Event 'new' on source #817
Event 'change' on card #812
Event 'new' on sink #818
Event 'new' on source #818
Event 'change' on sink #816
Event 'change' on source #816
Event 'change' on card #811
Event 'change' on source #817
Event 'change' on card #812
Event 'change' on sink #818
Event 'change' on source #818
Event 'change' on source-output #38
Event 'change' on sink-input #118

The No object for name error sounds like the potential problem that Sean suggested earlier. You might try searching the web for that error string. Or maybe you could work around the problem by using a different connector (e.g. S/PDIF)?

Edit: I just noticed this comment in one of the KDE bug reports:

… the sound device may also be in energy saving and not wake up at all or not in time to produce anything audible.

I wonder if you might need to disable power saving to get the USB sound card to work?

I’m getting the same results with power settings set to performance.
Editing dracut/initramfs doesn’t make sense to me here. We’ve isolated the problem to my profile, and the audio does work, the volume and input settings just reset.

Here is a udev rule for disabling USB power management.

Excerpted from askubuntu.com – answer 1222000 (and fixed two missing commas):

ACTION=="add", SUBSYSTEM=="usb", TEST=="power/control", ATTR{power/control}="on"
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend", ATTR{power/autosuspend}="0"
ACTION=="add", SUBSYSTEM=="usb", TEST=="power/autosuspend_delay_ms", ATTR{power/autosuspend_delay_ms}="0"

Tried this (including the udevadm and systemctl reloads from the linked post) and added a reboot at the end for good measure. Still no luck.

Sorry, I’m out of ideas. If it were me, at this point, I’d probably try to hack together a script to fix things the way I want and set it to auto run when I sign in. Maybe someone else has some ideas about how to fix it.

No worries, I appreciate the time you took to come up with suggestions. I’ll post the solution here if/when I figure it out.

1 Like

Not sure what to do with this info yet, but I just found that alsactl init resets the volume

Maybe something along the lines of the following would work as a hack (untested)?

[Unit]
Description=Reinitialize audio devices to their defaults

[Service]
Type=oneshot
ExecStart=-/usr/bin/sleep 5
ExecStart=-/usr/sbin/alsactl init

[Install]
WantedBy=default.target

Put the above in ~/.config/systemd/user/alsa-reinit.service and then enable it with systemctl --user enable alsa-reinit.service. It should then run whenever you sign in.