All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Henningsson <david.henningsson@canonical.com>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: Takashi Iwai <tiwai@suse.de>,
	"alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	Wu Fengguang <fengguang.wu@intel.com>,
	Stephen Warren <swarren@nvidia.com>
Subject: Re: link between HDMI ELD and PCM devices
Date: Wed, 21 Sep 2011 08:44:15 +0200	[thread overview]
Message-ID: <4E7987BF.8000206@canonical.com> (raw)
In-Reply-To: <1316566711.3872.24.camel@pbossart-Dell-N7010>

On 09/21/2011 02:58 AM, Pierre-Louis Bossart wrote:
>
>>> There is some existing code such as pin_nid_to_pin_index() in
>>> patch_hdmi.c, but I can't figure out what this pin_idx is, and how to
>>> find the related PCM device number.
>>> Any suggestions?
>>
>> That function simply returns the index into the array spec->pins[] that
>> refers to that pin NID.
>>
>> Judging by hinfo_to_pin_index() (e.g. used near the start ofhdmi_pcm_open),
>> that same index is valid  for spec->pcm_rec[] too, which I assume will
>> give you access to what you want, possibly through the .stream[0] field.
>
> Looks like the device number is assigned in hda_codec.c and there's no
> hooks to create the ELD control then...
> Instead of creating a PCM_IFACE control, it's probably simpler to create
> a MIXER control in the build_pcms routines, using the same name for the
> control and the device, eg:
>
>> amixer -c0 controls
> numid=1,iface=MIXER,name='ELD HDMI 0'
>> aplay -l
> card 0: Intel [HDA Intel], device 3: HDMI 0 [HDMI 0]
>
> That looks simple enough for apps to figure out which ELD control to
> use? Feedback welcome.

This won't work - in the case of several HDMI codecs (common with 
NVidia) there will be more than one "HDMI 0".

The solution is to actually find the device number out, like this:

	struct hdmi_spec *spec = codec->spec;
	int pcmdev = spec->pcm_rec[pin_idx].device;

(This must be run after build_pcms, e g in build_controls.)

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

  reply	other threads:[~2011-09-21  6:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-20 23:12 link between HDMI ELD and PCM devices Pierre-Louis Bossart
2011-09-20 23:33 ` Stephen Warren
2011-09-21  0:58   ` Pierre-Louis Bossart
2011-09-21  6:44     ` David Henningsson [this message]
2011-09-21  8:33       ` Takashi Iwai
2011-09-21 13:20       ` Pierre-Louis Bossart
     [not found]       ` <000001cc7861$2d7895e0$8869c1a0$@bossart@linux.intel.com>
2011-09-21 13:55         ` David Henningsson
2011-09-21 14:32           ` Pierre-Louis Bossart
2011-09-21 15:11           ` Stephen Warren
2011-09-21 17:30             ` Pierre-Louis Bossart
2011-09-21 18:29               ` Stephen Warren
2011-09-21 18:59                 ` Pierre-Louis Bossart
2011-09-26 10:43           ` Takashi Iwai

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=4E7987BF.8000206@canonical.com \
    --to=david.henningsson@canonical.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=fengguang.wu@intel.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=swarren@nvidia.com \
    --cc=tiwai@suse.de \
    /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.