Can't direct sound to the HDMI TV, that was easily doable on both Windows and Linux

So I have an Dell Inspiron 15 7559, FreeBSD 14.2 release. With i7 6770hq and Nvidia GTX960M. So, I use a secondary screen with HDMI, this monitor has built-in speakers. But can't route the sound to there. I route to HDMI, then there is no sound. Sound on the laptop works although.
Mind you that on Linux this worked well.
 
You need to give us more information.

Dell Inspiron 15 7559, FreeBSD 14.2 release. With i7 6770hq and Nvidia GTX960M

Just to make sure, which graphics device models are those exactly?
Code:
 # pciconf -lv | grep -B 3 display

Which graphics driver are loaded?
Code:
 # kldstat

From where is/are the graphics driver from? From ports or pkg (regular quarterly/latest or FreeBSD-kmods?)?

Which sound devices are created?
Code:
 # cat /dev/sndstat

 # dmesg | grep pcm

Show sound card pin configuration (output is shown in dmesg(8), /var/log/messages eof, system console /dev/ttyv0)
Code:
 # sysctl dev.hdac.0.pindump=1
 
Ok I did what you said:
Code:
kriptomahsun@kriptomahsun-freebsd ~>

                       pciconf -lv | grep -B 3 display


vgapci1@pci0:0:2:0:    class=0x030000 rev=0x06 hdr=0x00 vendor=0x8086 device=0x191b subvendor=0x1028 subdevice=0x0706
    vendor     = 'Intel Corporation'
    device     = 'HD Graphics 530'
    class      = display
--
vgapci0@pci0:2:0:0:    class=0x030200 rev=0xa2 hdr=0x00 vendor=0x10de device=0x139b subvendor=0x1028 subdevice=0x0706
    vendor     = 'NVIDIA Corporation'
    device     = 'GM107M [GeForce GTX 960M]'
    class      = display
kriptomahsun@kriptomahsun-freebsd ~> kldstat
Id Refs Address                Size Name
 1  162 0xffffffff80200000  295a408 kernel
 2    1 0xffffffff82b5b000   5dc658 zfs.ko
 3    1 0xffffffff83138000    1c5e8 geom_eli.ko
 4    1 0xffffffff83be5000     73c0 linprocfs.ko
 5    6 0xffffffff83bed000     c2a8 linux_common.ko
 6    1 0xffffffff83bfa000     440c linsysfs.ko
 7    1 0xffffffff83bff000     3560 fdescfs.ko
 8    3 0xffffffff83c03000    30a80 linux.ko
 9    1 0xffffffff83c34000    2de10 linux64.ko
10    1 0xffffffff83c62000     6760 cuse.ko
11    1 0xffffffff83c69000    12e18 fusefs.ko
12    1 0xffffffff83c7c000     21e8 hgame.ko
13    2 0xffffffff83c7f000     30a8 hidmap.ko
14    1 0xffffffff83c83000   1e2228 i915kms.ko
15    2 0xffffffff83e66000    85090 drm.ko
16    1 0xffffffff83eec000     22b8 iic.ko
17    2 0xffffffff83eef000     4120 linuxkpi_video.ko
18    3 0xffffffff83ef4000     7350 dmabuf.ko
19    3 0xffffffff83efc000     3378 lindebugfs.ko
20    1 0xffffffff83f00000     c338 ttm.ko
21    1 0xffffffff83f0d000   126678 nvidia-modeset.ko
22    1 0xffffffff84200000  314e420 nvidia.ko
23    1 0xffffffff84034000     2278 pty.ko
24    1 0xffffffff84037000     3390 acpi_wmi.ko
25    1 0xffffffff8403b000     4250 ichsmb.ko
26    1 0xffffffff84040000     2178 smbus.ko
27    1 0xffffffff84043000    96260 if_iwlwifi.ko
28    1 0xffffffff840da000    17314 if_iwm.ko
29    1 0xffffffff840f2000     3218 iichid.ko
30    1 0xffffffff840f6000     2110 pchtherm.ko
31    1 0xffffffff840f9000     d200 rtsx.ko
32    1 0xffffffff84107000     4d64 geom_uzip.ko
33    1 0xffffffff8410c000     2140 msdosfs_iconv.ko
34    1 0xffffffff8410f000     4810 libiconv.ko
35    1 0xffffffff84114000     4364 ums.ko
36    1 0xffffffff84119000     4d20 ng_ubt.ko
37    3 0xffffffff8411e000     abb8 netgraph.ko
38    2 0xffffffff84129000     a250 ng_hci.ko
39    2 0xffffffff84134000     2670 ng_bluetooth.ko
40    1 0xffffffff84137000     21e8 hms.ko
41    1 0xffffffff8413a000     3355 hmt.ko
42    1 0xffffffff8413e000     22cc hconf.ko
43    1 0xffffffff84141000    27450 ipfw.ko
44    1 0xffffffff84169000     2a68 mac_ntpd.ko
kriptomahsun@kriptomahsun-freebsd ~> cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC256 (Internal Analog)> (play/rec) default
pcm1: <Realtek ALC256 (Front Analog Headphones)> (play)
pcm2: <Intel Skylake (HDMI/DP 8ch)> (play)
No devices installed from userspace.
kriptomahsun@kriptomahsun-freebsd ~> dmesg | grep pcm
kriptomahsun@kriptomahsun-freebsd ~ [0|1]> dmesg | grep pcm
kriptomahsun@kriptomahsun-freebsd ~ [0|1]> sysctl dev.hdac.0.pindump=1
dev.hdac.0.pindump: 0
sysctl: dev.hdac.0.pindump=1: Operation not permitted
kriptomahsun@kriptomahsun-freebsd ~ [1]> sysctl dev.hdac.0.pindump=0
dev.hdac.0.pindump: 0
sysctl: dev.hdac.0.pindump=0: Operation not permitted
kriptomahsun@kriptomahsun-freebsd ~ [1]> sysctl dev.hdac.0.pindump=2
dev.hdac.0.pindump: 0
sysctl: dev.hdac.0.pindump=2: Operation not permitted
kriptomahsun@kriptomahsun-freebsd ~ [1]> sysctl dev.hdac.0.pindump=3
dev.hdac.0.pindump: 0
sysctl: dev.hdac.0.pindump=3: Operation not permitted
kriptomahsun@kriptomahsun-freebsd ~ [1]> sysctl dev.hdac.1.pindump=1
sysctl: unknown oid 'dev.hdac.1.pindump'
kriptomahsun@kriptomahsun-freebsd ~ [1]> sysctl dev.hdac.2.pindump=1
sysctl: unknown oid 'dev.hdac.2.pindump'
 
When you say

do you mean sysctl hw.snd.default_unit=2

If this is the case, run sysctl dev.hdac.[B]2[/B].pindump=1
It all says this:
Code:
kriptomahsun@kriptomahsun-ghostbsd ~> sysctl dev.hdac.2.pindump=1


sysctl: unknown oid 'dev.hdac.2.pindump'


kriptomahsun@kriptomahsun-ghostbsd ~ [1]> sysctl dev.hdac.2.pindump=0


sysctl: unknown oid 'dev.hdac.2.pindump'


kriptomahsun@kriptomahsun-ghostbsd ~ [1]> sysctl dev.hdac.2.pindump=2


sysctl: unknown oid 'dev.hdac.2.pindump'


kriptomahsun@kriptomahsun-ghostbsd ~ [1]> cat /dev/sndstat


Installed devices:


pcm0: <Realtek ALC256 (Internal Analog)> (play/rec) default


pcm1: <Realtek ALC256 (Front Analog Headphones)> (play)


pcm2: <Intel Skylake (HDMI/DP 8ch)> (play)


No devices installed from userspace.
 
It all says this:
Code:
kriptomahsun@kriptomahsun-ghostbsd ~> sysctl dev.hdac.2.pindump=1


sysctl: unknown oid 'dev.hdac.2.pindump'


kriptomahsun@kriptomahsun-ghostbsd ~ [1]> sysctl dev.hdac.2.pindump=0


sysctl: unknown oid 'dev.hdac.2.pindump'


kriptomahsun@kriptomahsun-ghostbsd ~ [1]> sysctl dev.hdac.2.pindump=2


sysctl: unknown oid 'dev.hdac.2.pindump'


kriptomahsun@kriptomahsun-ghostbsd ~ [1]> cat /dev/sndstat


Installed devices:


pcm0: <Realtek ALC256 (Internal Analog)> (play/rec) default


pcm1: <Realtek ALC256 (Front Analog Headphones)> (play)


pcm2: <Intel Skylake (HDMI/DP 8ch)> (play)


No devices installed from userspace.
You didn't answer the question though. Typically you would have to set the usb device as default and set to not automatically change devices in your rc.conf file. You also have to make sure your non-root user has permissions to run them. How did you set your audio up?
 
Hi kriptomahsun, could you please confirm you have tried sysctl hw.snd.default_unit=2 (execute command as root user or normal user with sudo).

Unit "2" is pcm2: <Intel Skylake (HDMI/DP 8ch)> (play)

According to cat /dev/sndstat you showed, the default unit shows as pcm0: <Realtek ALC256 (Internal Analog)> (play/rec) default.


Please try dmesg | grep pcm again. This should show some output. Make sure i915kms is loaded.

Example:
Code:
% dmesg | grep pcm
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
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:
Welcome to fish, the friendly interactive shell

Type help for instructions on how to use fish

kriptomahsun@kriptomahsun-ghostbsd ~> sysctl hw.snd.default_unit=2

hw.snd.default_unit: 0 -> 2

kriptomahsun@kriptomahsun-ghostbsd ~> dmesg | grep pcm

pcm0: <Realtek ALC256 (Internal Analog)> at nid 20 and 18 on hdaa0

pcm1: <Realtek ALC256 (Front Analog Headphones)> at nid 33 on hdaa0

pcm2: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1

kriptomahsun@kriptomahsun-ghostbsd ~> kldstat| grep i915

14    1 0xffffffff84297000   1e2228 i915kms.ko

kriptomahsun@kriptomahsun-ghostbsd ~>
 
I have only just noticed you are running GhostBSD. Normally it's not supported here.
kriptomahsun@kriptomahsun-ghostbsd

But I believe, in this case, the underlying issue isn't different from a vanilla FreeBSD.

After sysctl hw.snd.default_unit=2 have you tried to play a audio, video file from a media player? Make sure to boot the system with the HDMI cable plugged in.
 
As the original poster, you can mark the thread solved, if you wish. Go to edit the opening post and there's a drop down box where you can change the prefix to read SOLVED.
 
As the original poster, you can mark the thread solved, if you wish. Go to edit the opening post and there's a drop down box where you can change the prefix to read SOLVED.
Actually no it was not solved, the laptop has Intel CPU and Nvidia GPU. I forgot to install the nvidia driver before. So it was working on the iGPU of the CPU. Which was what made the HDMI sound work. But now I installed the nvidia-driver and it doesn't work again..
 
But now I installed the nvidia-driver and it doesn't work again..
It's going to be a different output. Each HDMI connector has it's own pcm device attached. So try different outputs by setting hw.snd.default_unit.
 
Back
Top