nomadbsd / handbook

NomadBSD handbooklet
BSD 2-Clause "Simplified" License
8 stars 3 forks source link

Sound volume reset issue at either shutdown or boot. #6

Closed globetrotterdk closed 2 years ago

globetrotterdk commented 2 years ago

I am experiencing a problem with having to reset the volume level after every login. I have experienced this issue both from running the latest NomadBSD from a USB pen drive, and now from a system install on a SSD. I am using a Behringer UPHORIA UMC204HD USB sound card as my audio source (pcm4: USB audio*). When using the USB pen drive, the solution (due to the configuration of the drive, with persistence) for me was to remove 'late' from the /var/db line in /etc/fstab. However, that line doesn't exist in /etc/fstab on my current install...

Here is some information: `~> dmesg | grep “audio”

~> cat /dev/sndstat Installed devices: pcm0: <NVIDIA (0x0099) (HDMI/DP 8ch)> (play) pcm1: <NVIDIA (0x0099) (HDMI/DP 8ch)> (play) pcm2: <NVIDIA (0x0099) (HDMI/DP 8ch)> (play) pcm3: <Realtek ALC222 (Analog 2.0+HP/2.0)> (play/rec) pcm4: (play/rec) default No devices installed from userspace.

~> uname -a FreeBSD NomadBSD 13.0-RELEASE-p6 FreeBSD 13.0-RELEASE-p6 #0: Mon Jan 10 06:28:50 UTC 2022 root@amd64-builder.daemonology.net:/usr/obj/usr/src/amd64.amd64/sys/GENERIC amd64

~> cat /etc/defaults/rc.conf | grep mixer mixer_enable="YES" # Run the sound mixer.

~> sudo mixer pcm 100 Password: Setting the mixer pcm from 75:75 to 100:100.

~> mixer Mixer vol is currently set to 100:100 Mixer bass is currently set to 50:50 Mixer treble is currently set to 50:50 Mixer pcm is currently set to 100:100 Mixer mic is currently set to 25:25

`

mrclksr commented 2 years ago

If the USB sound card driver is loaded via devmatch or dsbdriverd, which happens after /etc/rc.d/mixer is run, the previous volumes can't be restored. Add snd_uaudio_load="YES" to /boot/loader.conf to make sure the device is available when /etc/rc.d/mixer is run.

globetrotterdk commented 2 years ago

If the USB sound card driver is loaded via devmatch or dsbdriverd, which happens after /etc/rc.d/mixer is run, the previous volumes can't be restored. Add snd_uaudio_load="YES" to /boot/loader.conf to make sure the device is available when /etc/rc.d/mixer is run.

That seems to have worked. Thanks for the help.

mrclksr commented 2 years ago

https://github.com/nomadbsd/NomadBSD/commit/2f68171d54a84aa319b98bf33104f9f39d06054b