Inability to beep(1): sound not working

Hi, there, long time *ix user, new to BSD.

Code:
root@freebsd:~ # kldload snd_driver
kldload: can't load snd_driver: module already loaded or in kernel

root@freebsd:~ # grep snd /boot/loader.conf
snd_driver_load="YES"

OK, so it looks like I got drivers. Bootup logging reported:

Code:
hdacc0: <Realtek ALC225 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC225 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
hdacc1: <Intel Skylake HDA CODEC> at cad 2 on hdac0
hdaa1: <Intel Skylake Audio Function Group> at nid 1 on hdacc1
pcm1: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1


Browsing the forums, I did a pindump:

Code:
hdaa0: <Realtek ALC225 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
hdaa0: Dumping AFG pins:
hdaa0: nid   0x    as seq device       conn  jack    loc        color   misc
hdaa0: 18 b7a60150 5  0  Mic           Fixed Digital Lid-In     Unknown 1
hdaa0:     Caps: IN                
hdaa0: 19 40000000 0  0  Line-out      None  Unknown 0x00       Unknown 0 DISA
hdaa0:     Caps: IN                
hdaa0: 20 901701b0 11 0  Speaker       Fixed Analog  Internal   Unknown 1 DISA
hdaa0:     Caps:    OUT    EAPD      Sense: 0x00000000 (disconnected)
hdaa0: 22 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 23 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT HP           Sense: 0x00000000 (disconnected)
hdaa0: 24 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN                  Sense: 0x00000000 (disconnected)
hdaa0: 25 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN             VREF Sense: 0x00000000 (disconnected)
hdaa0: 26 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN             VREF Sense: 0x00000000 (disconnected)
hdaa0: 27 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps: IN OUT    EAPD VREF Sense: 0x80000000 (connected)
hdaa0: 30 411111f0 15 0  Speaker       None  1/8     Rear       Black   1 DISA
hdaa0:     Caps:    OUT            
hdaa0: 33 04211020 2  0  Headphones    Jack  1/8     Right      Black   0
hdaa0:     Caps:    OUT HP EAPD      Sense: 0x00000000 (disconnected)
hdaa0: NumGPIO=3 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0:  GPIO0: disabled
hdaa0:  GPIO1: disabled
hdaa0:  GPIO2: disabled

Grepping dmesg...

Code:
root@freebsd:~ # dmesg |grep pcm
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
pcm1: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
pcm1: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1

Of concern is this:

Code:
# cat /dev/sndstat
pcm0: <Realtek ALC225 (Analog)> (play/rec) default
pcm1: <Intel Skylake (HDMI/DP 8ch)> (play)
No devices installed from userspace.

That "No devices" thing has me a little worried. But, AFAICT per guide 9.2.1, I seem to have the drivers loaded up properly. For yuks, beep(1) doesn't do anything.

For additional yuks, I've tried toggling hw.snd.default_unit between 0 and 1 without any audible change via beep.

Questions:

1. What is "No devices installed from userspace" suggesting I did wrong (or is it ignore-able?)
2. I'm not sure what the next step ought be

Coloring commentary:

This (old) machine previously was running Debian 12 and was leveraging pulseaudio and it worked there. Based on pkg configuration and forum commentary, pulse seems distasteful to many so I'd like to avoid solving my problem with it.
 
Code:
root@freebsd:~ # grep snd /boot/loader.conf
snd_driver_load="YES"
You can remove this one. It's a convenient module to load as it simply loads all available sound drivers. Useful for figuring out which sound card you have. The ones that are detected are already included with the GENERIC kernel, so you don't need to load any.
 
1. What is "No devices installed from userspace" suggesting I did wrong (or is it ignore-able?)

You did nothing wrong. It is used to list audio devices created by audio/virtual_oss. You can ignore it.

Browsing the forums, I did a pindump:

Code:
hdaa0: <Realtek ALC225 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
hdaa0: Dumping AFG pins:
hdaa0: nid 0x as seq device conn jack loc color misc
hdaa0: 18 b7a60150 5 0 Mic Fixed Digital Lid-In Unknown 1
hdaa0: Caps: IN
hdaa0: 19 40000000 0 0 Line-out None Unknown 0x00 Unknown 0 DISA
hdaa0: Caps: IN
hdaa0: 20 901701b0 11 0 Speaker Fixed Analog Internal Unknown 1 DISA
hdaa0: Caps: OUT EAPD Sense: 0x00000000 (disconnected)
hdaa0: 22 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: OUT HP Sense: 0x00000000 (disconnected)
hdaa0: 23 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: OUT HP Sense: 0x00000000 (disconnected)
hdaa0: 24 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: IN Sense: 0x00000000 (disconnected)
hdaa0: 25 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: IN VREF Sense: 0x00000000 (disconnected)
hdaa0: 26 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: IN VREF Sense: 0x00000000 (disconnected)
hdaa0: 27 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: IN OUT EAPD VREF Sense: 0x80000000 (connected)
hdaa0: 30 411111f0 15 0 Speaker None 1/8 Rear Black 1 DISA
hdaa0: Caps: OUT
hdaa0: 33 04211020 2 0 Headphones Jack 1/8 Right Black 0
hdaa0: Caps: OUT HP EAPD Sense: 0x00000000 (disconnected)
hdaa0: NumGPIO=3 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=1
hdaa0: GPIO0: disabled
hdaa0: GPIO1: disabled
hdaa0: GPIO2: disabled
Grepping dmesg...

Code:
root@freebsd:~ # dmesg |grep pcm
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
pcm1: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1
pcm0: <Realtek ALC225 (Analog)> at nid 33 and 18 on hdaa0
pcm1: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1

Your speaker (nid=20) is disabled and therefore not part of any pcm sound device. pcm0 consists of your headphones jack (nid=33) and your mic input (nid=18), and pcm1 is your HDMI/DP output.

I'm currently not sure if and how it can be enabled. Maybe some playing arround with GPIO pins?
 
Fascinating, the solution was here: https://forum.nomadbsd.org/t/no-sound-on-dell-7659-laptop/1000/5

Code:
hint.hdaa.0.nid33.config="as=2 seq=15"
hint.hdaa.0.nid20.config="as=2 seq=0"

With resultant diff(1) thanks to `sysctl dev.hdac.0.pindump=1`:

Code:
9c9
< hdaa0: 20 901701b0 11 0  Speaker       Fixed Analog  Internal   Unknown 1 DISA
---
> hdaa0: 20 90170120 2  0  Speaker       Fixed Analog  Internal   Unknown 1
25c25
< hdaa0: 33 04211020 2  0  Headphones    Jack  1/8     Right      Black   0
---
> hdaa0: 33 0421102f 2  15 Headphones    Jack  1/8     Right      Black   0
30a31,35
> hdaa1: Dumping AFG pins:
> hdaa1: nid   0x    as seq device       conn  jack    loc        color   misc
> hdaa1:  3 18560010 1  0  Digital-out   Jack  Digital 0x18       Unknown 0
> hdaa1:     Caps:    OUT              Sense: 0x00000000 (disconnected)
> hdaa1: NumGPIO=0 NumGPO=0 NumGPI=0 GPIWake=0 GPIUnsol=0

I'm still trying to parse what this means, but it looks like these commands give nid20 precedence to nid33 which, per @bscode above, puts speaker ahead of headphones jack. I haven't made it into a full narrative about what changed.
 
Fascinating, the solution was here: https://forum.nomadbsd.org/t/no-sound-on-dell-7659-laptop/1000/5

Code:
hint.hdaa.0.nid33.config="as=2 seq=15"
hint.hdaa.0.nid20.config="as=2 seq=0"

I'm still trying to parse what this means, but it looks like these commands give nid20 precedence to nid33 which, per @bscode above, puts speaker ahead of headphones jack. I haven't made it into a full narrative about what changed.

Thanks, it's very interesting that this solves the issue. I'll try to explain to you what is going on here (snd_hda(4) is always a good read):

You have the initial pin configuration
Code:
nid=33, as=2, seq=0, Headphones (OUTPUT)
nid=18, as=5, seq=0, Mic (INPUT)
nid=20, as=11, seq=0, Speakers (OUTPUT)
nids with the same as are grouped together. seq specifies how the nids inside a group relate, it has a special meaning like eg. what nid is the front right speaker in a 5.1 surround setup, or if sound shall switch over to the headphones (special value seq=15). A pcm sound device is then created by combining an OUTPUT group with an INPUT group from ascending as numbers.

In your case all nids have a different as and thus don't form any groups. So I would have expected the following pcm devices:
Code:
pcm0 = { nid=33 + nid=18 } = { Headphones  + Mic}
pcm1 = { nid=20 } = { Speakers }
But somehow nid=20 isn't considered in your initial configuration.

Your posted solution is putting your speakers and headphones into the same group by configurating the same as=2. Using seq=15 for the headphones does the magic of switching sound over from speakers to headphones when they are in the same group. And somehow this also enables your speakers for pcm construction. Now this creates the following pcm devices:
Code:
pcm0 = { (nid=20 + nid=33) + nid=18 } = { (Speakers + Headphones) + Mic }

Good to know.
 
Back
Top