Open MATPOCKuH opened 6 years ago
I will be honest, I am not sure we have ever tried sound via HDMI in the new DRM. Odds are, there may be something missing from the linuxkpi, so it could be interesting to check dmesg and see if there is debug output.
I'm not found any messages related to sound via hdmi. Can You provide how to collect debug output?
I just tested with drm-next 4.9 and not getting any sound through DP -> HDMI output on Skylake with iGPU. I am getting a lot of errors regarding the sound chip though (generally, not only when trying to use it)
hdacc1: Unexpected unsolicited response with tag 63: ffffffff
I don't think this is something that has ever been prioritized on drm-next but would be nice if we can get it to work.
Yes, but you might need to boot with HDMI plugged in.
Still same for me.
The value "ffffffff" might indicate some GPIO is not properly configured.
I updated FreeBSD to r328273 and port to drm-next-kmod-g20180117, but problem still exists.
PS. Just FYI: on my i915 box (Celeron N3160) sound via HDMI works properly.
I also have no audio over Displayport using pcm3: <Intel Skylake (HDMI/DP 8ch)> at nid 3 on hdaa1
on my hardware.
I will try and do some digging and see if something is missing in linuxkpi, or if things need to be wired up. I would love to have audio of DP. If anyone knows the best place to start, I can start looking there, thanks!
Same here. I usually use DP but have no sound in either HDMI or DP outputs. @papertigers Do you get any error output to dmesg like I do? (see above) If so that might be a place to start.
@papertigers, @iotamudelta and @johalun , please check sysctl dev.hdac.0.polling I'm got working sound (via 3.5mm jack too) only after I set dev.hdac.0.polling to 1.
No luck with that :( Maybe it's some pin configuration. Realtek sound works great (built in speaker and jack, with auto switching).
@johalun yeah when I boot with verbose I see those log lines as well.
@MATPOCKuH I tried changing polling to 1 and I still have no sound.
I also experience the same problem with radeonkms. I suspect that, at least in my case, the problem could be caused by incorrect retrieval of EDID:
[ 9616.484] (II) RADEON(0): 00ffffffffffff004c2d090501000000
[ 9616.484] (II) RADEON(0): 30120103801009780aee91a3544c9926
[ 9616.484] (II) RADEON(0): 0f5054bdef80714f8100814081809500
[ 9616.484] (II) RADEON(0): 950fb3000101023a801871382d40582c
[ 9616.484] (II) RADEON(0): 4500a05a0000001e662150b051001b30
[ 9616.484] (II) RADEON(0): 40703600a05a0000001e000000fd0018
[ 9616.484] (II) RADEON(0): 4b1a5117000a202020202020000000fc
[ 9616.484] (II) RADEON(0): 0053414d53554e470a2020202020016f
[ 9616.484] (II) RADEON(0): 00ffffffffffff004c2d090501000000
[ 9616.484] (II) RADEON(0): 30120103801009780aee91a3544c9926
[ 9616.484] (II) RADEON(0): 0f5054bdef80714f8100814081809500
[ 9616.484] (II) RADEON(0): 950fb3000101023a801871382d40582c
[ 9616.484] (II) RADEON(0): 4500a05a0000001e662150b051001b30
[ 9616.484] (II) RADEON(0): 40703600a05a0000001e000000fd0018
[ 9616.484] (II) RADEON(0): 4b1a5117000a202020202020000000fc
[ 9616.484] (II) RADEON(0): 0053414d53554e470a2020202020016f
Please note how the reported EDID consists of two parts with the same data. If I understand correctly, the standard EDID has 128 bytes and the byte next to the last specifies the number of extensions. In this case it is one. But instead of the extension the following block has the same bytes as the first block. I guess that the extension block, if read correctly, would describe HDMI audio capabilities.
Just to add some data on the intel side. I swapped my intel NUC to Linux and still had no sound. However, a bios update that went from a 2016->2018 build fixed things. I have not gone back and tested on FreeBSD again.
Same information with the in-tree driver:
[ 82.356] (II) RADEON(0): 00ffffffffffff004c2d090501000000
[ 82.356] (II) RADEON(0): 30120103801009780aee91a3544c9926
[ 82.356] (II) RADEON(0): 0f5054bdef80714f8100814081809500
[ 82.356] (II) RADEON(0): 950fb3000101023a801871382d40582c
[ 82.356] (II) RADEON(0): 4500a05a0000001e662150b051001b30
[ 82.356] (II) RADEON(0): 40703600a05a0000001e000000fd0018
[ 82.356] (II) RADEON(0): 4b1a5117000a202020202020000000fc
[ 82.356] (II) RADEON(0): 0053414d53554e470a2020202020016f
[ 82.356] (II) RADEON(0): 020327f14b901f041305140312202122
[ 82.356] (II) RADEON(0): 2309070783010000e2000fe305030167
[ 82.356] (II) RADEON(0): 030c001000b82d011d007251d01e206e
[ 82.357] (II) RADEON(0): 285500a05a0000001e011d00bc52d01e
[ 82.357] (II) RADEON(0): 20b8285540a05a0000001e011d801871
[ 82.357] (II) RADEON(0): 1c1620582c2500a05a0000009e011d80
[ 82.357] (II) RADEON(0): d0721c1620102c2580a05a0000009e00
[ 82.357] (II) RADEON(0): 0000000000000000000000000000001d
And just to clarify what I said earlier. HDMI audio does work with the in-tree driver and drm.radeon.audio=1 in loader.conf. So, I do believe that this is a problem with EDID.
Another evidence is that with drm-next I see the following message when KMS debug trace is enabled:
[drm:drm_edid_to_eld] ELD: no CEA Extension found
With the in-tree driver I see more pleasant messages:
hdaa0: Pin sense: nid=3 sense=0xffffffff (connected, ELD valid)
hdaa0: Pin sense: nid=3 sense=0xffffffff (connected, ELD valid)
Is this a problem with the i2c code in linuxkpi? Any thoughts?
Another bit. I noticed that the in-tree driver uses the bit-banging I²C driver while with this driver I see atom_hw_i2c being used. This seems to be because radeon_hw_i2c
is set to one unlike the in-tree driver. So, I set compat.linuxkpi.hw_i2c
to zero (by the way, @MATPOCKuH, this is where the tunables now live) and after that I see that:
So, I see two possibilities. Either the code that supports atom_i2c algorithm has a bug. Or my hardware (its video firmware, etc) does not properly support Atom I²C interface.
Seems like hw_i2c was necessary for some cards, it was enabled in https://github.com/FreeBSDDesktop/freebsd-base-graphics/pull/172
@myfreeweb thank you for the pointer! I think that maybe that change was wrong, I left a comment there. Meanwhile, I forgot to mention that in addition to disabling radeon_hw_i2c
I also had to make a change in the bit-bang I²C algorithm. I have created a PR for that change now: #51.
@avg-I I was able to get correct EDID information for Aruba after applying #51 and reverting FreeBSDDesktop/freebsd-base-graphics#172. Thanks!
I'll test it on Pitcairn when I get home.
@avg-I Both amdgpu and radeon work fine on Pitcairn with #51 and without FreeBSDDesktop/freebsd-base-graphics#172.
Know this is an older thread, and nearly ancient AMD A4-6300 APU with Radeon HD Graphics - Richland Radeon HD 8370D - and finally, with these drivers ... and 12-alpha7, (and a little bit older) - I can play Full HD H.264 video, hardware accelerated, via VLC.
However - no HDMI audio device. I know the
[ pts/0 dpdtech amd:~ ]
[ dpd ] > cat /dev/sndstat
Installed devices:
pcm0: <Realtek ALC887 (Rear Analog)> (play/rec) default
pcm1: <Realtek ALC887 (Front Analog)> (play/rec)
No devices installed from userspace.
I've attached my dmesg and Xorg log, but it looks like this is the error:
hdac1: <ATI (0x9902) HDA Controller> mem 0xfeb44000-0xfeb47fff irq 18 at device 1.1 on pci0
hdac1: hdac_get_capabilities: Invalid corb size (0)
device_attach: hdac1 attach returned 6
compat.linuxkpi.audio and i2c tunable are set to 1.
[ pts/0 dpdtech amd:~ ]
[ dpd ] > pkg info | grep drm
drm-devel-kmod-4.16.g20180824 DRM modules for the linuxkpi-based KMS components (development version)
libdrm-2.4.93,1 Userspace interface to kernel Direct Rendering Module services
Let me know, I have this setup entirely for play/testing Desktop stuff.
@daviddpd , I have a patch for snd_hda from Dmitry Luhtionov dmitryluhtionov@gmail.com, which I never decided to commit, but that may help here: hdac.c.txt
@daviddpd , I have a patch for snd_hda from Dmitry Luhtionov dmitryluhtionov@gmail.com, which I never decided to commit, but that may help here: hdac.c.txt
Thanks Alexander - I applied this last night, and can confirm it does now detect the HDMI output as pcm0, however I was unable to make any desktop - mate or kde5 - and vlc or Kodi to be able to output any audio at all - even in non-passthur. I am using the 4.16-devel DRM kmods ... will attempt to DRM -next and -stable tonight and see if there are different results.
@daviddpd , I have a patch for snd_hda from Dmitry Luhtionov dmitryluhtionov@gmail.com, which I never decided to commit, but that may help here: hdac.c.txt
For what is worth, I’ve tested this hdac patch in a HD Graphics 4400 (Haswell) and at least it did not broke anything: HDMI sound is still not working with the latest DRM (drm-current-kmod-4.16.g20181210). Video is as good and stable as before. Thanks!
@daviddpd , I have a patch for snd_hda from Dmitry Luhtionov dmitryluhtionov@gmail.com, which I never decided to commit, but that may help here: hdac.c.txt
For what is worth, I’ve tested this hdac patch in a HD Graphics 4400 (Haswell) and at least it did not broke anything: HDMI sound is still not working with the latest DRM (drm-current-kmod-4.16.g20181210). Video is as good and stable as before. Thanks!
Same, however I hadn't said anything, because I was still running down a suspected BIOS issue with my ASUS H110T/CSM - to be clear - still no working HDMI sound.
I have no sound via HDMI on AMD Radeon HD 6200 Sound device is presented and activated:
To make sound works on freebsd 10 I patched radeon_drv.c:
I tried to make same think on radeon/radeon_drv.c from port graphics/drm-next-kmod without any result. Also I tried to add something to /boot/loader.conf:
But still does not have working sound via HDMI. What is correct way to force enable sound via HDMI with drm-next? How I can check sound status on HDMI port ? (for example, via sysctl?)