Problem while creation PCM out group

Hi !


I have one more question.
I can’t create mute (sw2) element in PCM out group. Below some of my code
without ifs and checks:

cmpci->me_playback=ado_mixer_element_io(mixer, SND_MIXER_PCM_OUT,
SND_MIXER_ETYPE_PLAYBACK1, 0, 2, stereo_voices);

cmpci->me_vol_pcm=ado_mixer_element_volume1(mixer, SND_MIXER_PCM_OUT, 2,
db_range_31s, snd_cmipci_pcm_volume_level, cmpci, NULL);

ado_mixer_element_route_add(mixer, cmpci->me_playback, cmpci->me_vol_pcm);

cmpci->me_vol_pcm_mute=ado_mixer_element_sw2(mixer, “PCM Mute”,
snd_cmipci_pcm_volume_mute, cmpci, NULL);

ado_mixer_element_route_add(mixer, cmpci->me_vol_pcm,
cmpci->me_vol_pcm_mute);

ado_mixer_element_route_add(mixer, cmpci->me_vol_pcm_mute,
cmpci->me_out_accu);

cmpci->pcm_out_grp=ado_mixer_playback_group_create(mixer, SND_MIXER_PCM_OUT,
SND_MIXER_CHN_MASK_STEREO,
cmpci->me_vol_pcm, NULL);

So scheme is io->volume1->sw2->OUT ACCUMULATOR.

When change first element io to pcm1, result the same: photon mixer doesn’t
show the mute check box for PCM out device.

What I do wrong ?

BTW: when I start photon mixer - it call my callback for PCM mute one or
more, then never call it up to driver reload …

Thanks !

Mike Gorchak <mike@malva.com.ua> wrote:

cmpci->me_playback=ado_mixer_element_io(mixer, SND_MIXER_PCM_OUT,
SND_MIXER_ETYPE_PLAYBACK1, 0, 2, stereo_voices);

cmpci->me_vol_pcm=ado_mixer_element_volume1(mixer, SND_MIXER_PCM_OUT, 2,
db_range_31s, snd_cmipci_pcm_volume_level, cmpci, NULL);

ado_mixer_element_route_add(mixer, cmpci->me_playback, cmpci->me_vol_pcm);

cmpci->me_vol_pcm_mute=ado_mixer_element_sw2(mixer, “PCM Mute”,
snd_cmipci_pcm_volume_mute, cmpci, NULL);

ado_mixer_element_route_add(mixer, cmpci->me_vol_pcm,
cmpci->me_vol_pcm_mute);

ado_mixer_element_route_add(mixer, cmpci->me_vol_pcm_mute,
cmpci->me_out_accu);

cmpci->pcm_out_grp=ado_mixer_playback_group_create(mixer, SND_MIXER_PCM_OUT,
SND_MIXER_CHN_MASK_STEREO,
cmpci->me_vol_pcm, NULL);

So scheme is io->volume1->sw2->OUT ACCUMULATOR.

When change first element io to pcm1, result the same: photon mixer doesn’t
show the mute check box for PCM out device.

What I do wrong ?

The photon mixer only deals with mixer groups so when you
created the playback group you said the group only had a
volume control. Try this

cmpci->pcm_out_grp=ado_mixer_playback_group_create(mixer, SND_MIXER_PCM_OUT,
SND_MIXER_CHN_MASK_STEREO, cmpci->me_vol_pcm, cmpci->me_vol_cpm_mute);

When change first element io to pcm1, result the same: photon mixer
doesn’t
show the mute check box for PCM out device.

In DDK’s mixer example code used ‘io’ element, but in the solo1 driver from
ddk used pcm1 element for PCM Out. What the difference ?

The photon mixer only deals with mixer groups so when you
created the playback group you said the group only had a
volume control. Try this
cmpci->pcm_out_grp=ado_mixer_playback_group_create(mixer,
SND_MIXER_PCM_OUT,
SND_MIXER_CHN_MASK_STEREO, cmpci->me_vol_pcm, cmpci->me_vol_cpm_mute);

Oh, sorry I forget add the cmpci->me_vol_cpm_mute to playback group, I’m
used NULL for mute control for debug and forget to replace it. Thanks !

How does photon mixer handle scheme io->volume1->sw2->sw2[3D Surround]->OUT
ACCUMULATOR ? Will be shown the second sw2 element at photon mixer or not ?
As I think the answer No ? Or 3D Surround effect must be in advanced options
?

P.S. ALSA distribution has tool amixer - it is great for mixer code debug.