[alsa-devel] Problem setting mixer switch with amixer/alsactl.

Oliver Ford ipaqlinux at oliford.co.uk
Tue Oct 28 22:51:02 CET 2008


Mark Brown wrote:
> On Tue, Oct 28, 2008 at 01:10:31PM +0000, Mark Brown wrote:
>
>   
>> It looks like you might've been right after all.  I still can't see
>> where this makes a difference to the speaker paths but the patch below
>> seems to resolve the issues I'm seeing here.
>>     
>
>   
>> Oliver, could you test the patch below please?
>>     
>
> Gah, sorry - it doesn't help, I was masking the problem another way.
>   
Ok, well I tried it anyway and it doesn't solve the problem.

I've done a lot more tracing and think I may have found something 
relevant. I'm not entirely sure what is supposed to be happening so 
can't figure it out myself, but maybe you will know...

When turning the PCM->Speaker mixer on and off in alsamixer (before its 
broken) the mixer's widget->value seems to flick between 0x4000 and 
0x0000. After breaking it with amixer it flicks between 0x4001 and 
0x4000, both of which fire the lines:
        if (val)
            /* new connection */
            path->connect = invert ? 0:1;
in dapm_mixer_update_power().


I've put some debugging to report whats happening to path->connect in 
dapm_mixer_update_power() and this is what happens:


ON in alsamixer when working:
    +dapm_mixer_update_power(kcontrol=Speaker Mixer PCM Playback Switch, 
reg=0000000c, val=00000000, val_mask=00004001, invert=00000001)
        found path for kcontrol: name='PCM Playback Switch', 
long_name='Speaker Mixer PCM Playback Switch'
        val=false: path->connect: 0 --> 1
    -dapm_mixer_update_power()

OFF in alsamixer when working:
    +dapm_mixer_update_power(kcontrol=Speaker Mixer PCM Playback Switch, 
reg=0000000c, val=00004000, val_mask=00004001, invert=00000001)
        found path for kcontrol: name='PCM Playback Switch', 
long_name='Speaker Mixer PCM Playback Switch'
        val=true: path->connect: 1 --> 0
    -dapm_mixer_update_power()


Leaving it on in alsamixer and running the amixer on command. This happens:
    +dapm_mixer_update_power(kcontrol=Speaker Mixer PCM Playback Switch, 
reg=0000000c, val=00000001, val_mask=00004001, invert=00000001)
        found path for kcontrol: name='PCM Playback Switch', 
long_name='Speaker Mixer PCM Playback Switch'
        val=true: path->connect: 1 --> 0
    +dapm_power_widgets()

i.e it seems to turn it off?


 From then on, any further attempts to turn it on in amixer give:
    +dapm_mixer_update_power(kcontrol=Speaker Mixer PCM Playback Switch, 
reg=0000000c, val=00004001, val_mask=00004001, invert=00000001)
        found path for kcontrol: name='PCM Playback Switch', 
long_name='Speaker Mixer PCM Playback Switch'
        val=true: path->connect: 0 --> 0
    +dapm_power_widgets()

Any further off/on toggling in alsamixer once broken just results in:
    +dapm_mixer_update_power(kcontrol=Speaker Mixer PCM Playback Switch, 
reg=0000000c, val=00004001, val_mask=00004001, invert=00000001)
        found path for kcontrol: name='PCM Playback Switch', 
long_name='Speaker Mixer PCM Playback Switch'
        val=true: path->connect: 0 --> 0
    +dapm_power_widgets()
   
    +dapm_mixer_update_power(kcontrol=Speaker Mixer PCM Playback Switch, 
reg=0000000c, val=00000001, val_mask=00004001, invert=00000001)
        found path for kcontrol: name='PCM Playback Switch', 
long_name='Speaker Mixer PCM Playback Switch'
        val=true: path->connect: 0 --> 0
    +dapm_power_widgets()



Does that give you any ideas of what happening on my system?


Thanks,

Oliver


More information about the Alsa-devel mailing list