[PATCH] drm/tegra: sor: Support for audio over HDMI

Dmitry Osipenko digetx at gmail.com
Tue Dec 4 13:50:44 UTC 2018


On 04.12.2018 16:08, Thierry Reding wrote:
> On Tue, Dec 04, 2018 at 02:09:07PM +0300, Dmitry Osipenko wrote:
>> On 03.12.2018 18:36, Thierry Reding wrote:
>>> From: Thierry Reding <treding at nvidia.com>
>>>
>>> This code is very similar to the audio over HDMI support on older chips.
>>> Interoperation with the audio codec is done via a pair of codec scratch
>>> registers and an interrupt that is raised at the SOR when the codec has
>>> written those registers.
>>>
>>> Signed-off-by: Thierry Reding <treding at nvidia.com>
>>> ---
>>
>> Do you have any plans to implement integration with the sound
>> subsystem? Indeed, there is HDMI audio configuration code for older
>> chips in the Tegra's DRM driver that was added years ago.. but IIUC
>> it's a kinda "dead code" without the integration.
> 
> The integration all lives in sound/pci/hda/hda_tegra.c for the HDA
> controller driver and sound/pci/hda/patch_hdmi.c for the HDMI codec
> driver. The way that this works is that the HDMI codec driver writes
> information about the audio format to so-called scratch registers via
> HDA verbs. These HDA verbs are accessible in the SORs (or the HDMI on
> older Tegra) which basically represent the HDMI codec. Writes to these
> registers are detected and an interrupt is raised in the SOR (or HDMI)
> controller, upon which the interrupt handler will configure the output
> as needed for playback (i.e. program some registers, send out audio
> infoframe, ...).
> 
> From a userspace point of view you can simply access the HDMI codec as
> an ALSA sound card. For example I use the speaker-test utility (from
> alsa-utils) to test output like this:
> 
> 	$ speaker-test -D hw:0,8 -c -F S16_LE -r 48000 -t sine -f 250 -l 1
> 
> The same code that works from Tegra30 to Tegra210 also works on Tegra186
> and Tegra194, though I have patches (which I plan to send out later
> today) which add the HDA_CODEC_ENTRY entries as well as the necessary
> device tree nodes to make all this work.
> 
> Does that clarify things?

Yes, that sounds like a nice way to integrate HW. I was also thinking from a good-old T20 perspective which AFAIK doesn't have that kind of HW integration, so was curious how it works for later Tegra's. Thank you very much for the explanation. Though it shouldn't be difficult to add SW integration with the audio codec.. but probably there was just no much need for it ever. It's good to know that it works for T30+, please keep up the good work :)


More information about the dri-devel mailing list