I have a pair of cheap USB powered speakers from Logitech, model S-150. They work reasonably well, except for the volume control which is way off. Only the initial few steps actually do anything and anything above that is full blast. Here's what I can see in dmesg: [ 3.017511] usb 1-1: new full-speed USB device number 2 using xhci_hcd [ 3.181389] usb 1-1: New USB device found, idVendor=1130, idProduct=1620 [ 3.181397] usb 1-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [ 3.181402] usb 1-1: Product: USB AUDIO [ 3.181647] usb 1-1: ep 0x82 - rounding interval to 64 microframes, ep desc says 80 microframes [ 3.195480] input: USB AUDIO as /devices/pci0000:00/0000:00:10.0/usb1/1-1/1-1:1.2/0003:1130:1620.0001/input/input2 [ 6.598245] usb 1-1: Warning! Unlikely big volume range (=17152), cval->res is probably wrong. [ 6.598254] usb 1-1: [2] FU [PCM Playback Volume] ch = 2, val = 0/17152/1
The number of steps 17152 is too large, this mean dB per step is less than 1/256, you need to increase cval->res so that dB range is correct
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/usb?id=a5c7d797dcce3be5e77cd6ea62cc4920ededc32b You need similar patch for pcm playback volume
17152 = 67 * 256 this mean cval->res = 256 you have to recompile the alsa driver to set cval->res to 256 to get (0 to 67 steps )
http://mailman.alsa-project.org/pipermail/alsa-devel/2013-December/070169.html
(In reply to Raymond from comment #3) > 17152 = 67 * 256 > > this mean cval->res = 256 > > you have to recompile the alsa driver to set cval->res to 256 to get (0 to > 67 steps ) This gets a range that seems reasonable. The steps are however very unlinear so I'm wondering if the dB information is wonky as well. Any pointers on how to adjust that? I tried fiddling with cval->min/max but that just make things to nuts.
Created attachment 199081 [details] volume step patch
https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/patch/sound/usb?id=42e3121d90f42e57f6dbd6083dff2f57b3ec7daa You can use DECLARE_TLV_DB_RANGE to define a set of dB ranges
Could you cook up a proper patch? Then I'm willing to merge to the upstream.
Sorry about dropping the ball on this. I got rid of these speakers so I didn't pursue a fix further. Feel free to close this issue if you want.
Hi, This seems to the same as bug 72511. I just bought the Logitech S-150 and also have volume control problems. In Pulseaudio mixer, the volume is basically: 0-9%: silent 10-20%: rapidly increasing 20-100%: nearly full volume My cval ranges are different than the original report (same VID, PID): [1044202.587605] usb 5-1.1.3: new full-speed USB device number 10 using xhci_hcd [1044202.821372] usb 5-1.1.3: New USB device found, idVendor=1130, idProduct=1620, bcdDevice= 1.87 [1044202.821375] usb 5-1.1.3: New USB device strings: Mfr=0, Product=2, SerialNumber=0 [1044202.821376] usb 5-1.1.3: Product: USB AUDIO [1044202.927882] usb 5-1.1.3: [2] FU [PCM Playback Switch] ch = 1, val = 0/1/1 [1044202.929123] usb 5-1.1.3: [2] FU [PCM Playback Volume] ch = 2, val = -16224/-16/48 which looks bogus (338.33 steps?) The chip is the TP6902 and the manufacturer's website claims it has 64 levels of volume control. https://www.tenx.com.tw/product_detail.aspx?ProductID=128
For what it's worth, my workaround is to just configure pulseaudio to use software mixing (and leave the volume set to 100% at the ALSA layer) # cat /etc/udev/rules.d/90-jim-usbaudio.rules SUBSYSTEM=="sound", ACTION=="change", KERNEL=="card*", SUBSYSTEMS=="usb", \ ATTRS{idVendor}=="1130", ATTRS{idProduct}=="1620", \ ENV{PULSE_PROFILE_SET}="/etc/pulse/profile-swmix.conf" # cat /etc/pulse/profile-swmix.conf [General] auto-profiles = yes [Mapping swmix-stereo] description = Stereo (software volume control) device-strings = hw:%f channel-map = left,right paths-output = /etc/pulse/path-swmix-output # cat /etc/pulse/path-swmix-output.conf [General] description = Stereo [Element PCM] switch = mute volume = ignore