Bug 237340 - Unable to make HDMI sound works with HD630
Summary: Unable to make HDMI sound works with HD630
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: 12.0-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: freebsd-multimedia mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-17 17:14 UTC by Emrion
Modified: 2019-08-24 17:55 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Emrion 2019-04-17 17:14:19 UTC
I can't make the sound pass thru HDMI port. The involved hardware is: motherboard Asus H170I-PRO with embedded sound card Realtek ALC887 + processor i3 7100T (Kabylake). The graphic card used is the HD630 from the i3.

Two hdaa devices are detected (ALC887: hdaa0 and Intel Kabylake audio: hdaa1). At the base, there isn't any listed HDMI device:

------------------
$ 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)
pcm3: <Realtek ALC887 (Rear Digital)> (play)
------------------

I tried to select each of the pcm devices (hw.snd.default_unit=...) but I got no sound from HDMI.

It's possible to make an HDMI device appear by adding hint.hdaa.1.nid3.config="conn=jack" (or "conn=Fixed") in /boot/device.hints:

------------------
$ cat /dev/sndstat
FreeBSD Audio Driver (64bit 2009061500/amd64)
Installed devices:
pcm0: <Realtek ALC887 (Rear Analog)> on hdaa0 (1p:1v/1r:1v)
pcm1: <Realtek ALC887 (Front Analog)> on hdaa0 (1p:1v/1r:1v)
pcm2: <Realtek ALC887 (Internal Digital)> on hdaa0 (1p:1v/0r:0v)
pcm3: <Realtek ALC887 (Rear Digital)> on hdaa0 (1p:1v/0r:0v)
pcm4: <Intel Kabylake (HDMI/DP 8ch)> on hdaa1 (1p:1v/0r:0v) default
------------------

But selecting this device does not bring sound to HDMI.

I ain't sure this is a bug but I don't see what I can do more to make it works. I tried many things and now I wonder if it's not a driver bug.

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.

For information:

------------------
$ sysctl dev.hdaa.1
dev.hdaa.1.reconfig: 0
dev.hdaa.1.gpo_config: 
dev.hdaa.1.gpo_state: 
dev.hdaa.1.gpio_config: 
dev.hdaa.1.gpio_state: 
dev.hdaa.1.gpi_state: 
dev.hdaa.1.config: forcestereo,ivref50,ivref80,ivref100,ivref,vref
dev.hdaa.1.nid3_original: 0x58560010 as=1 seq=0 device=Digital-out conn=None ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.1.nid3_config: 0x98560010 as=1 seq=0 device=Digital-out conn=Fixed ctype=Digital loc=0x18 color=Unknown misc=0
dev.hdaa.1.nid3: pin: Digital-out (Fixed)
     Widget cap: 0x0040778d PWR DIGITAL UNSOL 8CH
    Association: 0 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x98560010 as=1 seq=0 device=Digital-out conn=Fixed 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.1.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.1.%parent: hdacc1
dev.hdaa.1.%pnpinfo: type=0x01 subsystem=0x80860101
dev.hdaa.1.%location: nid=1
dev.hdaa.1.%driver: hdaa
dev.hdaa.1.%desc: Intel Kabylake Audio Function Group
------------------

Note: the conn of nid3 has been changed in device.hints. Normally, it's conn=None.
Comment 1 Emrion 2019-04-27 09:49:49 UTC
Noone is interested with this issue? Noone is experiencing the same?
Comment 2 Hans Petter Selasky freebsd_committer 2019-04-27 10:21:11 UTC
With my computer HDMI needed to be connected during boot, before it would allow me to playback audio through HDMI.
Comment 3 Emrion 2019-04-27 10:41:18 UTC
(In reply to Hans Petter Selasky from comment #2)
Thanks for your reply. What do you mean by "during boot"? You have to plug the hmdi cord after the power on?

I always started the PC while the HDMI is already pluged. As it should be, no?
Comment 4 Hans Petter Selasky freebsd_committer 2019-04-27 11:05:37 UTC
What graphics driver are you using?

--HPS
Comment 5 Emrion 2019-04-27 13:09:27 UTC
(In reply to Hans Petter Selasky from comment #4)
The drm drivers:

-----
$ pkg info | grep drm
drm-fbsd12.0-kmod-4.16.g20190305 DRM modules for the linuxkpi-based KMS components
drm-kmod-g20181126             Metaport of DRM modules for the linuxkpi-based KMS components
libdrm-2.4.96,1                Userspace interface to kernel Direct Rendering Module services
-----

There are some errors in dmesg:

-----
[drm] Unable to create a private tmpfs mount, hugepage support will be disabled(-19).                                                                             
Failed to add WC MTRR for [0xe0000000-0xefffffff]: -22; performance may suffer
-----

And sometimes:

-----
hdacc1: Unexpected unsolicited response with tag 63: ffffffff
-----
Comment 6 Emrion 2019-05-01 09:52:17 UTC
By the way, I just realised that the video rendering is somewhat bad (tearing). I think that the drm-kmod drivers aren't up to date enough to well use the HD630.
Comment 7 Steve Wills freebsd_committer 2019-05-01 11:20:58 UTC
(In reply to Emrion from comment #6)

The tearing may be due to the driver setting, you might want to try:

   Option "TearFree" "true"
Comment 8 Emrion 2019-05-01 13:40:15 UTC
(In reply to Steve Wills from comment #7)
I tried that (from X -configure and added in xorg.conf.d folder):
----
Section "Device"
        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz",
        ### <percent>: "<f>%"
        ### [arg]: arg optional
        #Option     "SWcursor"                  # [<bool>]
        #Option     "kmsdev"                    # <str>
        #Option     "ShadowFB"                  # [<bool>]
        #Option     "AccelMethod"               # <str>
        #Option     "PageFlip"                  # [<bool>]
        #Option     "ZaphodHeads"               # <str>
        Identifier  "Card0"                                     
        Driver      "modesetting"
        BusID       "PCI:0:2:0"
        Option "TearFree" "true"
EndSection
----
It doesn't work.
Comment 9 alfredoFALK 2019-08-20 07:56:19 UTC
Hi,
I also have this problem/bug on my ASUS H110T. I run 4 operating systems on different hdd/sdd on this machine: Manjaro,Win10,macOS and freeBSD as TridentOS.
All OS have a working HDMI sound connection except freeBSD.
Here are the two outputs from the standard commands requested by other websites or forums :
--------------------------------------------------------
cat /dev/sndstat:trident-3675% cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC887 (Analog)> (play/rec)
pcm1: <Realtek ALC887 (Analog)> (play/rec)
pcm2: <Intel Kaby Lake (HDMI/DP 8ch)> (play) default
No devices installed from userspace.
-----------------------------------------------------------------------------
sysctl -a | grep snd.default: hw.snd.default_unit: 2
hw.snd.default_auto: 0
------------------------------------------------------------------------------
mixer
Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to  74:74
Mixer line     is currently set to   1:1
Mixer mic      is currently set to  67:67
Mixer mix      is currently set to  74:74
Mixer rec      is currently set to  35:35
Mixer igain    is currently set to   0:0
----------------------------------------------------------------------------


  To get to this situation I did exactly the devices.hints line mentioned by @Emrion on this bug report.
Nobody has a solution and it looks to me that the BSD community of developers has no intention to find a solution! openBSD has definitely stated they are not developing HDMI and freeBSD seems to feel the same!
Maybe somebody can prove me wrong! 
This bug has been dormant since May 2019, so my feeling is nobody is dealing with it.
Thanks to anybody who can give some help with this issue!
Comment 10 alfredoFALK 2019-08-24 17:55:21 UTC
Hi, I gather that nobody is following or looking after this bug.
Here is my latest attempt to get it to work:
 sysctl hw.snd.default_unit=2
hw.snd.default_unit: 0 -> 2

 # sysctl dev.hdaa.1.nid3
dev.hdaa.1.nid3: pin: Digital-out (Fixed)
     Widget cap: 0x0040778d PWR DIGITAL UNSOL 8CH
    Association: 0 (0x0001)
        Pin cap: 0x09000094 PDC OUT HDMI DP HBR
     Pin config: 0x98560010 as=1 seq=0 device=Digital-out conn=Fixed 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]

 # sysctl dev.hdaa.1.nid2
dev.hdaa.1.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


In /boots/devices.hints I added 
hint.hdaa.1.nid3.config="conn=Fixed"
hint.hdaa.1.nid2.config="mute=0"
hint.hdaa.1.nid1.config="conn=jack"


No sound through HDMI at all. Useless effort.
I wonder how many users of freebsd actually use a TV with HDMI as monitor. It seems that nobody cares!!