public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: linux-tegra@vger.kernel.org, Sameer Pujar <spujar@nvidia.com>,
	dri-devel@lists.freedesktop.org,
	Jon Hunter <jonathanh@nvidia.com>
Subject: Re: [PATCH] drm/tegra: sor: Support for audio over HDMI
Date: Tue, 4 Dec 2018 14:08:19 +0100	[thread overview]
Message-ID: <20181204130819.GA2608@ulmo> (raw)
In-Reply-To: <e78a378e-edc3-2d29-e0d7-f2a3b7fe3fd3@gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 1968 bytes --]

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@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@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?

Thierry

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2018-12-04 13:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-03 15:36 [PATCH] drm/tegra: sor: Support for audio over HDMI Thierry Reding
2018-12-03 16:05 ` Jani Nikula
2018-12-04  8:42   ` Thierry Reding
2018-12-04  9:33     ` Jani Nikula
2018-12-04 10:09       ` Thierry Reding
2018-12-04 11:09 ` Dmitry Osipenko
2018-12-04 13:08   ` Thierry Reding [this message]
2018-12-04 13:50     ` Dmitry Osipenko
2018-12-04 14:40       ` Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181204130819.GA2608@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=digetx@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-tegra@vger.kernel.org \
    --cc=spujar@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox