[oss-devel] wrong documentation for MIXT_SLIDER in oss4 mixer api?
Hannu Savolainen
hannu at opensound.com
Mon Feb 25 09:06:43 EET 2008
apriori at dkc-clan.de kirjoitti:
> Hi all,
>
> I'm currently hacking around in kmix to add at least basic OSS4 support. I've
> got an usb device with a output.vol control with a value range of 0 - 37. I
> of course get values much higher than that when reading from the mixer
> device.
The documentation is correct. Values returned by the mixer should never
be higher than the maximum value.
However there appears to be a bug in the USB driver or in the device you
have. For some reason the maximum value is not correvt.
> The normal procedure as shown in the doc and in the ossmix source is
> to clamp (is that the right word?) with a bitmask.
>
It is actually not "clamping". Many mixer control types return the
values for both channels in a single integer. For this reason the
application needs to extract the correct bits.
> According to the documentation the value is a 31 bit positive integer,
> therefore the bitmask should be 0xFFFFFFFE - but that would be wrong, because
> I'd get values of about 9k, whereas I need 0 - 37, which I get when using the
> bitmask 0xFF and AND the value with it.
> What's wrong here, me or the documentation?
>
There is no particular reason to use any bit mask for MIXT_SLIDER since
the whole integer is used for the value. If you use a bit mask then it
should be 0x7FFFFFFF instead of 0xFFFFFFFE.
Best regards,
Hannu
More information about the oss-devel
mailing list