All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
To: "Kaskinen, Tanu" <tanu.kaskinen@intel.com>
Cc: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
	"pulseaudio-discuss@lists.freedesktop.org"
	<pulseaudio-discuss@lists.freedesktop.org>,
	"tiwai@suse.de" <tiwai@suse.de>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>, "Lu, Han" <han.lu@intel.com>
Subject: Re: [alsa-devel] [PATCH 3/4] snd: add support for displayport multi-stream to hda codec.
Date: Thu, 25 Jun 2015 10:44:51 +0100	[thread overview]
Message-ID: <1435225491.9221.16.camel@loki> (raw)
In-Reply-To: <1435178842.7153.34.camel@tkkaskin-mobl3.ger.corp.intel.com>

On Wed, 2015-06-24 at 20:47 +0000, Kaskinen, Tanu wrote:
> On Wed, 2015-06-24 at 14:06 +0100, Liam Girdwood wrote:
> > On Wed, 2015-06-24 at 12:41 +0000, Kaskinen, Tanu wrote:
> > > On Tue, 2015-06-23 at 10:06 +0200, Takashi Iwai wrote:
> > > > At Tue, 23 Jun 2015 07:51:22 +0000,
> > > > Kaskinen, Tanu wrote:
> > > > > 
> > > > > (Added pulseaudio-discuss to CC.)
> > > > > 
> > > > > On Mon, 2015-06-22 at 17:44 +0200, Takashi Iwai wrote:
> > > > > > At Mon, 22 Jun 2015 15:21:16 +0000,
> > > > > > Kaskinen, Tanu wrote:
> > > > > > > 
> > > > > > > On Mon, 2015-06-22 at 14:29 +0100, Liam Girdwood wrote:
> > > 
> > > <snip>
> > > 
> > > > > > > > Tanu, what's your take on the effort for dynamically created PCMs
> > > > > > > > support for pulseaudio ?
> > > > > > > 
> > > > > > > It's a significant amount of work, but I think PulseAudio should be
> > > > > > > improved to support this in any case, if other approaches make life
> > > > > > > miserable for driver developers.
> > > > > > > 
> > > > > > > What would be the interface for getting notifications about new and
> > > > > > > removed PCM devices? udev?
> > > > > > 
> > > > > > In general, yes.
> > > > > > 
> > > > > > > PulseAudio (mostly) doesn't use the hw:X devices directly. Instead, it
> > > > > > > uses logical names like "front", "hdmi", "iec958", etc. Speaking of HDMI
> > > > > > > specifically, PulseAudio uses devices from "hdmi:X,0" to "hdmi:X,7".
> > > > > > > With this new dynamic PCM system, do these logical names still work?
> > > > > > 
> > > > > > Unfortunately, this doesn't work for HDA as is, because of the
> > > > > > terribly arcane secret.  For keeping the compatibility with the old
> > > > > > config, there is a static mapping of the hdmi:x,y and hw:x,z.
> > > > > > 
> > > > > > Maybe we should introduce a new device class for dynamic HDMI/DP
> > > > > > device, something like dhdmi:x,y, to make things straightforward.
> > > > > > (Just a concept -- I'm not good at naming.)
> > > > > > 
> > > > > > Alternatively, we may introduce a new argument to hdmi PCM to access
> > > > > > like "hdmi:CARD=x,SYSDEV=y".
> > > > > 
> > > > > What happens if PulseAudio tries to open "dhdmi:x,y" or
> > > > > "hdmi:CARD=x,SYSDEV=y", when y points to a non-HDMI device? If it fails,
> > > > > then PulseAudio can replace its current "hdmi:x,[0-7]" devices with
> > > > > "hdmi:CARD=X,SYSDEV=[0-13]" and blindly try every hw PCM device. But if
> > > > > opening a non-HDMI device through "hdmi:CARD=x,SYSDEV=y" succeeds, then
> > > > > how is PulseAudio supposed to know which hw PCM devices are HDMI
> > > > > devices?
> > > > 
> > > > It's a good question.  I think this is the core part of the missing
> > > > pieces.
> > > > 
> > > > What I have in my mind is to extend SNDRV_PCM_CLASS_* definition for
> > > > dedicated to HDMI/DP, e.g. SNDRV_PCM_CLASS_HDMI.  The difference
> > > > between DP and HDMI can be specified in subclass optionally.
> > > 
> > > Sounds good. Knowing the difference between HDMI, DisplayPort and
> > > Thunderbolt would be very nice too. It would enable better labelling in
> > > UIs.
> > > 
> > > I have one minor concern, though: what if a PCM device isn't statically
> > > assigned to one output connector? Is it possible that some DSP is able
> > > to dynamically change the PCM routing between different outputs? In
> > > those cases the PCM class would be useless information (unless there are
> > > notifications when the class changes). I don't have any better ideas,
> > > though.
> > > 
> > 
> > This is possible atm, we can route from one PCM to multiple outputs
> > depending on DSP and codec mixer settings. The outputs can even be on
> > different physical interfaces. 
> 
> Hmm, my question was a bit silly. It has been possible forever to switch
> between e.g. headphones and speakers using just the mixer. And in this
> case that we're discussing, the question was irrelevant anyway, because
> surely the dynamically created PCM would be dedicated to the plugged-in
> HDMI port, otherwise the dynamic creation wouldn't really make sense.
> So, setting the PCM class should work at least in this case.
> 
> If there are cases where the DSP may route the same PCM to either HDMI
> or non-HDMI output depending on mixer settings, then that's when the PCM
> class would be less useful.
> 

Yeah, we may need to provide other hints here. DSPs make it possible now
to route one PCM to multiple HW endpoints. 

> In any case, PulseAudio needs to figure out whether it should ignore the
> PCM class and use "hdmi:x,y" or whether it should check the PCM class
> and use "hdmi:CARD=x,SYSDEV=y". How should that be done? Is checking the
> kernel (and alsa-lib) version a good approach, or is some other
> mechanism needed? Checking the versions should work, if all HDMI audio
> drivers start to set the PCM class at the same time, but if some drivers
> set it and some don't, then version checking isn't a reliable solution.

struct snd_pcm_info does have some reserved space (64 bytes currently
set as 0) that could be used to differentiate and provide information on
the PCM ?

Liam

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2015-06-25  9:44 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-17  4:01 haswell displayport MST audio support Dave Airlie
2015-06-17  4:01 ` [PATCH 1/4] dp/mst: add SDP stream support Dave Airlie
2015-06-17  4:01 ` [PATCH 2/4] i915: add support for GPU side of MST audio Dave Airlie
2015-06-17  8:07   ` Chris Wilson
2015-06-17 11:54     ` Jani Nikula
2015-06-17 11:56       ` Jani Nikula
2015-06-19  6:27       ` Lin, Mengdong
2015-06-17 11:27   ` Daniel Vetter
2015-06-17  4:01 ` [PATCH 3/4] snd: add support for displayport multi-stream to hda codec Dave Airlie
2015-06-19  9:54   ` Lin, Mengdong
2015-06-19 10:33     ` Dave Airlie
2015-06-19 11:15       ` Takashi Iwai
2015-06-22 12:54         ` Daniel Vetter
2015-06-22 13:23           ` Takashi Iwai
2015-06-22 13:29             ` Liam Girdwood
2015-06-22 15:21               ` Kaskinen, Tanu
2015-06-22 15:44                 ` Takashi Iwai
2015-06-23  7:51                   ` [Intel-gfx] " Kaskinen, Tanu
2015-06-23  8:06                     ` Takashi Iwai
2015-06-24 12:41                       ` [Intel-gfx] " Kaskinen, Tanu
2015-06-24 13:06                         ` [alsa-devel] " Liam Girdwood
2015-06-24 20:47                           ` Kaskinen, Tanu
2015-06-25  9:44                             ` Liam Girdwood [this message]
2015-06-26 10:14                               ` [alsa-devel] " Kaskinen, Tanu
2015-06-26 10:50                     ` Kaskinen, Tanu
2015-06-26 18:45                       ` Liam Girdwood
2015-06-26 16:27                   ` [Intel-gfx] " Kaskinen, Tanu
2015-06-27  6:09         ` [alsa-devel] " Raymond Yau
2015-06-29  8:00           ` Jani Nikula
2015-07-03  3:45             ` Raymond Yau
2015-07-03  8:54               ` Jani Nikula
2015-06-25  8:22       ` Raymond Yau
2015-06-25 12:52         ` David Weinehall
2015-06-17  4:01 ` [PATCH 4/4] snd/hdmi: hack out haswell codec workaround Dave Airlie

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=1435225491.9221.16.camel@loki \
    --to=liam.r.girdwood@linux.intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=han.lu@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=pulseaudio-discuss@lists.freedesktop.org \
    --cc=tanu.kaskinen@intel.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.