No sound with sound card Intel Comet Lake PCH-LP cAVS

Hello everyone,

I just installed FreeBSD 13.1 on my new PC which has an Intel Comet Lake PCH-LP cAVS sound card and unfortunately I can't get the sound to work.

I understand from this link (https://github.com/freebsd/freebsd-src/blob/master/sys/dev/sound/pci/hda/hdac.h#L67) that the Intel High Definition Audio bridge device driver would supports the PCH version. So as indicated on snd_hda(4), I added the line snd_hda_load="YES" in /boot/loader.conf.

And then, when I try a cat /dev/sndstat, I can see my card:
Code:
# cat /dev/sndstat
Installed devices:
pcm0: <Intel Kaby Lake (HDMI/DP 8ch)> (play) default
No devices installed from userspace.

But I still have no sound. Would you have an idea please?
 
So as indicated on snd_hda(4), I added the line snd_hda_load="YES" in /boot/loader.conf.
That setting is not needed, snd_hda(4) is compiled in the GENERIC kernel.

Would you have an idea please?
Check mixer(8) settings "vol" and "pcm".

Try cat /COPYRIGHT > /dev/dsp

Try from a multimedia player choosing the audio device. For example multimedia/vlc hotkey Shift + A to cycle through audio devices, or menu "Audio" -> "Audio Device".

Or multimedia/mpv --audio-device=<name>. List devices with mpv --audio-device=help.

If neither of the suggestions work you can try patching hdac.c (HDA controller driver), see posts from Thread audio-through-hdmi-not-working-with-intel-hd-graphics-530.87041

https://forums.freebsd.org/threads/...-with-intel-hd-graphics-530.87041/post-587521 .
https://forums.freebsd.org/threads/...-with-intel-hd-graphics-530.87041/post-587572 .
 
# cat /dev/sndstat Installed devices: pcm0: <Intel Kaby Lake (HDMI/DP 8ch)> (play) default No devices installed from userspace.
At boot, FreeBSD sorts pcm devices, usually by location and assigns each location a pcm#. For example, pcm0 is the rear jacks ports, pcm1 is the group of front jacks, pcm2 could be the motherboard hdmi and pcm3 could be a sound card. By default only one is used and /dev/dsp is linked to the one used.

Review the FreeBSD handbook on multimedia:
https://docs.freebsd.org/en/books/handbook/multimedia/

and use sysctl to set the default sound unit accordingly.
 
Thank you very much for your help to both of you.

If neither of the suggestions work you can try patching hdac.c (HDA controller driver), see posts from Thread audio-through-hdmi-not-working-with-intel-hd-graphics-530.87041
T-Daemon indeed unfortunately nothing worked. But I see that the link you recommended is for sound through HDMI. The problem is that I already can't get it to work "normally" without being connected to HDMI. Here is the feedback of mpv --audio-device=help:
Code:
# mpv --audio-device=help
List of detected audio devices:
  'auto' (Autoselect device)
  'oss//dev/dsp' (Default)
  'oss//dev/dsp0' (Intel Kaby Lake (HDMI/DP 8ch))



At boot, FreeBSD sorts pcm devices, usually by location and assigns each location a pcm#. For example, pcm0 is the rear audio ports, pcm1 is the group of front ports, pcm2 could be the motherboard hdmi and pcm3 could be the a sound card. By default only one is used and /dev/dsp is linked to the one used.
shepper it looks like I only have one sound card, here is the feedback from dmesg | grep pcm:
Code:
# dmesg | grep pcm
pcm0: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa0
pcm0: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa0
 
# mpv --audio-device=help List of detected audio devices: 'auto' (Autoselect device) 'oss//dev/dsp' (Default) 'oss//dev/dsp0' (Intel Kaby Lake (HDMI/DP 8ch))
If you ls -al /dev/ds* you should see that /dev/dsp is a soft link to /dev/dsp0. I'm suprised that you only have one numbered dsp. Physically, do you have audio jacks? Does dmesg have other "hda" matches?

My last intel laptop had both SoC (system on chip) and a traditional sound chip. It's running Arch Linux and I had 2 alsa sound cards generated. I'm not sure where FreeBSD is with SoC drivers.
 
But I see that the link you recommended is for sound through HDMI. The problem is that I already can't get it to work "normally" without being connected to HDMI.
I see. I assumed you are looking for sound on the HDMI.

I understand from this link (https://github.com/freebsd/freebsd-src/blob/master/sys/dev/sound/pci/hda/hdac.h#L67) that the Intel High Definition Audio bridge device driver would supports the PCH version.
Check the device ID of the sound device on your PC if it matches with the defined in sys/dev/sound/pci/hda/hdac.h, run pciconf -lv | grep -B3 multimedia, look for device=. Eventually there will be multiple HD audio controller listed.
Rich (BB code):
     #define HDA_INTEL_PCH           HDA_MODEL_CONSTRUCT(INTEL, 0x3b56)
     #define HDA_INTEL_PCH2          HDA_MODEL_CONSTRUCT(INTEL, 0x3b57)
 
If you ls -al /dev/ds* you should see that /dev/dsp is a soft link to /dev/dsp0. I'm suprised that you only have one numbered dsp. Physically, do you have audio jacks? Does dmesg have other "hda" matches?
I am indeed surprised to see that I do not have a /dev/dsp link.
Code:
#  ls -al /dev/ds*
crw-rw-rw-  1 root  wheel  0x180 Nov 15 20:47 /dev/dsp0.0
Yes, I have a jack, but unfortunately I don't have sound either.
I have indeed two other lines but I confess I don't know what to do with them 😅:
Code:
# dmesg | grep hda
hdac0: <Intel Comet Lake-LP HDA Controller> mem 0xb1218000-0xb121bfff,0xb1000000-0xb10fffff at device 31.3 on pci0
hdacc0: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa0: <Intel Kaby Lake Audio Function Group>GEOM_ELI: Encryption: AES-XTS 256
 at nid 1 on hdacc0
pcm0: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa0

I see. I assumed you are looking for sound on the HDMI.
No, I'm sorry, I misspoke, I apologize.

Check the device ID of the sound device on your PC if it matches with the defined in sys/dev/sound/pci/hda/hdac.h, run pciconf -lv | grep -B3 multimedia, look for device=. Eventually there will be multiple HD audio controller listed.
Well apparently I was wrong about it being a PCH but it is a HDA_INTEL_CMLKLP which is also present in sys/dev/sound/pci/hda/hdac.h :
Code:
#  pciconf -lv | grep -B3 multimedia
hdac0@pci0:0:31:3:      class=0x040100 rev=0x00 hdr=0x00 vendor=0x8086 device=0x02c8 subvendor=0x1e39 subdevice=0xb993
    vendor     = 'Intel Corporation'
    device     = 'Comet Lake PCH-LP cAVS'
    class      = multimedia
 
No, I'm sorry, I misspoke, I apologize.
No problem at all.

I must also apologize. Focusing on the HDMI, it escaped me that there are no analog devices listed in the /dev/sndstat output from your post # 1, and I managed to subsequently missing that fact.

Have you checked with another OS the functionality of the analog sound system? If not, check the PC's UEFI/BIOS for audio settings.

If UEFi/BIOS settings are alright, it might be a bug because of missing pcm devices for the analog audio device.

snd_hda(4)
Rich (BB code):
BUGS
     Some Hardware/OEM vendors tend to screw up BIOS settings or use custom
     unusual CODEC wiring that create problems to the driver.  This may result
     in missing pcm devices, or a state where the snd_hda driver seems to
     attach and work, but no sound is played.  Some cases can be solved by
     tuning loader.conf variables.  But before trying to fix problem that way,
     make sure that there really is a problem and that the PCM audio device in
     use really corresponds to the expected audio connector.

     Some vendors use non-standardized General Purpose I/O (GPIO) pins of the
     codec to control external amplifiers.  In some cases setting a
     combination of GPIO bits may be needed to make sound work on a specific
     device.

     HDMI and DisplayPort audio may also require support from video driver.

Found some hardware probes listing the 'Intel Comet Lake PCH-LP':

Here a ThinkPad T14 dmesg excerpt:
Code:
hdac0: <Intel Comet Lake-LP HDA Controller> mem 0xef83c000-0xef83ffff,0xeea00000-0xeeafffff at device 31.3 on pci0
...
hdacc0: <Realtek ALC257 HDA CODEC> at cad 0 on hdac0
hdaa0: <Realtek ALC257 Audio Function Group> at nid 1 on hdacc0
pcm0: <Realtek ALC257 (Analog)> at nid 20 and 25 on hdaa0
pcm1: <Realtek ALC257 (Right Analog Headphones)> at nid 33 on hdaa0
hdacc1: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa1: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc1
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1

A ThinkPad E14:
Code:
hdac0: <Intel Comet Lake-LP HDA Controller> mem 0xc131c000-0xc131ffff,0xc1000000-0xc10fffff at device 31.3 on pci0
...
hdacc0: <Conexant (0x1f86) HDA CODEC> at cad 0 on hdac0
hdaa0: <Conexant (0x1f86) Audio Function Group> at nid 1 on hdacc0
pcm0: <Conexant (0x1f86) (Analog)> at nid 23 and 26 on hdaa0
pcm1: <Conexant (0x1f86) (Left Analog Headphones)> at nid 22 on hdaa0
hdacc1: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa1: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc1
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> at nid 3 on hdaa1

A Intel NUC, also missing pcm devices:
Code:
hdac0: <Intel Comet Lake-LP HDA Controller> mem 0x6023110000-0x6023113fff,0x6023000000-0x60230fffff at device 31.3 on pci0
...
hdacc0: <Intel Kaby Lake HDA CODEC> at cad 2 on hdac0
hdaa0: <Intel Kaby Lake Audio Function Group> at nid 1 on hdacc0

In case UEFI/BIOS settings don't resolve the issue, I suggest you open a bug report to address the problem to a FreeBSD developer familiar with the systems sound infrastructure. It's more likely to get their attention there than here in forums.
 
I noticed that you loaded snd_hda in /boot/loader.conf. This is no longer necessary as snd_hda is statically built into the default kernel Did you enable i915kms in /etc/rc.conf?
I have unloaded snd_hda and have this line kld_list="fusefs i915kms" in /etc/rc.conf.

In case UEFI/BIOS settings don't resolve the issue, I suggest you open a bug report to address the problem to a FreeBSD developer familiar with the systems sound infrastructure. It's more likely to get their attention there than here in forums.
I will indeed try to open a ticket, thank you very much for your advice.
 
Hi Moli ,

The intel_hda driver depends on some preconfigured "associations" set by BIOS to determine which sound devices to create in `/dev/sndstat`.

It is likely that your particularly computer (the physical box with the motherboard) has poorly-configured audio defaults.

I would suggest running this command (non-root):

$ sysctl dev.hdaa.0

This will dump all the 'nodes' that your audio driver sees, some of which may be analog output devices.

From there, you will need to set the associations of your analog devices that are not showing up to appropriate values so that audio devices are created for them. See snd_hda() for more details.

If you are having trouble with this, run the command and attach the output here.

I should write a guide for doing this on the wiki at some point...
 
Hi Partmedia ,

Thank you very much for your help. From what I understand I have the impression that the pin configuration for my audio output (dev.hdaa.0.nid2) is missing.

Indeed, here is the output of sysctl dev.hdaa.0 :
Code:
$ sysctl dev.hdaa.0
dev.hdaa.0.init_clear: 0
dev.hdaa.0.reconfig: 0
dev.hdaa.0.gpo_config:  
dev.hdaa.0.gpo_state:  
dev.hdaa.0.gpio_config:  
dev.hdaa.0.gpio_state:  
dev.hdaa.0.gpi_state:  
dev.hdaa.0.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.0.nid3_original: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid3_config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid3: pin: Digital-out (Jack)
     Widget cap: 0x0040778d PWR DIGITAL UNSOL 8CH
    Association: 0 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000040 OUT
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + <- nid=2 [audio output]

dev.hdaa.0.nid2: audio output
     Widget cap: 0x00006611 PWR DIGITAL 8CH
    Association: 0 (0x0001)
            OSS: pcm (pcm)
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x001a07f0 16 24 32 bits, 32 44 48 88 96 176 192 KHz

dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x80860101
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: Intel Kaby Lake Audio Function Group

When I do sysctl dev.hdaa.0.nid3_config (from what I understand, the jack output, which does not work either, despite the fact that the association number of the pin is different from 0, so maybe I don't understand anything at all... 😅 ), I get :
Code:
$ sysctl dev.hdaa.0.nid3_config
dev.hdaa.0.nid3_config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0

But when I do sysctl dev.hdaa.0.nid2_config, it tells me that the oid does not exist:
Code:
$ sysctl dev.hdaa.0.nid2_config
sysctl: unknown oid 'dev.hdaa.0.nid2_config'
 
Hi Partmedia ,

Thank you very much for your help. From what I understand I have the impression that the pin configuration for my audio output (dev.hdaa.0.nid2) is missing.

Indeed, here is the output of sysctl dev.hdaa.0 :
Code:
$ sysctl dev.hdaa.0
dev.hdaa.0.init_clear: 0
dev.hdaa.0.reconfig: 0
dev.hdaa.0.gpo_config: 
dev.hdaa.0.gpo_state: 
dev.hdaa.0.gpio_config: 
dev.hdaa.0.gpio_state: 
dev.hdaa.0.gpi_state: 
dev.hdaa.0.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.0.nid3_original: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid3_config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.0.nid3: pin: Digital-out (Jack)
     Widget cap: 0x0040778d PWR DIGITAL UNSOL 8CH
    Association: 0 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0
    Pin control: 0x00000040 OUT
     Output amp: 0x80000000 mute=1 step=0 size=0 offset=0 (0/0dB)
    Connections: 1
          + <- nid=2 [audio output]

dev.hdaa.0.nid2: audio output
     Widget cap: 0x00006611 PWR DIGITAL 8CH
    Association: 0 (0x0001)
            OSS: pcm (pcm)
     Stream cap: 0x00000005 AC3 PCM
        PCM cap: 0x001a07f0 16 24 32 bits, 32 44 48 88 96 176 192 KHz

dev.hdaa.0.%parent: hdacc0
dev.hdaa.0.%pnpinfo: type=0x01 subsystem=0x80860101
dev.hdaa.0.%location: nid=1
dev.hdaa.0.%driver: hdaa
dev.hdaa.0.%desc: Intel Kaby Lake Audio Function Group

When I do sysctl dev.hdaa.0.nid3_config (from what I understand, the jack output, which does not work either, despite the fact that the association number of the pin is different from 0, so maybe I don't understand anything at all... 😅 ), I get :
Code:
$ sysctl dev.hdaa.0.nid3_config
dev.hdaa.0.nid3_config: 0x18560020 as=2 seq=0 device=Digital-out conn=Jack ctype=Digital loc=0x18 color=Unknown misc=0

But when I do sysctl dev.hdaa.0.nid2_config, it tells me that the oid does not exist:
Code:
$ sysctl dev.hdaa.0.nid2_config
sysctl: unknown oid 'dev.hdaa.0.nid2_config'
Did you ever get this year old problem fixed? i'm on a chromebook with the same output everything as you have when you first opened this thread and i'm hoping there will be a fix one day. I've installed other distro's but keep coming back to freebsd in hopes it works
 
Back
Top