Bug 72511 - Logitech S-150: Unlikely big volume range (=17152), cval->res is probably wrong
Summary: Logitech S-150: Unlikely big volume range (=17152), cval->res is probably wrong
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Sound(ALSA) (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Jaroslav Kysela
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-19 19:14 UTC by Federico Leva
Modified: 2015-03-08 04:28 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.13.6-200.fc20.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
alsa-info (50.15 KB, text/plain)
2014-03-19 19:14 UTC, Federico Leva
Details

Description Federico Leva 2014-03-19 19:14:44 UTC
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
Comment 1 Raymond 2014-03-20 02:02:37 UTC
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
Comment 2 Raymond 2014-03-20 02:06:24 UTC
it is strange that "PCM playback Volume" only have gain dBmin=0, dBmax=6700


do you have the specification of your logitech S-150 ?
Comment 3 Pierre Ossman 2015-03-01 12:00:33 UTC
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.
Comment 4 Pierre Ossman 2015-03-01 12:03:12 UTC
More info:

http://permalink.gmane.org/gmane.linux.alsa.devel/116518

Sounds like 0x43 might be the proper value.
Comment 5 Raymond 2015-03-01 13:17:03 UTC
since 17152 = 67 * 256

if  c->res = 256, the effective range will be 0 to 67 ,  this fit dB range -67 to 0
Comment 6 Raymond 2015-03-01 13:25:05 UTC
seem dB range is shifted , you need not just fix  res but also shift dB min from 0 to -67
Comment 7 Raymond 2015-03-01 15:11:58 UTC
	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
Comment 8 Pierre Ossman 2015-03-06 16:47:51 UTC
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?
Comment 9 Raymond 2015-03-08 01:26:25 UTC
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;
Comment 10 Raymond 2015-03-08 01:37:38 UTC
or change value after the calculation

if (shift_dB) {
   cval->dBmin -= cval->dBmax;
   cval->dBmax =0;
}
Comment 11 Raymond 2015-03-08 04:28:35 UTC
cval->dBmin = (convert_signed_value(cval, cval->min - shift_base) * 100) / 256;
cval->dBmax = (convert_signed_value(cval, cval->max - shift_base) * 100) / 256;

Note You need to log in before you can comment on or make changes to this bug.