[alsa-devel] hda: sink info in case of AMD Radeon GPU card (no ELD?)

Rafał Miłecki zajec5 at gmail.com
Wed Apr 17 14:08:00 CEST 2013


2013/1/19 Rafał Miłecki <zajec5 at gmail.com>:
> Hello,
>
> I'm interested in polishing HDMI audio support for Radeon cards and I
> hope to get some help here. One of the current problems is that hda
> has no information about TV audio capabilities. It results in a well
> known:
> ALSA sound/pci/hda/hda_eld.c:337 HDMI: ELD buf size is 0, force 128
> ALSA sound/pci/hda/hda_eld.c:356 HDMI: invalid ELD data byte 0
> It's expected, as radeon (GPU driver) doesn't pass ELD struct anywhere
> to the GPU and it's not done automatically neither.
>
> Unfortunately it doesn't seem to be trivial to solve. You may be
> familiar with other GPUs like Nvidia or Intel, where it's done in a
> pretty simple way, for example:
>> for (i = 0; i < len; i++)
>>       I915_WRITE(hdmiw_hdmiedid, *((uint32_t *)eld + i));
> but it can't be handled that way on Radeon cards.
>
> If you take a look at evergreend.h [0] you can see we can't simply
> write ELD to the GPU buffer, but we have to fill specific registers
> which look more like SADs (Short Audio Descriptors).
>
> My question is how to handle this on the alsa side. We can't just read
> ELD, we probably have to read some registers from the audio card. Is
> something like that implemented anywhere else? Did anyone started
> working on it? Anyone interested in it?
>
> [0] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=drivers/gpu/drm/radeon/evergreend.h;hb=HEAD

I tried hacking this sink info problem again. I've installed "fglrx"
on my AMD Radeon HD 6970M (BARTS == DCE5) and verified it sets SAD
registers:
5f84        7f077f07
5f88        00500705
5f8c        00000001
5f90        00000001
5f94        00000001
5f98        00000001
5f9c        00c01e05
5fa0        00000001
5fa4        00000001
5fa8        00000607
5fac        00017e07
5fb0        00007e07
5fb4        00000001
5fb8        00000001

Reading ELD of course doesn't work (that's why we get warning in
dmesg) and I did some manual confirmation with hda-verb (reading ELD
length):
$ sudo ./hda-verb /dev/snd/hwC1D0 3 0xf2e 0x8
nid = 0x3, verb = 0xf2e, param = 0x8
value = 0x0

Plus (just for sure) reading first byte of ELD (in case length is
always zero, but data is available):
$ sudo ./hda-verb /dev/snd/hwC1D0 3 0xf2f 0 | grep val
value = 0x0
$ sudo ./hda-verb /dev/snd/hwC1D0 3 0xf2f 1 | grep val
value = 0x0
$ sudo ./hda-verb /dev/snd/hwC1D0 3 0xf2f 2 | grep val
value = 0x0

So it seems ELD is really not available in this configuration. I
thought about vendor specific verbs. Maybe values from the GPU
registers are just copied to the audio? I've tried reading every
possible vendor specific verb with the attached script (verbs.php).

Unfortunately any verb didn't return anything interesting :(
> grep value verbs.txt | sort | uniq -c
9336832 value = 0x0
  18432 value = 0x1
   6144 value = 0x40
   2048 value = 0x415f
  55296 value = 0x86
   2048 value = 0xa6
  16384 value = 0xb6

Does anyone have any idea how we can/should read that values from GPU
in the audio driver? :| I guess the must be copied somewhere, but
can't find the correct place.

-- 
Rafał
-------------- next part --------------
A non-text attachment was scrubbed...
Name: verbs.php
Type: application/x-httpd-php
Size: 252 bytes
Desc: not available
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20130417/9862c11f/attachment.bin>


More information about the Alsa-devel mailing list