My turn for "speakers not working although headphone out does"

cracauer@

Developer
Can't make the speakers play. Headphone out works fine. Hardware detection and mixer all seem to go fine (see code section).

Thinkpad T14 gen 1 (8-core AMD). Realtek ALC257 soundchip.

Code:
% cat /dev/sndstat 
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <ATI R6xx (HDMI)> (play)
pcm2: <ATI R6xx (HDMI)> (play)
pcm3: <Realtek ALC257 (Analog)> (play/rec) default
pcm4: <Realtek ALC257 (Right Analog Headphones)> (play)

dmesg:
pcm0: <ATI R6xx (HDMI)> at nid 3 on hdaa0
pcm1: <ATI R6xx (HDMI)> at nid 5 on hdaa0
pcm2: <ATI R6xx (HDMI)> at nid 7 on hdaa0
hdacc1: <Realtek ALC257 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC257 Audio Function Group> at nid 1 on hdacc1
pcm3: <Realtek ALC257 (Analog)> at nid 20 and 25 on hdaa1
pcm4: <Realtek ALC257 (Right Analog Headphones)> at nid 33 on hdaa1

% mixer
pcm3:mixer: <Realtek ALC257 (Analog)> on hdaa1 (play/rec) (default)
    vol       = 1.00:1.00     pbk
    pcm       = 1.00:1.00     pbk
    speaker   = 1.00:1.00     rec
    mic       = 0.67:0.67     rec src
    rec       = 0.37:0.37     pbk
    ogain     = 1.00:1.00     pbk

Any ideas?

I'm playing with `mplayer -ao oss:/dev/dsp3 01.wav`. Using dsp4 sends to the headphone out.
 
Have you tried the example in handbook chapter 9.2.4. Automatically Switching to Headphones?

If not sure which nid is speaker (nid20 or nid25), to get detailed info about the relevant nids:

sysctrl -a | egrep 'nid20|nid25|nid33'


Sound on my ThinkPad E15 Gen3 AMD works OOTB (speaker, headphones, speaker muted when headphones plugged in ). It might be helpful viewing the nid association and sequence number settings for speaker, headphones and Mic down below, See also snd_hda(4) for as and seq.

Code:
cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <ATI R6xx (HDMI)> (play)
pcm2: <ATI R6xx (HDMI)> (play)
pcm3: <Realtek ALC257 (Analog 2.0+HP/2.0)> (play/rec) default
pcm4: <Realtek ALC257 (Right Analog Mic)> (rec)
No devices installed from userspace.
Code:
dmesg | egrep 'pcm|hda'
hdac0: <ATI (0x1637) HDA Controller> mem 0xfd3c8000-0xfd3cbfff at device 0.1 on pci4
hdac1: <AMD Raven HDA Controller> mem 0xfd3c0000-0xfd3c7fff at device 0.6 on pci4
hdacc0: <ATI R6xx HDA CODEC> at cad 0 on hdac0
hdaa0: <ATI R6xx Audio Function Group> at nid 1 on hdacc0
pcm0: <ATI R6xx (HDMI)> at nid 3 on hdaa0
pcm1: <ATI R6xx (HDMI)> at nid 5 on hdaa0
pcm2: <ATI R6xx (HDMI)> at nid 7 on hdaa0
hdacc1: <Realtek ALC257 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC257 Audio Function Group> at nid 1 on hdacc1
pcm3: <Realtek ALC257 (Analog 2.0+HP/2.0)> at nid 20,33 and 18 on hdaa1
pcm4: <Realtek ALC257 (Right Analog Mic)> at nid 25 on hdaa1
Code:
sysctl -a | egrep 'nid20|nid33|nid18|nid25'
dev.hdaa.1.nid33_original: 0x0421101f as=1 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid33_config: 0x0421101f as=1 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid33: pin: Headphones (Black Jack)
dev.hdaa.1.nid25_original: 0x04a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid25_config: 0x04a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid25: pin: Mic (Black Jack)
dev.hdaa.1.nid20_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20: pin: Speaker (Fixed)
dev.hdaa.1.nid18_original: 0x90a60120 as=2 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.1.nid18_config: 0x90a60120 as=2 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.1.nid18: pin: Mic (Fixed)
 
Have you tried the example in handbook chapter 9.2.4. Automatically Switching to Headphones?

If not sure which nid is speaker (nid20 or nid25), to get detailed info about the relevant nids:

sysctrl -a | egrep 'nid20|nid25|nid33'


Sound on my ThinkPad E15 Gen3 AMD works OOTB (speaker, headphones, speaker muted when headphones plugged in ). It might be helpful viewing the nid association and sequence number settings for speaker, headphones and Mic down below, See also snd_hda(4) for as and seq.

Code:
cat /dev/sndstat
Installed devices:
pcm0: <ATI R6xx (HDMI)> (play)
pcm1: <ATI R6xx (HDMI)> (play)
pcm2: <ATI R6xx (HDMI)> (play)
pcm3: <Realtek ALC257 (Analog 2.0+HP/2.0)> (play/rec) default
pcm4: <Realtek ALC257 (Right Analog Mic)> (rec)
No devices installed from userspace.
Code:
dmesg | egrep 'pcm|hda'
hdac0: <ATI (0x1637) HDA Controller> mem 0xfd3c8000-0xfd3cbfff at device 0.1 on pci4
hdac1: <AMD Raven HDA Controller> mem 0xfd3c0000-0xfd3c7fff at device 0.6 on pci4
hdacc0: <ATI R6xx HDA CODEC> at cad 0 on hdac0
hdaa0: <ATI R6xx Audio Function Group> at nid 1 on hdacc0
pcm0: <ATI R6xx (HDMI)> at nid 3 on hdaa0
pcm1: <ATI R6xx (HDMI)> at nid 5 on hdaa0
pcm2: <ATI R6xx (HDMI)> at nid 7 on hdaa0
hdacc1: <Realtek ALC257 HDA CODEC> at cad 0 on hdac1
hdaa1: <Realtek ALC257 Audio Function Group> at nid 1 on hdacc1
pcm3: <Realtek ALC257 (Analog 2.0+HP/2.0)> at nid 20,33 and 18 on hdaa1
pcm4: <Realtek ALC257 (Right Analog Mic)> at nid 25 on hdaa1
Code:
sysctl -a | egrep 'nid20|nid33|nid18|nid25'
dev.hdaa.1.nid33_original: 0x0421101f as=1 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid33_config: 0x0421101f as=1 seq=15 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid33: pin: Headphones (Black Jack)
dev.hdaa.1.nid25_original: 0x04a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid25_config: 0x04a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid25: pin: Mic (Black Jack)
dev.hdaa.1.nid20_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20: pin: Speaker (Fixed)
dev.hdaa.1.nid18_original: 0x90a60120 as=2 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.1.nid18_config: 0x90a60120 as=2 seq=0 device=Mic conn=Fixed ctype=Digital loc=Internal color=Unknown misc=1
dev.hdaa.1.nid18: pin: Mic (Fixed)

I tried this in device.hints, but no change:
hint.hdac.0.cad0.nid33.config="as=1 seq=15 device=Headphones"
hint.hdac.0.cad0.nid25.config="as=2 seq=0 device=speakers"


Code:
% sysctl -a | egrep 'nid20|nid25|nid33'
dev.hdaa.1.nid33_original: 0x04211020 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid33_config: 0x04211020 as=2 seq=0 device=Headphones conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid33: pin: Headphones (Black Jack)
dev.hdaa.1.nid25_original: 0x04a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid25_config: 0x04a11030 as=3 seq=0 device=Mic conn=Jack ctype=1/8 loc=Right color=Black misc=0
dev.hdaa.1.nid25: pin: Mic (Black Jack)
dev.hdaa.1.nid20_original: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20_config: 0x90170110 as=1 seq=0 device=Speaker conn=Fixed ctype=Analog loc=Internal color=Unknown misc=1
dev.hdaa.1.nid20: pin: Speaker (Fixed)
 
I tried this in device.hints, but no change:
hint.hdac.0.cad0.nid33.config="as=1 seq=15 device=Headphones"
hint.hdac.0.cad0.nid25.config="as=2 seq=0 device=speakers"
You might got it wrong, I would use the alternative setting:
Code:
hint.hdaa.1.nid33.config="as=1 seq=15"

I don't know if you can turn the mic input into an output. sysctl dev.hdac.1.pindump=1 followed by dmesg | grep hdaa1 probably can give us an aswer.

I have no idea why your speakers don't work unfortunatly.
 
Looks like both of us running Realtek chips are cursed, I gave up after several tries including mapping all nids, sometimes it works, most of the time it doesn't.
That is not critical in my case, I use an external HDMI screen so the sound goes in (works always).
 
In my case, setting
Code:
hw.snd.basename_clone=1
solved issues with speakers. You could also try to set it to 0 if it is set to 1.
 
In my case, setting
Code:
hw.snd.basename_clone=1
solved issues with speakers. You could also try to set it to 0 if it is set to 1.

It was 1. Setting it to 0 at runtime did not make it work. Do I maybe need to put this into device.hints?
 
Well, a quick test reveals that the speakers work under Linux. That's an improvement over the LG Gram I tried last. Wonder whether there is some snooping I can do under Linux that helps me make this work in FreeBSD.
 
It was 1. Setting it to 0 at runtime did not make it work. Do I maybe need to put this into device.hints?
I noticed FreeBSD change it to 0 if you turn off the bluetooth or hcsecd daemon. I would try to check the both values with setting via sysctl command. If not works, perhaps it will not work in device.hint too.

There was a setting muted somewhere in the wild, but I don't remember now where. ;)
 
Well what do you know? I Didn't Change Anything(TM) and the speakers work today. I speculate that it might be because I did a warm reboot from the Linux where the speakers worked? Time will tell.
 
Back
Top