[pulseaudio-discuss] Alsa's mixer interface with pulseaudio plugin

Wolfgang Rosenauer wolfgang at rosenauer.org
Tue Jul 29 03:01:58 PDT 2008


Colin Guthrie schrieb:
> Wolfgang Rosenauer wrote:
>> Hi,
>>
>> I'm just trying to implement a volume control using the Alsa mixer API.
>> That works already with plain ALSA but not if PA is used.
>> When using plain Alsa I'm getting the PCM mixer to work while with PA I 
>> found there is only a Master mixer available which I can get but the 
>> volume get functions are returning strange values.
>> I'm using
>>    snd_mixer_selem_get_playback_dB_range()
>>    snd_mixer_selem_get_playback_dB()
>> The range looks suspicious (1-140576480) but the reported volume is 0 
>> what makes no sense.
>>
>> So do I need to do something different for PA or won't it work anyway?
> 
> Wild guess, but perhaps some signed vs. unsigned issue?

So it's supposed to work at least?
That's the code snippet which gives the above values.

   long min, max;
   snd_mixer_selem_get_playback_dB_range(mVControl, &min, &max);

   long vleft, vright;
   snd_mixer_selem_get_playback_dB(mVControl, SND_MIXER_SCHN_FRONT_LEFT, 
&vleft);
   snd_mixer_selem_get_playback_dB(mVControl, 
SND_MIXER_SCHN_FRONT_RIGHT, &vright);


Wolfgang



More information about the pulseaudio-discuss mailing list