All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Takashi Iwai <tiwai@suse.de>, Stephen Warren <swarren@nvidia.com>
Cc: "pl bossart (bossart.nospam@gmail.com)"
	<bossart.nospam@gmail.com>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"Wu Fengguang (wfg@linux.intel.com)" <wfg@linux.intel.com>,
	Wei Ni <wni@nvidia.com>, Nitin Daga <ndaga@nvidia.com>
Subject: Re: HDA HDMI pin to converter mapping
Date: Thu, 26 May 2011 11:52:26 +0200	[thread overview]
Message-ID: <4DDE22DA.7070905@canonical.com> (raw)
In-Reply-To: <s5h39k22bmu.wl%tiwai@suse.de>

On 2011-05-26 08:56, Takashi Iwai wrote:
> At Wed, 25 May 2011 11:29:35 -0700,
> Stephen Warren wrote:
>>
>> Most cards supported by patch_hdmi.c have the property of a 1:1 mapping
>> or connection between converter widgets and pin widgets. Hence,
>> patch_hdmi.c sets up a PCM for each converter, and occasionally performs
>> some operations on the pin widget as required.
>>
>> However, some new cards don't have this 1:1 mapping. In particular, the
>> new GeForce GT 520 and many future NVIDIA cards, and at least the Intel
>> Ibex Peak (in my wife's laptop), have more pin widgets than converters,
>> and each pin widget has a mux to select which converter to take the
>> audio from.
>>
>> For pretty pictures, see the 4th (and 3rd) diagrams at:
>>
>> ftp://download.nvidia.com/XFree86/gpu-hdmi-audio-document/gpu-hdmi-audio.html#_examples
>
> Wow, nice to see such a good document.

Indeed!

>> I'd like to discuss how best to handle such cards.
>>
>> I'd expect to see a PCM device created for each pin widget. This would
>> create a 1:1 mapping between PCM devices and attached monitors and hence
>> ELD data (with the possible exception of DisplayPort 1.2 daisy-chaining;
>> I have no idea yet how that plays into this).
>>
>> Does this seem like a reasonable approach to everyone?
>
> Sounds reasonable and logical to me.
> It won't break the older chips, and it will work with new chips.

It makes PulseAudio's life harder, if that is to take into account; in 
the startup phase, PulseAudio usually only tries one of the pcm streams 
(which is bad here, it'll effectively rule out all ports but the first), 
if we change to all of the pcm streams, the latter two will fail since 
the former ones are already opened.

So we're effectively breaking some of the older chips by changing the 
PCM device from hw:X to hw:X,1 for a specific pin...?

OTOH, the bigger change here is what's inevitable; that PulseAudio at 
some point must start to take into account that the current capabilities 
of a PCM can change during its lifetime. (And that goes regardless of 
whether have one pcm per pin or converter.) And so the upcoming question 
is, can PulseAudio detect that the PCM capabilities have changed 
somehow, and then reprobe it?

>> The current situation is that we only create a PCM for each converter
>> that is mux'd to a pin by default HW initialization. On both the GeForce
>> 520 and Ibex Peak, this means that only 1 PCM gets created, since all
>> pin widgets' muxes point at the first converter by default. This:
>>
>> a) Doesn't allow usage of both converters at once, since there's only 1
>> PCM object.

So, create a second PCM object for the second converter...?

>> b) Ends up with up to 4 (in NVIDIA's case) pin widgets (and hence ELD
>> information) logically associated with the PCM object. Hence, it'll be
>> confusing for application to know what features they can really use on
>> the PCM. In fact, ALSA actually only enforces the ELD of the first pin
>> associated with the converter, and ignores the rest.

Looks like they should be combined; restricted to whatever formats they 
both support in case both have valid ELD's?

>> The basic mechanics of a-PCM-per-pin would require hdmi_pcm_open to look
>> at the list of converters, find one not in use by a stream, and then
>> dynamically associate the converter with the stream, or fail the open if
>> a converter was not available. We'd also need a custom close or cleanup
>> function to "unassign" the converter from the PCM, and set
>> hda_pcm_stream.nid to an invalid value.

Would it be more difficult for hdmi_pcm_open to open the associated 
converter and dynamically assign a pin?

That said, I think it's great that you brought it up Stephen, and I 
understand this doesn't help you associate PCMs with X screens - and I'm 
not sure I have a better proposal for you (and I don't want to block 
development either), just wanted to add my view to the discussion.

-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic

  reply	other threads:[~2011-05-26  9:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-25 18:29 HDA HDMI pin to converter mapping Stephen Warren
2011-05-26  6:56 ` Takashi Iwai
2011-05-26  9:52   ` David Henningsson [this message]
2011-05-26 10:46     ` Takashi Iwai
2011-05-26 12:17       ` David Henningsson
2011-05-26 17:45     ` Stephen Warren
2011-05-26 23:07       ` Stephen Warren
2011-05-27  8:45       ` David Henningsson
2011-05-27 15:58         ` Stephen Warren

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=4DDE22DA.7070905@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=bossart.nospam@gmail.com \
    --cc=ndaga@nvidia.com \
    --cc=swarren@nvidia.com \
    --cc=tiwai@suse.de \
    --cc=wfg@linux.intel.com \
    --cc=wni@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.