Created attachment 130061 [details] alsa-info [90867.979176] usb 4-1: new full-speed USB device number 5 using ohci-pci [90868.126021] usb 4-1: New USB device found, idVendor=1130, idProduct=1620 [90868.126039] usb 4-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [90868.126048] usb 4-1: Product: USB AUDIO [90868.166138] ALSA sound/usb/mixer.c:1303 usb_audio: Warning! Unlikely big volume range (=17152), cval->res is probably wrong. [90868.166154] ALSA sound/usb/mixer.c:1307 usb_audio: [2] FU [PCM Playback Volume] ch = 2, val = 0/17152/1 [90868.173336] input: USB AUDIO as /devices/pci0000:00/0000:00:12.0/usb4/4-1/4-1:1.2/input/input17 [90868.174371] hid-generic 0003:1130:1620.0005: input,hidraw0: USB HID v1.10 Device [USB AUDIO ] on usb-0000:00:12.0-1/input2 $ uname -a Linux $host 3.13.6-200.fc20.x86_64 #1 SMP Fri Mar 7 17:02:28 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
USB Mixer: usb_id=0x11301620, ctrlif=0, ctlerr=0 Card: USB AUDIO at usb-0000:00:12.0-1, full speed Unit: 2 Control: name="PCM Playback Volume", index=0 Info: id=2, control=2, cmask=0x3, channels=2, type="S16" Volume: min=0, max=17152, dBmin=0, dBmax=6700 you have to provide a proper value if you think this usb audio device cannot provide resolution of 67dB/17152 per step
it is strange that "PCM playback Volume" only have gain dBmin=0, dBmax=6700 do you have the specification of your logitech S-150 ?
This might be relevant given that it is a logitech device: https://lkml.org/lkml/2013/6/17/572 I don't think there are any specifications available.
More info: http://permalink.gmane.org/gmane.linux.alsa.devel/116518 Sounds like 0x43 might be the proper value.
since 17152 = 67 * 256 if c->res = 256, the effective range will be 0 to 67 , this fit dB range -67 to 0
seem dB range is shifted , you need not just fix res but also shift dB min from 0 to -67
case USB_ID(0x1130, 0x1620): if (!strcmp(kctl->id.name, "PCM Playback Volume")) { usb_audio_info(chip, "set volume quirk for S150\n"); cval->res = 256; } break; you may need to ask the usb audio author how to change dBmin and dBmax
Your suggested quirk does indeed fix the volume range. The dB is derived from the min and max values, so it's not as easily changed. Tweaking min and max makes the device very upset. So I guess we'll most likely have to live with the bad dB info?
this mean you need a flag to indicate the rule need to be changed (e.g. subtract cval->max from both to let cval->dBmax become zero) cval->dBmin = (convert_signed_value(cval, cval->min) * 100) / 256; cval->dBmax = (convert_signed_value(cval, cval->max) * 100) / 256;
or change value after the calculation if (shift_dB) { cval->dBmin -= cval->dBmax; cval->dBmax =0; }
cval->dBmin = (convert_signed_value(cval, cval->min - shift_base) * 100) / 256; cval->dBmax = (convert_signed_value(cval, cval->max - shift_base) * 100) / 256;