[alsa-devel] [PATCH v3 14/15] ASoC: hdac_hdmi: Add jack reporting for user space

Takashi Iwai tiwai at suse.de
Tue Dec 8 09:42:09 CET 2015


On Tue, 08 Dec 2015 09:38:31 +0100,
Vinod Koul wrote:
> 
> On Tue, Dec 08, 2015 at 08:52:10AM +0100, Takashi Iwai wrote:
> > On Tue, 08 Dec 2015 08:42:16 +0100,
> > Vinod Koul wrote:
> > > 
> > > On Tue, Dec 08, 2015 at 07:38:46AM +0100, Takashi Iwai wrote:
> > > > On Tue, 08 Dec 2015 07:31:36 +0100,
> > > > Vinod Koul wrote:
> > > > > 
> > > > > On Mon, Dec 07, 2015 at 05:18:06PM +0100, Takashi Iwai wrote:
> > > > > > On Mon, 07 Dec 2015 22:24:28 +0100,
> > > > > > > +		sprintf(jack_name, "HDMI/DP, Pin=%d Jack", pin->nid);
> > > > > > 
> > > > > > Such a name makes sense only to be compatible for PA, and then this
> > > > > > string isn't compatible.  Note that it's not about pin but for PCM
> > > > > > stream.  You may wonder why it matters -- see the whole discussion on
> > > > > > MST support.
> > > > > 
> > > > > So in our case we have added only one PCM Backend in DSP. In codec we have
> > > > > one DAI supported, thus creating a DAIlink
> > > > > 
> > > > > The Codec DAI is mapped to a stream which we fix to a CVT. Future we
> > > > > will add two more streams which are mapped to other two CVTs.
> > > > > 
> > > > > We use MUX controls to allow user to specfiy how CVT and PINs are connected
> > > > > togther, this way we can route stream to any pin.
> > > > > 
> > > > > Extending this concept, behind a pin for MST there may be different 'ports',
> > > > > right? Shouldn't that be another mux configuration :) So we can treat three
> > > > > streams coming to codec to be routed to any pin and then any port. Since we
> > > > > have only 3 CVTs we will have only 3 streams...
> > > > 
> > > > You can't do that easily.  Remember that you may connect up to 64
> > > > different devices at the same time per pin, and this can switch on the
> > > > fly.  How would you implement a MUX?
> > > 
> > > somehow I was under impression that it is 3.. Btw even if 64 devices can be
> > > connected how many can we render to?
> > 
> > That's what I meant below.  Although you can may connect quite a lot
> > of devices, the number of devices that can be actually output at the
> > same time is limited, actually equal with the number of converters.
> 
> Okay got it now, that is how my 3 limit for MST is coming from as we
> have 3 CVTs so we can actually stream to only 3 devices per port
> although someone may theoretically connect 64!
> 
> > > > Though, the max number of converters is limited, thus what you can
> > > > actually use is defined by this constraint.  Due to this, we'll likely
> > > > manage MST for the legacy HDA by assigning MST devs dynamically to
> > > > pins in a certain procedure to make things compatible.
> > > 
> > > but how many MST devs are you going to create?
> > 
> > This is exactly the point: for the legacy HDA, instead of creating the
> > entry for each MST devices, they are assigned dynamically to PCM at
> > activation.  So the number of devices exposed to user-space is
> > limited -- or better to say, user-space won't notice the difference.
> 
> And how many PCMs are you proposing for MST?

5 for Intel, i.e. Nconv * 2 - 1.  This could be even Nconv, but we
provide the reserved slots just for the compatible behavior that
assumes the static pin/slot assignment.

> > > > > Back on present :), what do you recommend for us for jack name.
> > > > 
> > > > Depends on your purpose.  If you want to keep it compatible, then use
> > > > the compatible string.
> > > 
> > > Since compatible string would mean specfying PCM, which we don;t know and is
> > > per machine driver dailink defination, we would go ahead with logical
> > > "HDMI/DP, Pin=%d Jack" names.
> > 
> > But then it makes little sense.  Multiple MST devices can be on the
> > same pin.
> 
> Well am not supporting MST at the moment. How is legacy handling this,
> how do you report jack for 64 X 3 devices :)
> 
> Or, are you reporting jack for PCMs based on connection to pin/device, I
> think latter.

Yes, the jack reporting is for PCM in this case, which is I mentioned
in the first reply: it's not about pin but PCM.

> But then you would hit limit of PCMs, I assume you maybe doing 9 PCMs for
> this, so if someone connects 10th device we won't report it's jack?

The jack reporting is done actually at the time the audio is
enabled/disabled.  And at this moment, the PCM assignment is assured
as well.  So, to user-space, only the actually usable devices are
exposed no matter how many devices are plugged.


Takashi


More information about the Alsa-devel mailing list