Kernel has troule recognizing Corsair Strafe RGB keyboard

Bug #1678477 reported by Ubiratan Pires Alberton on 2017-04-01
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Medium
Kai-Heng Feng
Zesty
Undecided
Unassigned

Bug Description

I recently bought a Corsair Strafe RGB keyboard, and while it works well when successfully recognized by Ubuntu at boot, that doesn't always happen.

I see messages like this when booting my desktop up:

[ 6.619510] usb 3-10: unable to read config index 0 descriptor/all
[ 6.619543] usb 3-10: can't read configurations, error -110

They sometimes repeat at 5-second intervals, culminating on a "can't set config #1" message or even "unable to enumerate USB device". This happens on the logic that deals with a new USB device being connected, so when it doesn't work it never gets to the HID drivers part of the code. When it does, hid-generic is quite able to control the keyboard, though this message appears on dmesg:

[ 6.883811] usbhid 3-10:1.2: couldn't find an input interrupt endpoint

From what I have been able to determine, the Corsair Strafe RGB has three inputs, with the last one being used as input/output and having something to do with the LEDs. It only has a single USB configuration, though I don't know why it times out.

Searching on Google has a lot of people recommending this userspace drive to me: https://github.com/mattanger/ckb-next , and I've tried it, but it seems to be more about programming lighting effects into the keyboard than in controlling its basic operation, which is all I'm interested in. Its daemon was supposed to handle that part too, but it didn't fix those connection errors on boot.

I have the following boot parameter set in my kernel, following advice from ckb-next's README, but it doesn't see to have an appreciable effect on my success rate:

usbhid.quirks=0x1B1C:0x1B20:0x20000448

ckb-next recommended 0x20000408, but I added the HID_QUIRK_MULTI_INPUT as well in an attempt to improve things, without success.

GRUB is always able to correctly identify the keyboard and get it to work, too, which makes the fact that the full kernel can't always do it a little more frustrating.

I would be happy to provide any extra information you require on this issue.

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: linux-image-4.8.0-45-generic 4.8.0-45.48
ProcVersionSignature: Ubuntu 4.8.0-45.48-generic 4.8.17
Uname: Linux 4.8.0-45-generic x86_64
NonfreeKernelModules: nvidia_uvm nvidia_drm nvidia_modeset nvidia
ApportVersion: 2.20.3-0ubuntu8.2
Architecture: amd64
AudioDevicesInUse:
 USER PID ACCESS COMMAND
 /dev/snd/controlC1: bira 2322 F.... pulseaudio
 /dev/snd/controlC0: bira 2322 F.... pulseaudio
CurrentDesktop: i3
Date: Sat Apr 1 10:23:52 2017
EcryptfsInUse: Yes
InstallationDate: Installed on 2015-02-24 (767 days ago)
InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
IwConfig:
 eth0 no wireless extensions.

 lo no wireless extensions.
MachineType: Gigabyte Technology Co., Ltd. Z97M-D3H
ProcFB:

ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-4.8.0-45-generic root=UUID=d1db423d-2a50-49ac-b4e7-fd50d73afaff ro quiet splash usbhid.quirks=0x1B1C:0x1B20:0x20000448
RelatedPackageVersions:
 linux-restricted-modules-4.8.0-45-generic N/A
 linux-backports-modules-4.8.0-45-generic N/A
 linux-firmware 1.161.1
RfKill:

SourcePackage: linux
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 05/30/2014
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: F5
dmi.board.asset.tag: To be filled by O.E.M.
dmi.board.name: Z97M-D3H
dmi.board.vendor: Gigabyte Technology Co., Ltd.
dmi.board.version: x.x
dmi.chassis.asset.tag: To Be Filled By O.E.M.
dmi.chassis.type: 3
dmi.chassis.vendor: Gigabyte Technology Co., Ltd.
dmi.chassis.version: To Be Filled By O.E.M.
dmi.modalias: dmi:bvnAmericanMegatrendsInc.:bvrF5:bd05/30/2014:svnGigabyteTechnologyCo.,Ltd.:pnZ97M-D3H:pvrTobefilledbyO.E.M.:rvnGigabyteTechnologyCo.,Ltd.:rnZ97M-D3H:rvrx.x:cvnGigabyteTechnologyCo.,Ltd.:ct3:cvrToBeFilledByO.E.M.:
dmi.product.name: Z97M-D3H
dmi.product.version: To be filled by O.E.M.
dmi.sys.vendor: Gigabyte Technology Co., Ltd.

This change was made by a bot.

Changed in linux (Ubuntu):
status: New → Confirmed
Joseph Salisbury (jsalisbury) wrote :

Would it be possible for you to test the latest upstream kernel? Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Please test the latest v4.11 kernel[0].

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

Once testing of the upstream kernel is complete, please mark this bug as "Confirmed".

Thanks in advance.

[0] http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.11-rc5

Changed in linux (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete

Tested with 4.11.rc5, and still found this issue. Took me three tries to get the keyboard to work, with the same messages and all the same config options as above.

tags: added: kernel-bug-exists-upstream

Another possibly useful bit of information: I have the keyboard connected to a USB 3.0 port - this model requires either a USB 3.0 port or 2 USB 2.0 ports, because it draws more power than a USB 2.0 port provides.

I tested it a few days ago but forgot to mark it as "Complete", sorry about that. To further add information to my previous comment here, the bug I described occurs both when the keyboard is plugged into a USB 3.0 port and when it's plugged into 2 USB 2.0 ports.

Changed in linux (Ubuntu):
status: Incomplete → Confirmed

s/"Complete"/"Confirmed"/

Cuppa-Chino (hamcatcher) wrote :

I can confirm the bug (also with it plugged into 2 USB 3.0 ports btw).

Interestingly I can get it recognised by unplugging it and then replugging it in at the log on screen:

$ dmesg | grep 'usb 3-6'
[ 1.679455] usb 3-6: new full-speed USB device number 4 using xhci_hcd
[ 6.871136] usb 3-6: unable to read config index 0 descriptor/all
[ 6.871138] usb 3-6: can't read configurations, error -110
[ 6.991019] usb 3-6: new full-speed USB device number 5 using xhci_hcd
[ 12.246642] usb 3-6: unable to read config index 0 descriptor/all
[ 12.246644] usb 3-6: can't read configurations, error -110
[ 12.366555] usb 3-6: new full-speed USB device number 6 using xhci_hcd
[ 17.622145] usb 3-6: unable to read config index 0 descriptor/all
[ 17.622147] usb 3-6: can't read configurations, error -110
[ 17.742093] usb 3-6: new full-speed USB device number 7 using xhci_hcd
[ 22.997715] usb 3-6: unable to read config index 0 descriptor/all
[ 22.997716] usb 3-6: can't read configurations, error -110
[ 68.195240] usb 3-6: new full-speed USB device number 11 using xhci_hcd
[ 68.337459] usb 3-6: New USB device found, idVendor=1b1c, idProduct=1b20
[ 68.337463] usb 3-6: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 68.337466] usb 3-6: Product: Corsair STRAFE RGB Gaming Keyboard
[ 68.337468] usb 3-6: Manufacturer: Corsair
[ 68.337470] usb 3-6: SerialNumber: 0F013021AEB8046755A93ED3F5001941

For me, whether the keyboard will work or not seems random: sometimes it works right away, sometimes it works after replugging it once, sometimes it takes multiple attempts. The error messages are the same ones you posted.

Luca Cireddu (sardylan) wrote :

Same problem for me using Ubuntu Zesty (17.04)
I noticed two different types of error:
The first one has error code -71, and I don't know what does it means:

Jul 15 10:15:17 achille kernel: [ 202.060450] usb 3-14: new full-speed USB device number 14 using xhci_hcd
Jul 15 10:15:18 achille kernel: [ 202.800931] usb 3-14: unable to read config index 0 descriptor/all
Jul 15 10:15:18 achille kernel: [ 202.800934] usb 3-14: can't read configurations, error -71

The second one has code -110, which seems to be related to a current drain problem:

Jul 15 10:15:24 achille kernel: [ 209.099650] usb 3-14: new full-speed USB device number 16 using xhci_hcd
Jul 15 10:15:30 achille kernel: [ 214.483027] usb 3-14: unable to read config index 0 descriptor/all
Jul 15 10:15:30 achille kernel: [ 214.483029] usb 3-14: can't read configurations, error -110

This USB keyboard has two USB plugs, one for data and one for power. I connected both of them to different USB ports in order to have enough power, but the problem persists.

No problems occurs during UEFI boot, on Grub menu and using other Linux distributions (some tests on Slackware and Debian, but only for few minutes on "live boot"). Even Windows seems to have no problems.

Can it be some power management problem of ubuntu linux kernel?
During boot (after Grub), the keyboard leds shut off until all kernel modules are loaded. After that there are two possible behaviours: everything works fine, or keyboard doesn't works and you have these messages on syslog.

I upgraded to Ubuntu 17.04 a couple of weeks ago, and the problem persisted under its version of kernel 4.10.

I just installed all the four packages in the link above, and booted into the new Kernel on Ubuntu 17.04. The problem still persists. This is the output of 'dmesg | grep "usb 3-3"' shortly after boot under this kernel, where usb 3-3 is the USB 3.0 port where the keyboard is plugged in:

[ 1.017724] usb 3-3: new full-speed USB device number 2 using xhci_hcd
[ 6.369206] usb 3-3: unable to read config index 0 descriptor/all
[ 6.369238] usb 3-3: can't read configurations, error -110
[ 6.489148] usb 3-3: new full-speed USB device number 3 using xhci_hcd
[ 11.744636] usb 3-3: unable to read config index 0 descriptor/all
[ 11.744675] usb 3-3: can't read configurations, error -110
[ 11.864580] usb 3-3: new full-speed USB device number 4 using xhci_hcd
[ 17.124668] usb 3-3: unable to read config index 0 descriptor/all
[ 17.124705] usb 3-3: can't read configurations, error -110
[ 17.252017] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[ 22.495509] usb 3-3: unable to read config index 0 descriptor/all
[ 22.495512] usb 3-3: can't read configurations, error -110

[ 39.338187] usb 3-3: new full-speed USB device number 8 using xhci_hcd
[ 39.479693] usb 3-3: New USB device found, idVendor=1b1c, idProduct=1b20
[ 39.479695] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 39.479696] usb 3-3: Product: Corsair STRAFE RGB Gaming Keyboard
[ 39.479696] usb 3-3: Manufacturer: Corsair
[ 39.479697] usb 3-3: SerialNumber: 0B03F020AEBD18445619787AF5001946

The last set of messages is where I unplugged the keyboard and plugged back in.

Luca Cireddu (sardylan) wrote :

I'm using the keyboard using Ubuntu 17.04 stock kernel with an external, independent powered, usb 2.0. It has a 3.0 Ampere power supply, not so big for these days, but powerful enough to avoid power problems for this keyboard.
I'm using it for a while, several reboots and power-cycles, and I haven't had any error in dmesg, yet.
It seems to confirm that it is a problem of power management on usb ports...

Kai-Heng Feng (kaihengfeng) wrote :

@Luca,

Does the issue happen on Windows, if there's no auxiliary power?

Luca Cireddu (sardylan) wrote :

@Kai-Heng Feng,
i had this keyb for more than one year, and in windows I never had a problem like this. I often switch OS rebooting the whole machine, and no problem occures even in UEFI and/or GRUB menu at boot...
Problem occures only in Ubuntu after kernel module loading.

I started using an external-powered USB Hub only only 2 or 3 weeks ago, and it seems that the problem never occures. But I know it's only a workaround, because the problem in kernel still exists.

I can also confirm that I've never experienced the problem on Windows or on the GRUB menu, both with the keyboard plugged into a single USB 3.0 and into 2 USB 2.0 ports.

Frits Jalvingh (fjalvingh) wrote :

Thanks @Kai-Heng Feng for your help. I have installed your kernel and it does seem to work. The boot does not delay for 30 or more seconds anymore, and the keyboard is usable immediately after boot. It still nags a bit:

[ 2.249880] usb 3-1: New USB device found, idVendor=1b1c, idProduct=1b20
[ 2.249881] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2.249882] usb 3-1: Product: Corsair STRAFE RGB Gaming Keyboard
[ 2.249882] usb 3-1: Manufacturer: Corsair
[ 2.249883] usb 3-1: SerialNumber: 1303D038AEA7A44454E1B806F5001944
[ 2.252101] hidraw: raw HID events driver (C) Jiri Kosina
[ 2.254100] usbhid 3-1:1.2: couldn't find an input interrupt endpoint

but so far it seems to work well. I will watch it for a while and report back if there is still trouble.

I've also installed the linked kernel today, and verified it works for me as well! The keyboard was detected correctly every time through multiple unpluggings and reboots, with output similar to what Frits pasted above. I too always get the "couldn't find an interrupt endpoint" message, but other than the device seems to work well.

I'll keep using this kernel and will report if the problem appears again.

Kai-Heng Feng (kaihengfeng) wrote :

I added three quirks for the keyboard. Thanks to comment #13, I guess the keyboard doesn't like LPM.

Let's try if USB_QUIRK_NO_LPM alone can make the keyboard work:
http://people.canonical.com/~khfeng/lp1678477-nolpm/

Kai-Heng Feng (kaihengfeng) wrote :

The endpoint issue will probably need another quirk in usbhid, like this commit:

commit 282bf1fe6dca4b768d6bedc14aea1b82c36241c1
Author: Trent Lloyd <email address hidden>
Date: Thu Jul 9 13:38:50 2015 +0800

    HID: usbhid: quirks for Corsair RGB keyboard & mice (K70R, K95RGB, M65RGB, K70RGB, K65RGB)

But let's deal with this later.

With the kernels from http://people.canonical.com/~khfeng/lp1678477-nolpm/ , the problem seems to have returned. I got the following error on boot:

[ 1.273005] usb 3-9: new full-speed USB device number 3 using xhci_hcd
[ 11.740700] usb 3-9: string descriptor 0 read error: -110
[ 11.740733] usb 3-9: New USB device found, idVendor=1b1c, idProduct=1b20
[ 11.740734] usb 3-9: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 16.860817] usb 3-9: can't set config #1, error -110

Unplugging and re-plugging the keyboard also gives me similar error messages on dmesg. More often than not it will eventually work on one of the retries, but sometimes it will fail three times in a row and stop. I guess one or more of the other two quirks are necessary too.

Kai-Heng Feng (kaihengfeng) wrote :

Try these two:
http://people.canonical.com/~khfeng/lp1678477-dealyinit/
http://people.canonical.com/~khfeng/lp1678477-devicequalifier/

Basically, the one that worked has three quirks applied:

diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
index 3116edfcdc18..ff3c70fd919e 100644
--- a/drivers/usb/core/quirks.c
+++ b/drivers/usb/core/quirks.c
@@ -214,6 +214,10 @@ static const struct usb_device_id usb_quirk_list[] = {
        { USB_DEVICE(0x1a0a, 0x0200), .driver_info =
                        USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },

+ /* Corsair Strafe RGB */
+ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT |
+ USB_QUIRK_NO_LPM | USB_QUIRK_DEVICE_QUALIFIER },
+
        /* Acer C120 LED Projector */
        { USB_DEVICE(0x1de1, 0xc102), .driver_info = USB_QUIRK_NO_LPM },

If the kernels I built do not work, you need to find out what combination of quirks that can make it work.

The "delayinit" kernel seems to work! The keyboard is usable when the computer first boots, and every time I unplug and plug it back in. I did that while following the output of dmesg -w and got the following:

[ 80.205969] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[ 81.468240] usb 3-3: New USB device found, idVendor=1b1c, idProduct=1b20
[ 81.468244] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 81.468246] usb 3-3: Product: Corsair STRAFE RGB Gaming Keyboard
[ 81.468247] usb 3-3: Manufacturer: Corsair
[ 81.468249] usb 3-3: SerialNumber: 0B03F020AEBD18445619787AF5001946
[ 86.703197] input: Corsair Corsair STRAFE RGB Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.0/0003:1B1C:1B20.0005/input/input23
[ 86.703780] hid-generic 0003:1B1C:1B20.0005: input,hidraw0: USB HID v1.11 Keyboard [Corsair Corsair STRAFE RGB Gaming Keyboard] on usb-0000:00:14.0-3/input0
[ 86.705875] input: Corsair Corsair STRAFE RGB Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:1B1C:1B20.0006/input/input24
[ 86.706203] input: Corsair Corsair STRAFE RGB Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:1B1C:1B20.0006/input/input25
[ 86.706403] input: Corsair Corsair STRAFE RGB Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:1B1C:1B20.0006/input/input26
[ 86.706640] input: Corsair Corsair STRAFE RGB Gaming Keyboard as /devices/pci0000:00/0000:00:14.0/usb3/3-3/3-3:1.1/0003:1B1C:1B20.0006/input/input27
[ 86.706854] hid-generic 0003:1B1C:1B20.0006: input,hiddev0,hidraw1: USB HID v1.11 Keyboard [Corsair Corsair STRAFE RGB Gaming Keyboard] on usb-0000:00:14.0-3/input1
[ 86.706941] usbhid 3-3:1.2: couldn't find an input interrupt endpoint

I haven't tried the devicequalifier kernel yet, will try that now.

The "devicequalifier" kernel doesn't appear to work. It presents a similar error either on boot or when hot-plugging the keyboard:

[ 37.680914] usb 3-3: new full-speed USB device number 5 using xhci_hcd
[ 48.097499] usb 3-3: New USB device found, idVendor=1b1c, idProduct=1b20
[ 48.097505] usb 3-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 48.097508] usb 3-3: Product: Corsair STRAFE RGB Gaming Keyboard
[ 48.097510] usb 3-3: Manufacturer: Corsair
[ 51.331414] usb 3-3: can't set config #1, error -71

The error code has changed from -110 to -71, but the behavior seems to be very similar to that of the original bug.

Kai-Heng Feng (kaihengfeng) wrote :

Now we can confirm that USB_QUIRK_DELAY_INIT along can workaround this issue, I'll send a patch to Linux upstream.

Piotr Sowiński (psow86) wrote :

I'm using a slightly different variant of this keyboard - Corsair Strafe (without RGB; product ID is 1b15). I had more or less the same problem (error -110). I tried your solution (USB_QUIRK_DELAY_INIT) and it seems to work every time. I did a quick test - previously keyboard worked 5 out of 10 reboots, and after applying this change it worked 10 out of 10 reboots (I also get this new message during boot, like others did before - "couldn't find an input interrupt endpoint").

As this keyboard has a different product ID (but the same vendor ID), it will probably require additional entry in the drivers/usb/core/quirks.c

Please let me know if you need any additional info or tests from me.

Kai-Heng Feng (kaihengfeng) wrote :

@Piotr,
File a new bug, thanks!

Changed in linux (Ubuntu):
assignee: nobody → Kai-Heng Feng (kaihengfeng)
Stefan Bader (smb) on 2017-09-15
Changed in linux (Ubuntu Zesty):
status: New → Fix Committed
Changed in linux (Ubuntu):
status: Confirmed → Fix Released

This bug is awaiting verification that the kernel in -proposed solves the problem. Please test the kernel and update this bug with the results. If the problem is solved, change the tag 'verification-needed-zesty' to 'verification-done-zesty'. If the problem still exists, change the tag 'verification-needed-zesty' to 'verification-failed-zesty'.

If verification is not done by 5 working days from today, this fix will be dropped from the source code, and this bug will be closed.

See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you!

tags: added: verification-needed-zesty

I am on 17.04 - I've just installed the proposed kernel (4.10.36) and verified that it does indeed solve my problem. My keyboard works through multiple reboots and "re-pluggings" as described above.

tags: added: verification-done-zesty
removed: verification-needed-zesty
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers