apri...@dkc-clan.de wrote: > Hi ossdevs, > > the kmix patch progressed further in my absense. However, there are still > plently of bugs with the implementation that need to be fixed. Those bugs are > actually only a consequence of my lack of knowledge about the OSSv4 mixer API. > So I've got the following questions (for now): > > 1) How do I find the proper maxium value of a control? > The docs mention that it's possible that actually only a discrete range of > values between ext.minvalue and ext.minvalue are supported by the underlying > device (with automatic rounding etc.). Now I've got an HD audio (ALC883) here > with the control "code1.jack.int-speaker1" of type MIXT_STEREOSLIDER [ + > MIXF_CENITBEL ], with minvalue 0 and maxvalue 399. However, the maximum value > (set with ossxmix before) reported when reading from the mixer is 299, which > is about 75% of maximum. I've browsed the source of ossxmix, but I don't > really understand how it does detect the actually supported maximum. > Currently the maxvalue-minvalue range is used by kmix and applied to the > respective slider. So with this approach 100% volume in ossxmix for this > control matches 75% in kmix, which is obviously wrong. I wonder whether a > better a approach for sliders would be to allow 0-100 only (or 0-1000 for > finer granularity) and write [ ext.minvalue + (sliderValue/100) * > (ext.maxvalue - ext.minvalue) ] to the mixer. > The actual value that the control can have (in ioctl calls) is between 0 and maxvalue for continuous controls like MIXT_STEREOSLIDER. For MIXT_ENUM maxvalue is the number of choices.
The minvalue field as well as flags like MIXF_CENTIBEL are used only when the value is displayed on screen. For example if the value is 100 then the application can print "10.0 dB" instead of just "100". However this is completely optional. > 2) How do I need to handle MIXT_HEXVALUE and MIXT_VALUE? > These types are currently only used in read-only controls that show the current sampling rate or some other values. The difference is that MIXT_VALUE is shown in decimal and MIXT_HEXVALUE in hexadecimal. http://manuals.opensound.com/developer/SNDCTL_MIX_EXTINFO.html gives some info about the control types. Scaling of the values is explained in http://manuals.opensound.com/developer/mixer_value_scaling.html . Best regards, Hannu _______________________________________________ oss-devel mailing list oss-devel@mailman.opensound.com http://mailman.opensound.com/mailman/listinfo/oss-devel