[wdmaudiodev] Re: Understanding USB Feature Unit Descriptors

Thanks for the replies guys, 

Very helpful insight. 



I do agree that a device applying that must gain would be absurd. 

My amplifier is able to attenuate the signal in 1 dB increments from 0 to -90 
dB. 



I would like to use the full -127db to +127db scale though, as I am trying to 
fit it to an existing volume mapping table.



The existing table takes a volume value from 0 - 255 and maps it to my 
amplifier's +0 to -90db range. 

I figured that if the Windows OS was able to provide me with a volume 
value in the range of -127db to +127db, I could take the 2's complement 
of that value and be left with a volume value in the range 0 - 255.



In XP this works great. The OS sends me volume values: 0x7FFF, 6FFF, 
5FFF, 4FFF, 3FFF, 2FFF, 1FFF, 0FFF, 0000, F000, E000, D000, C000, B000, 
A000, 9000, 8000, I take the 2's complement of these values, look at the
 MSB, and am left with my 0x00 - 0xFF range (I am just looking for a raw
 number, don't care about db). 



Vista/7 seem to do something other than XP, as I am seeing volume values like: 
0x7FFF, 7EFF, 7DFF, 7CFF, 7BFF, 7AFF,... 0x39FF



From Tim's summary, I got that Windows XP didn't care what my GET_MIN, 
GET_MAX, and GET_RES values were, and gave me the full range. However, 
Windows Vista/7 do care and try to limit the values to a realistic 
range. Is this the case?

----- Original Message -----
From: Tim Roberts <timr@xxxxxxxxx>
Date: Friday, January 14, 2011 1:51 pm
Subject: [wdmaudiodev] Re: Understanding USB Feature Unit Descriptors
To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>

> Tim Roberts wrote:
> > RYAN ALLAN wrote:
> >> This tells me that the volume will be in the range from 
> Min:0x8001 to
> >> Max:0x7FFFF, and each step (each time the volume is 
> incremented via
> >> volume+ button on a multimedia keyboard) will be of size 
> Res:0x1000.>> Is this correct?
> >
> > Can your device really apply 120dB of gain to the 
> signal?  That's a
> > big amplifier -- a billion to 1 increase.  Most volume 
> controls are
> > strictly attenuators, so the maximum gain value is 0.
> 
> Allow me to provide an executive summary of what both DJ and I 
> have said.
> 
> The spec for volume controls has always been in dB of gain or
> attenuation, both for USB devices and for Windows audio 
> devices.  In the
> past, many developers ignored this and simply made it a unitless 
> number,from some meaningless low number to some meaningless high 
> number.  That
> resulted in confusion.  Starting in Vista, the sound team 
> made the
> conscious decision to have dB really mean dB, in a real world 
> sense. 
> That means most of the range is nonsense.
> 
> The right answer is to change your min and max to reflect the actual
> attenuation range of your device.
> 
> -- 
> Tim Roberts, timr@xxxxxxxxx
> Providenza & Boekelheide, Inc.
> 
> 

--
Ryan Allan


Other related posts: