Sound issue ..after a disk change?? weird. How to fix..?

Hi all,

I had to replace a geli encrypted disk (spinning rust) in a zpool on a FreeBSD 13.5-stable (https://forums.freebsd.org/threads/...n-a-geom-eli-encrypted-zfs-pool-howto.101074/.

..unfortunately that generated some ugly side effects, one of them is that my sound output to the speakers doesn't want to function anymore.
This is a MSI B450Pro-MAX Motherboard with an Ryzen5/3600 with onboard sound. Usually this machine (my PC for home & work) has a longish uptime.. and it seems that some updates or so weren't fully "committed" to the system or not complete.

The verbose dmesg and messages are attached. Connected is only an usb microphone and PC-Speakers with an 1/8 Inch plug to the green rear output, the analog front out doesn't exist ..no connector to the motherboard. For the last 4 years it was sufficient to put an hw.snd.default_unit=4 to /etc/sysctl.conf, but now it stopped working. While the system boots and the pcm? are detected, some noise gets switched on on the speakers, it sounds like an unconnected input, some chrisseling, some rush and quit hum. This gets shut down when I shutdown the system, so it is "controlled" and the speakers (including their amplifiers) are working fine.

I've tried to understand what's going on here..but failed until now.
I've put an

hint.hdaa.1.nid20.config="as=1 seq=0 device=speakers"
hint.hdaa.1.nid18.config="as=1 seq=15 device=Headphones"

into device.hints, but this makes no difference. If I use firefox or VLC or pulseaudio tools or audacity ..there comes nothing interesting out of the speakers. I've installed DSBmixer and tried all possible variants..nothing.

I'm out of ideas..any help?

Thanks in advance,
Holm
 

Attachments

There are different audio devices/pcm's , which one do you use ?

hdaa0: <NVIDIA (0x0040) Audio Function Group> at nid 1 on hdacc0
hdaa1: <Realtek ALC892 Audio Function Group> at nid 1 on hdacc1
uaudio0: <Thomann SC450USB, class 0/0, rev 1.10/0.01, addr 2> on usbus1
pcm6: <USB audio> on uaudio0
-------------------------------------------------------------
Jan 4 20:46:04 trollo kernel: pcm0: <NVIDIA (0x0040) (HDMI/DP 8ch)> at nid 4 on hdaa0
Jan 4 20:46:04 trollo kernel: pcm1: <NVIDIA (0x0040) (HDMI/DP 8ch)> at nid 5 on hdaa0
Jan 4 20:46:04 trollo kernel: pcm2: <NVIDIA (0x0040) (HDMI/DP 8ch)> at nid 6 on hdaa0
Jan 4 20:46:04 trollo kernel: pcm3: <NVIDIA (0x0040) (HDMI/DP 8ch)> at nid 7 on hdaa0
Jan 4 20:46:04 trollo kernel: pcm4: <Realtek ALC892 (Rear Analog 7.1/2.0)> at nid 20,22,21,23 and 24,26 on hdaa1
Jan 4 20:46:04 trollo kernel: pcm5: <Realtek ALC892 (Front Analog)> at nid 27 and 25 on hdaa1

Jan 4 20:46:04 trollo kernel: uaudio0: Record[0]: 48000 Hz, 2 ch, 16-bit S-LE PCM format, 2x8ms buffer.
Jan 4 20:46:04 trollo kernel: pcm6: <USB audio> on uaudio0
------------------------------------------------

Code:
cat /dev/sndstat

Code:
ls /dev/dsp*

You can try to play white noise for 4-seconds on all of the available dsp's , eg dsp4 , using following script :
Code:
sh -c "cat /dev/random > /dev/dsp4 &" ; sleep 4 ; killall cat

Then in /etc/sysctl.conf :
Code:
hw.snd.default_unit= XXX
 
root@trollo:/home/holm # cat /dev/sndstat
Installed devices:
pcm0: <NVIDIA (0x0040) (HDMI/DP 8ch)> (play)
pcm1: <NVIDIA (0x0040) (HDMI/DP 8ch)> (play)
pcm2: <NVIDIA (0x0040) (HDMI/DP 8ch)> (play)
pcm3: <NVIDIA (0x0040) (HDMI/DP 8ch)> (play)
pcm4: <Realtek ALC892 (Rear Analog 7.1/2.0)> (play/rec) default
pcm5: <Realtek ALC892 (Front Analog)> (play/rec)
pcm6: <USB audio> (rec)
No devices installed from userspace.
root@trollo:/home/holm #

root@trollo:/home/holm # ls /dev/dsp*
/dev/dsp0.0 /dev/dsp0.1 /dev/dsp1.0 /dev/dsp1.1 /dev/dsp2.0
/dev/dsp2.1 /dev/dsp3.0 /dev/dsp3.1 /dev/dsp4.0 /dev/dsp5.0
/dev/dsp5.1 /dev/dsp6.0 /dev/dsp6.1
root@trollo:/home/holm #

sh -c "cat /dev/random &gt; /dev/dsp4 &amp;" ; sleep 4 ; killall cat

..nothing

hw.snd.default_unit= XXX

root@trollo:/home/holm # sysctl -a|grep hw.snd
hw.snd.maxautovchans: 16
hw.snd.default_unit: 4
hw.snd.version: 2009061500/amd64
hw.snd.default_auto: 0
hw.snd.verbose: 0
hw.snd.vpc_mixer_bypass: 1
hw.snd.feeder_rate_quality: 1
hw.snd.feeder_rate_round: 25
hw.snd.feeder_rate_max: 2016000
hw.snd.feeder_rate_min: 1
hw.snd.feeder_rate_polyphase_max: 183040
hw.snd.feeder_rate_presets: 100:8:0.85 100:36:0.92 100:164:0.97
hw.snd.feeder_eq_exact_rate: 0
hw.snd.feeder_eq_presets: PEQ:16000,0.2500,62,0.2500:-9,9,1.0:44100,48000,88200,96000,176400,192000
hw.snd.basename_clone: 1
hw.snd.compat_linux_mmap: 0
hw.snd.syncdelay: -1
hw.snd.usefrags: 0
hw.snd.vpc_reset: 0
hw.snd.vpc_0db: 45
hw.snd.vpc_autoreset: 1
hw.snd.timeout: 5
hw.snd.latency_profile: 1
hw.snd.latency: 2
hw.snd.report_soft_matrix: 1
hw.snd.report_soft_formats: 1
root@trollo:/home/holm #

...are you sure that you read my post?

The only connected Output is the rear green "line" Output that goes to
the speakers containing an amplifier.
This worked for years.
I've made no system update or new kernel.

Jan 4 20:46:04 trollo kernel: pcm4: nid=20 [pin: Line-out (Green Jack)]
Jan 4 20:46:04 trollo kernel: pcm4: + <- nid=12 [audio mixer] [src: pcm, mix]
Jan 4 20:46:04 trollo kernel: pcm4: + <- nid=2 [audio output] [src: pcm]
Jan 4 20:46:04 trollo kernel: pcm4: + <- nid=11 [audio mixer] [src: mix]
Jan 4 20:46:04 trollo kernel: pcm4:

Jan 4 20:46:04 trollo kernel: pcm4: Master Volume (OSS: vol): -64/0dB
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 1 (nid 2 out): -64/0dB (65 steps)
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 2 (nid 3 out): -64/0dB (65 steps)
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 3 (nid 4 out): -64/0dB (65 steps)
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 4 (nid 5 out): -64/0dB (65 steps)
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 17 (nid 12 in 0): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 18 (nid 12 in 1): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 19 (nid 13 in 0): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 20 (nid 13 in 1): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 21 (nid 14 in 0): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 22 (nid 14 in 1): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 23 (nid 15 in 0): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 24 (nid 15 in 1): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 25 (nid 20 in ): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 26 (nid 21 in ): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 27 (nid 22 in ): mute
Jan 4 20:46:04 trollo kernel: pcm4: +- ctl 28 (nid 23 in ): mute

..what exactly do those columns mean?

Regards,
Holm
 
It's the audio driver of the kernel saying, i don't like this card :)

sh -c "cat /dev/random &gt; /dev/dsp0 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
sh -c "cat /dev/random &gt; /dev/dsp1 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
sh -c "cat /dev/random &gt; /dev/dsp2 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
sh -c "cat /dev/random &gt; /dev/dsp3 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
sh -c "cat /dev/random &gt; /dev/dsp4 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
sh -c "cat /dev/random &gt; /dev/dsp5 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
sh -c "cat /dev/random &gt; /dev/dsp6 &amp;" ; sleep 4 ; killall cat
wait 10 seconds
 
I've tried this already in several ways..nothing.
I've done this again (not starting the cats in the background)..

root@trollo:/home/holm # cat /dev/random > /dev/dsp6
su: cannot create /dev/dsp6: Operation not supported
root@trollo:/home/holm #

This is because 6 is an usb microphone.

How can an audio driver decide to not like an audio card after 4 years?
Again: I haven't updated the kernel or any drivers. I've only changed a disk
yesterday .. and it's no soundcard, it's the mainboard.

Regards,
Holm
 
Again.. there is some noise at the green output and the noise gets tuned up from silence to an low level while booting
and initializing the soundcard. If I shutdown the system, the noise gets dimmed down to silence.
I'm shure that's a wron singla routing that ends at the wrong pins of the audio chip somewhere on the motherboard
and I can't change the volume of the noise with any handle of the different mixers I've tried.
I remember that I had similar hassle when I've first installed this Motherboard, setting hw.snd.default_unit=4 wasn't sufficient,
I had to patch the volume regulator from mate to direct the sound to the right output.

Yesterday I`ve upgraded much of the mate desktop since it came up with only twm as window manager, I can't really say
what has gone wrong and what exactly I've changed 4 years before but this problem was on the Desktop and browsers,
now even a cat > /dev/dsp doesn't work...
I think my problems yesterday resulted from incomplete updates or some such, I've rebooted after a long uptime.

Regards,
Holm
 
#!/bin/sh

while true
do
for i in 0 1 2 3 4 5
do
echo "output of mixer -f mixer$i:"
mixer -f /dev/mixer$i
echo""
echo "cat /dev/random > /dev/dsp$i &"
sh -c "cat /dev/random > /dev/dsp$i&"; sleep 2; killall cat
sleep 3
done
done
 
root@trollo:/home/holm # ./sndtest.sh
output of mixer -f mixer0:
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100

cat /dev/random > /dev/dsp0 &
output of mixer -f mixer1:
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100

cat /dev/random > /dev/dsp1 &
output of mixer -f mixer2:
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100

cat /dev/random > /dev/dsp2 &
output of mixer -f mixer3:
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100

cat /dev/random > /dev/dsp3 &
output of mixer -f mixer4:
Mixer vol is currently set to 53:53
Mixer pcm is currently set to 49:49
Mixer speaker is currently set to 59:59
Mixer line is currently set to 64:64
Mixer mic is currently set to 61:61
Mixer mix is currently set to 56:56
Mixer rec is currently set to 56:56
Mixer igain is currently set to 57:57
Mixer ogain is currently set to 53:53
Recording source: mic

cat /dev/random > /dev/dsp4 &
output of mixer -f mixer5:
Mixer vol is currently set to 49:49
Mixer pcm is currently set to 51:51
Mixer rec is currently set to 52:52
Mixer igain is currently set to 50:50
Mixer ogain is currently set to 49:49
Mixer monitor is currently set to 53:53
Recording source: monitor

cat /dev/random > /dev/dsp5 &
output of mixer -f mixer0:
Mixer vol is currently set to 100:100
Mixer pcm is currently set to 100:100

Regards,
Holm
 
Realtek ALC892 is generally well-supported in FreeBSD, though issues typically arise from the system selecting the wrong default output (often HDMI) or improper jack pin sensing
.
When you start "dsbmixer", which channels are called realtek & have a volume button ?
 
DSBmixer makes no problems, all channels are displayed and all exept pcm6 have a volume control.
It is equivalent to a (cli) mixer -f /dev/mixer[0..6] and I've postet the script and the mixer output for every device above.

It's very clear to me that there is something wrong with the "sound routing" in the internal matrix.
(I'm an electronican, repairing industrial devices usually).

In the meantime I've connected a cheap "USB-Soundcard" that gets recognized as pcm7..works as expected,
at least I can hear some news etc... but this isn't my prefered way..

Regards,
Holm

Edit: typos
 
This is a bought "used" "Gamer Motherboard"..(I don't have any interest to gamble, besides of xskat or sokoban one time in a year) it's theoretical possible that it has an defect in the sound system.
As I already wrote I've had problems with that in the past as I've mounted the MB but I got it working with patching the software to this time. Possibly there are weak soldering contacts at the chip itself, but it had worked for several years now. I've selected it because of the many slots it has.
I could rework the board with hot air, but I don't really going to disassemble the PC for doing that. The machine works absolutely reliable otherwise and for me it's not logical that both channels don't work at the same time.

Regards,
Holm
 
Back
Top