Sound and microphone levels reset after reboot

After the latest stable upgrade, my sound and microphone levels reset to certain values after each reboot.

Operating System: Manjaro Linux
KDE Plasma Version: 5.19.5
KDE Frameworks Version: 5.73.0
Qt Version: 5.15.0
Kernel Version: 5.8.6-1-MANJARO
OS Type: 64-bit

What I found is that this problem occurs only for kernel 5.8 but the sound levels are correctly restored with LTS 5.4.64.

I, too, have this issue on Plasma desktop. The speaker volume resets after reboot.

inxi -F
System:
  Host: shmuel-Manjaro Kernel: 5.8.6-1-MANJARO x86_64 bits: 64 
  Desktop: KDE Plasma 5.19.5 Distro: Manjaro Linux 
Machine:
  Type: Desktop Mobo: ASUSTeK model: PRIME B365M-A v: Rev X.0x 
  serial: <superuser/root required> UEFI: American Megatrends 
  v: 1203 date: 10/10/2019 
CPU:
  Info: 8-Core model: Intel Core i7-9700 bits: 64 type: MCP 
  L2 cache: 12.0 MiB 
  Speed: 800 MHz min/max: 800/4700 MHz Core speeds (MHz): 
  1: 800 2: 800 3: 800 4: 800 5: 800 6: 800 7: 800 8: 800 
Graphics:
  Device-1: Intel UHD Graphics 630 driver: i915 v: kernel 
  Device-2: IMC Networks XHC Camera type: USB driver: uvcvideo 
  Display: x11 server: X.Org 1.20.8 driver: intel 
  unloaded: modesetting resolution: 1: 1920x1080~60Hz 
  2: 1920x1080~60Hz 
  OpenGL: renderer: Mesa Intel UHD Graphics 630 (CFL GT2) 
  v: 4.6 Mesa 20.1.7 
Audio:
  Device-1: Intel 200 Series PCH HD Audio driver: snd_hda_intel 
  Device-2: JMTek LLC. type: USB 
  driver: hid-generic,snd-usb-audio,usbhid 
  Sound Server: ALSA v: k5.8.6-1-MANJARO 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit 
  Ethernet 
  driver: r8169 
  IF: enp3s0 state: up speed: 1000 Mbps duplex: full 
  mac: a8:5e:45:e2:87:3c 
Drives:
  Local Storage: total: 2.26 TiB used: 577.39 GiB (25.0%) 
  ID-1: /dev/sda vendor: Kingston model: SA400S37480G 
  size: 447.13 GiB 
  ID-2: /dev/sdb vendor: Toshiba model: HDWD120 size: 1.82 TiB 
Partition:
  ID-1: / size: 46.72 GiB used: 18.15 GiB (38.8%) fs: ext4 
  dev: /dev/sda6 
Swap:
  Alert: No Swap data was found. 
Sensors:
  System Temperatures: cpu: 29.8 C mobo: 27.8 C 
  Fan Speeds (RPM): N/A 
Info:
  Processes: 291 Uptime: 11h 55m Memory: 15.50 GiB 
  used: 7.80 GiB (50.3%) Shell: Bash inxi: 3.1.06

please post full response to

pacmd dump

and

pacmd dump-volumes

This problem is visible after shutdown (via power off button) then power on

@manjaro-med ~]$ pacmd dump
### Configuration dump generated at Mon Oct  5 11:07:23 2020

load-module module-device-restore
load-module module-stream-restore
load-module module-card-restore
load-module module-augment-properties
load-module module-switch-on-port-available
load-module module-udev-detect
load-module module-alsa-card device_id="0" name="pci-0000_00_1b.0" card_name="alsa_card.pci-0000_00_1b.0" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"
load-module module-jackdbus-detect channels=2
load-module module-bluetooth-policy
load-module module-bluetooth-discover
load-module module-bluez5-discover
load-module module-dbus-protocol
load-module module-native-protocol-unix
load-module module-gsettings
load-module module-default-device-restore
load-module module-rescue-streams
load-module module-always-sink
load-module module-intended-roles
load-module module-suspend-on-idle
load-module module-console-kit
load-module module-systemd-login
load-module module-position-event-sounds
load-module module-role-cork
load-module module-filter-heuristics
load-module module-filter-apply
load-module module-x11-publish display=:0
load-module module-x11-xsmp display=:0 session_manager=local/manjaro-med:@/tmp/.ICE-unix/1780,unix/manjaro-med:/tmp/.ICE-unix/1780
load-module module-cli-protocol-unix

set-sink-volume alsa_output.pci-0000_00_1b.0.analog-stereo 0xe429
set-sink-mute alsa_output.pci-0000_00_1b.0.analog-stereo no
suspend-sink alsa_output.pci-0000_00_1b.0.analog-stereo yes

set-source-volume alsa_output.pci-0000_00_1b.0.analog-stereo.monitor 0x10000
set-source-mute alsa_output.pci-0000_00_1b.0.analog-stereo.monitor no
suspend-source alsa_output.pci-0000_00_1b.0.analog-stereo.monitor yes
set-source-volume alsa_input.pci-0000_00_1b.0.analog-stereo 0xae68
set-source-mute alsa_input.pci-0000_00_1b.0.analog-stereo no
suspend-source alsa_input.pci-0000_00_1b.0.analog-stereo yes

set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo+input:analog-stereo

set-default-sink alsa_output.pci-0000_00_1b.0.analog-stereo
set-default-source alsa_input.pci-0000_00_1b.0.analog-stereo

### EOF

@manjaro-med ~]$ pacmd dump-volumes
Sink 0: reference = front-left: 58409 /  89% / -3.00 dB,   front-right: 58409 /  89% / -3.00 dB, real = front-left: 58409 /  89% / -3.00 dB,   front-right: 58409 /  89% / -3.00 dB, soft = fro
nt-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB, current_hw = front-left: 58409 /  89% / -3.00 dB,   front-right: 58409 /  89% / -3.00 dB, save = yes
Source 0: reference = front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB, real = front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB, soft = front
-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB, current_hw = front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB, save = no
Source 1: reference = front-left: 44648 /  68% / -10.00 dB,   front-right: 44648 /  68% / -10.00 dB, real = front-left: 44648 /  68% / -10.00 dB,   front-right: 44648 /  68% / -10.00 dB, soft
= front-left: 65536 / 100% / 0.00 dB,   front-right: 65536 / 100% / 0.00 dB, current_hw = front-left: 44648 /  68% / -10.00 dB,   front-right: 44648 /  68% / -10.00 dB, save = yes
sudo alsactl store

This will store your alsa sound state at every shutdown. Try this first. (after you have the sound levels you desire)

I’d also recommend disabling flat volumes in daemon.conf as some poorly written programs like discord set the volume to 100% every time they start and it bumps up every other slider.

pacmd dump is showing the volume settings in hexadecimal values
but they are consistent with the decimal values in pacmd dump-volumes

0e429 = 58409 (89%)
10000 = 65536 (100%)
0ae68 = 44648 (68%)

list of Pulseaudio modules appears to be missing module-device-manager that is required only by KDE
suggest you reboot system and check if that module is properly loaded from boot
I am not a KDE and do not know exactly what this module does (or what may fail when it is absent)
but I suspect function of KDE GUI controls may be impaired, which might be causing audio level problems

@BusinessOrc
that command will save ALSA audio settings
but it does not seem prudent to suggest saving audio settings without first checking if ALSA levels are correct
suggest check ALSA levels with

amixer --card=0

or

alsamixer --card=0 --view=All

Pulseaudio setting ‘flat-volumes’ is usually disabled by default in Manjaro
(next Pulseaudio version is expected to disable flat-volumes - PulseAudio v14.0 release notes (draft))
to check if setting is still disabled

pulseaudio --dump-conf | grep flat

the response should be:

flat-volumes = no

The default daemon.conf file for manjaro is empty as far as I remember, and I feel like flat volumes have been the pulse default for some time.

I did say after setting the right levels…

I’m not sure what all the messing around is good for here.

Set the right levels and save them. If you are still have trouble just use an older kernel, (that’s my mantra anyway) I doubt anyone would even notice a difference between 5.8 and 5.4 unless they are using WireGuard or a brand spanking new AMD system.

flat-volumes has been default for Pulseaudio, and gave rise to many complaints on old Manjaro forum
in 2017/2018
but Manjaro ‘patched PulseAudio to disable flat volumes by default’

flat-volumes = no
; flat-volumes = yes

comment about setting the right levels has reminded me of something else

@medmedin
please post response to

tdbtool ~/.config/pulse/*stream-volumes.tdb check

and

tdbtool ~/.config/pulse/*device-volumes.tdb check

Pulsaudio database information in home folder may have retained some old settings for audio devices that are no longer relevant

@manjaro-med ~]$ tdbtool ~/.config/pulse/*stream-volumes.tdb check
Database integrity is OK and has 54 records.
@manjaro-med ~]$ tdbtool ~/.config/pulse/*device-volumes.tdb check
Database integrity is OK and has 19 records.

considering there is only one onboard device and a USB device, 19 device-volumes is a higher than I would expect

suggest you clear all of the 4 Pulseaudio databases to remove any old settings

tdbtool ~/.config/pulse/*device-volumes.tdb erase
tdbtool ~/.config/pulse/*stream-volumes.tdb erase
tdbtool ~/.config/pulse/*device-manager.tdb erase
tdbtool ~/.config/pulse/*card-database.tdb erase

and reboot system to make sure any old Pulseaudio settings are gone

I had a similar problem. The solution for me was to disable the audio “front panel” header with “hdajackretask” from alsa-tools. I turned off the front panel ports (which are not connected) and the SPDIF output. There is some info in the ArchLinux audio Wiki on this. I left the HDMI enabled although I’m not using its audio signal.
I am using a RealTek ALC887 codec.
link: PulseAudio/Troubleshooting - ArchWiki

After some reboots and some shutdown/power on tests, it seems the level of speakers is restored but the internal microphone level is not.

suggest check pulseaudio sources

pacmd dump | grep source | grep -v monitor

and

pacmd dump-volumes | grep Source

Use this command to set Pulseaudio source level to 68% as before

pacmd set-source-volume alsa_input.pci-0000_00_1b.0.analog-stereo 44648

Also happens on Deepin.