All of lore.kernel.org
 help / color / mirror / Atom feed
* SND_SOC_DAPM_VIRT_MUX question
@ 2011-04-07  9:20 Koul, Vinod
  2011-04-11 20:27 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Koul, Vinod @ 2011-04-07  9:20 UTC (permalink / raw)
  To: alsa; +Cc: Mark Brown, Liam

Hi,

I have the audio DSP decoder which I tried to connect to the codec.
The decoder output is treated as Input. For the VIRT MUX i gave register
bits as SND_SOC_NOPM both in MUX as well as enum describing this as my
aim is to create a virtual mux for routing.

Aim is to have usespace be able to use this mux and connect to either
headset or speaker DAI or leave it non connected. Machine driver map is
taking care of this.

But the problem is that the this VIRT mux is not allowing me to change
values :(, set to to 1.
I remember that code checks if the path should be allowed for MUX and
implements only if its allowed, but in virtual mix case it should not do
so... or I am missing something?

static const char *sn95031_decoder_text[] = {"None", "Speaker",
	"Headset"};
static const struct soc_enum sn95031_decoder_enum =
       	SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, 3, sn95031_decoder_text);
static const struct snd_kcontrol_new sn95031_decoder_control =
	SOC_DAPM_ENUM("Route", sn95031_decoder_enum);

SND_SOC_DAPM_VIRT_MUX_E("Compressed Decoder Mux",
                        SND_SOC_NOPM, 0, 0, &sn95031_decoder_control,
                        sn95031_decoder_event, SND_SOC_DAPM_POST_PMD),
SND_SOC_DAPM_INPUT("Dummy"), /* sst decoder output*/

        /* decoder output map */
        {"Compressed Decoder Mux", NULL, "Compressed Decoder"},
        {"IHFDAC Left", "Speaker", "Compressed Decoder Mux"},
        {"IHFDAC Right", "Speaker", "Compressed Decoder Mux"},
        {"PCM2_IN", "Headset", "Compressed Decoder Mux"},
        {"Dummy", "None", "Compressed Decoder Mux"},

-- 
~Vinod

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: SND_SOC_DAPM_VIRT_MUX question
  2011-04-07  9:20 SND_SOC_DAPM_VIRT_MUX question Koul, Vinod
@ 2011-04-11 20:27 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2011-04-11 20:27 UTC (permalink / raw)
  To: Koul, Vinod; +Cc: alsa, Liam

On Thu, Apr 07, 2011 at 02:50:08PM +0530, Koul, Vinod wrote:

> But the problem is that the this VIRT mux is not allowing me to change
> values :(, set to to 1.
> I remember that code checks if the path should be allowed for MUX and
> implements only if its allowed, but in virtual mix case it should not do
> so... or I am missing something?

It should be possible to set the mux to any value, the routes will only
be created if they exist but that shouldn't affect the control itself.
The only check _put_enum_virt() does is if the value is greater than the
number of elements in the enumeration.

However...

| static const char *sn95031_decoder_text[] = {"None", "Speaker",
|         "Headset"};
| static const struct soc_enum sn95031_decoder_enum =
|         SOC_ENUM_SINGLE(SND_SOC_NOPM, 0, 3, sn95031_decoder_text);
| static const struct snd_kcontrol_new sn95031_decoder_control =
|         SOC_DAPM_ENUM("Route", sn95031_decoder_enum);

...I think you want to be using an ENUM_VIRT here?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-04-11 20:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-07  9:20 SND_SOC_DAPM_VIRT_MUX question Koul, Vinod
2011-04-11 20:27 ` Mark Brown

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.