# Audio through HDMI not working with "Intel HD Graphics 530"



## Xou (Nov 9, 2022)

*Intro:*
Yesterday, I've installed FreeBSD with GNOME and I setup most of the drivers... *everything seems to work pretty fine* so far (_4k video, programs, etc.), _*except from* one thing: *Audio through HDMI. 

Issue:*
Audio through HDMI does not seem to work.

*Details:*
I have already installed x11-drivers/xf86-video-intel, x11-drivers/xf86-video-scfb and graphics/drm-kmod

```
CPU: 8-core Intel Core i7-6700 (-MCP-) speed: 3400 MHz
OS: FreeBSD 13.1-RELEASE amd64 Up: 58m Mem: 6145.6/8021.9 MiB (76.6)
Storage: 664.55 GiB (1.3% used) Procs: 148 Shell: sh inxi: 3.3.11
```


```
$ cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC887 (Rear Analog)> (play/rec) default
pcm1: <Realtek ALC887 (Front Analog)> (play/rec)
pcm2: <Realtek ALC887 (Internal Digital)> (play)
No devices installed from userspace.
```


```
$ cat /etc/rc.conf
clear_tmp_enable="YES"
hostname="freebsd"
keymap="gr.101.acc.kbd"
sshd_enable="YES"
moused_enable="YES"
ntpd_enable="YES"
powerd_enable="YES"
dumpdev="AUTO"
zfs_enable="YES"
ifconfig_em0="DHCP"
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
gnome_enable="YES"
dbus_enable="YES"
hald_enable="YES"
gdm_enable="YES"
defaultrouter="192.168.2.1"
```


```
$ cat /boot/loader.conf
aesni_load="YES"
geom_eli_load="YES"
kern.geom.label.disk_ident.enable="0"
kern.geom.label.gptid.enable="0"
cryptodev_load="YES"
zfs_load="YES"
kern.vty=vt
if_rtwn_pci_load="YES"
if_rtwn_usb_load="YES"
legal.realtek.license_ack=1
snd_driver_load="YES"
```

*Outro:*
Although I've tried many things, couldn't figure it out, any Idea?

*PS.* _Please have in mind, that I'm a noob and way too new to FreeBSD. | (found this too)
Thanks in Advance._


----------



## Xou (Nov 9, 2022)

In /boots/devices.hints I added

```
hint.hdaa.1.nid3.config="conn=Fixed"
hint.hdaa.1.nid1.config="conn=jack"
```
And now it shows the device_(?)_, but no sound yet:

```
cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC887 (Rear Analog)> (play/rec)
pcm1: <Realtek ALC887 (Front Analog)> (play/rec)
pcm2: <Realtek ALC887 (Internal Digital)> (play)
pcm3: <Intel Skylake (HDMI/DP 8ch)> (play) default
No devices installed from userspace.
```


----------



## facedebouc (Nov 10, 2022)

`# sysctl hw.snd.default_unit=3`
and to get it persistent across reboot put it in /etc/sysctl.conf.


----------



## T-Daemon (Nov 10, 2022)

Xou said:


> I have already installed ... graphics/drm-kmod





Xou said:


> $ cat /etc/rc.conf



I don't see in your /etc/rc.conf the Intel kernel driver enabled. The driver is needed to get HDMI sound (and accelerated video).

Enable `i915kms` in /etc/rc.conf and put the user in the "video" group (as root `pw groupmod video -m <user>`, reboot system.

`pkg info -D drm-510-kmod`

```
On install:
*The drm-510-kmod port can be enabled *for amdgpu (for AMD
GPUs starting with the HD7000 series / Tahiti) or *i915kms (for Intel
APUs starting with HD3000 / Sandy Bridge) through kld_list in
/etc/rc.conf*. radeonkms for older AMD GPUs can be loaded and there are
some positive reports if EFI boot is NOT enabled (similar to amdgpu).

For amdgpu: kld_list="amdgpu"
For Intel: *kld_list="i915kms"*
For radeonkms: kld_list="radeonkms"

*Please ensure that all users requiring graphics are members of the
"video" group.*
```


----------



## Xou (Nov 10, 2022)

```
$ id xou
uid=1001(xou) gid=1001(xou) groups=1001(xou),44(video)
```


```
$ cat /etc/sysctl.conf
...
kern.randompid=1
vfs.zfs.min_auto_ashift=12
hw.snd.default_unit=3
```


```
$ cat /etc/rc.conf
...
kld_list="i915kms"
```

Still, audio through HDMI doesn't seem to work


----------



## facedebouc (Nov 10, 2022)

Did you play with mixer(8) ? Can you post mixer output ?


----------



## Xou (Nov 10, 2022)

```
$ mixer
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
```
I did also try,  what was mentioned here, but still nothing _(Which I don't really know if that makes any sense at all but yeah...)_:


> In the BIOS setting, there is a "SDIF out type" parameter which can be set either at "SPDIF" or "HDMI". In both cases, there is no change.


_BTW, Audio jack works but has a constant weird white-noise_


----------



## T-Daemon (Nov 10, 2022)

It looks like the problem is related to the Intel High Definition Audio (Controller) driver ( /usr/src/sys/dev/sound/pci/hda/hdac.c ).








						No sound over HDMI · Issue #187 · freebsd/drm-kmod
					

No sound over HDMI FreeBSD bsd 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64 cat /etc/rc.conf hostname="bsd" wlans_iwm0="wlan0" ifconfig_wlan0=...




					github.com
				




There is a patch to try:








						No sound over HDMI · Issue #187 · freebsd/drm-kmod
					

No sound over HDMI FreeBSD bsd 13.1-RELEASE FreeBSD 13.1-RELEASE releng/13.1-n250148-fc952ac2212 GENERIC amd64 cat /etc/rc.conf hostname="bsd" wlans_iwm0="wlan0" ifconfig_wlan0=...




					github.com
				




Also note the comment after the patch comment.


----------



## Xou (Nov 10, 2022)

T-Daemon said:


> It looks like the problem is related to the Intel High Definition Audio (Controller) driver ( /usr/src/sys/dev/sound/pci/hda/hdac.c ).
> 
> 
> 
> ...


I'm guessing the same too, I've patched the source code under  "/usr/src/sys/dev/sound/pci/hda/hdac.c", but now I don't know how to build it and install the new drivers...  Should i CD to  "/usr/src/sys/" and run "make install CSDOPEDIRS= dev" or am i missing something? _I'm pretty noob at those stuff but i'm willing to try_


----------



## Xou (Nov 10, 2022)

Zarghoon said:


> Check your hdmi wire or maybe driver issues with display board


How do i check for driver issues?  _(hdmi works fine, tested on windows too)_


----------



## Xou (Nov 10, 2022)

Something I'd like to repeat is that, while the audio-jack works, it has a constant weird white-noise for some reason _(something that it is not present in other OSs)

(Update: just found out what the noise was, i accidentally had the input loop to the output )_


----------



## T-Daemon (Nov 11, 2022)

Xou said:


> I've patched the source code under "/usr/src/sys/dev/sound/pci/hda/hdac.c", but now I don't know how to build it and install the new drivers...


Build and install a new kernel.

The patched hdac.c (HDA bus controller) driver is included in the snd_hda(4) driver, which is compiled into the GENERIC kernel. 

snd_hda(4)

```
DESCRIPTION
     ...
     *The snd_hda driver includes HDA bus controller driver (hdac)*, HDA codec
     driver (hdacc) and HDA codecs audio functions bridge driver (hdaa) that
     allows the generic audio driver, sound(4), to be used with this hardware.
     Only audio functions are supported by snd_hda. ...
```

/usr/src/sys/amd64/conf/GENERIC

```
# Sound support
...
device          snd_hda                 # Intel High Definition Audio
```

In case you are unfamiliar building/installing a kernel see handbook, chapter 25.6. Updating FreeBSD from Source.


----------



## gnath (Nov 11, 2022)

My experience for HDMI may help.


----------



## Xou (Nov 11, 2022)

Found an old sound-system that works through audio jack _(and has way better audio than TV's ones)_, So I might come back to the issue some other time... as of now I'm cool with it. PS. Thank you all for you help so far <3


----------



## shepper (Nov 16, 2022)

I noticed in your 1st post in this thread that you loaded all the sound drivers


Spoiler



snd_driver_load="YES"


snd_hda is now statically complied into the default kernel.


----------



## tingo (Nov 20, 2022)

In which case nothing happens; FreeBSD is smart enough to not load a kernel module twice.


----------

