[alsa-devel] SND_SOC_DAPM_VIRT_MUX question
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"},
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?
participants (2)
-
Koul, Vinod
-
Mark Brown