New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Razer Anansi : Invalid USB repsonse spamming #347

Closed
Linuxine opened this Issue Jul 28, 2017 · 8 comments

Comments

Projects
None yet
3 participants
@Linuxine

Linuxine commented Jul 28, 2017

I have installed the razer-drivers on Fedora 25 ; my Razer Anansi seems recognized, I can see it in interfaces such as RazerGenie or PolyChromatic Controller. But I am not able to set the colors or the brightness. When I try with the GUI, they show no error, but nothing happens, and when restarting them, the settings are gone. When I try to modify some file, for example :

echo -n "255" > matrix_brightness

The file is not modified, my brightness stays to 0.
The driver logs indicate that the request is sent :

2017-07-28 13:49:51 | razer.device0                  | DEBUG    | DBus call get_brightness

But nothing seems to be received by the keyboard. The logs in /var/log/messages are indicating in a loop the following error :

kernel: razer driver: Device data transfer failed.
kernel: razer driver: Invalid USB repsonse. USB Report length: -32
kernel: razerkbd: Invalid Report Length. Start Marker: 00 id: 00 Num Params: 00 Reserved: 00 Command: 00 Params: 0000000000000000000000
0000000000 .

This seems to be related to razer_send_control_msg and razer_get_usb_response in razercommon.c. But for razer_get_usb_response, the comment indicate that this function is compatible with the Chroma, Mamba, BlackWidow Ultimate 2013, and Firefly*, so is it normal to call in for my Anansi ?

Thanks a lot for your help !

@z3ntu z3ntu added the bug label Jul 28, 2017

@z3ntu

This comment has been minimized.

Show comment
Hide comment
@z3ntu

z3ntu Jul 28, 2017

Member

Can you please run

cd $(dirname /sys/bus/hid/drivers/razerkbd/0*/device_serial)
cat device_serial
cat device_mode
Member

z3ntu commented Jul 28, 2017

Can you please run

cd $(dirname /sys/bus/hid/drivers/razerkbd/0*/device_serial)
cat device_serial
cat device_mode
@Linuxine

This comment has been minimized.

Show comment
Hide comment
@Linuxine

Linuxine Jul 28, 2017

Hello, yes I forgot to add, strangely, the device_serial is empty... the mode and type are set, though.

/sys/bus/hid/drivers/razerkbd/0003:1532:010F.0016$ cat device_serial

/sys/bus/hid/drivers/razerkbd/0003:1532:010F.0016$ cat device_mode
0:0
/sys/bus/hid/drivers/razerkbd/0003:1532:010F.0016$ cat device_type 
Razer Anansi

Linuxine commented Jul 28, 2017

Hello, yes I forgot to add, strangely, the device_serial is empty... the mode and type are set, though.

/sys/bus/hid/drivers/razerkbd/0003:1532:010F.0016$ cat device_serial

/sys/bus/hid/drivers/razerkbd/0003:1532:010F.0016$ cat device_mode
0:0
/sys/bus/hid/drivers/razerkbd/0003:1532:010F.0016$ cat device_type 
Razer Anansi
@z3ntu

This comment has been minimized.

Show comment
Hide comment
@z3ntu

z3ntu Jul 28, 2017

Member

Are new messages appearing in dmesg when you run the cat command?

Member

z3ntu commented Jul 28, 2017

Are new messages appearing in dmesg when you run the cat command?

@Linuxine

This comment has been minimized.

Show comment
Hide comment
@Linuxine

Linuxine Jul 28, 2017

For both commands, (cat device_serial and cat device_mode), I get the same error in dmesg

[11719.617564] razer driver: Device data transfer failed.
[11719.618486] razer driver: Invalid USB repsonse. USB Report length: -32
[11719.618488] razerkbd: Invalid Report Length. Start Marker: 00 id: 00 Num Params: 00 Reserved: 00 Command: 00 Params: 00000000000000000000000000000000 .

Linuxine commented Jul 28, 2017

For both commands, (cat device_serial and cat device_mode), I get the same error in dmesg

[11719.617564] razer driver: Device data transfer failed.
[11719.618486] razer driver: Invalid USB repsonse. USB Report length: -32
[11719.618488] razerkbd: Invalid Report Length. Start Marker: 00 id: 00 Num Params: 00 Reserved: 00 Command: 00 Params: 00000000000000000000000000000000 .
@Linuxine

This comment has been minimized.

Show comment
Hide comment
@Linuxine

Linuxine Jul 28, 2017

I compiled the driver from the source, and added some print in razercommon.c, if this could help : I added in razer_send_control_msg the following line:

printk("send_control_msg len=%d size=%u\n");

and in razer_get_usb_response:

printk("get_usb_response len=%d size=%u\n");  

The log are displaying:

[20490.626426] send_control_msg len=500812384 size=488300
[20490.626428] razer driver: Device data transfer failed.
[20490.626596] get_usb_response len=0 size=393548
[20490.627433] razer driver: Invalid USB repsonse. USB Report length: -32
[20490.627442] razerkbd: Invalid Report Length. Start Marker: 00 id: 00 Num Params: 00 Reserved: 00 Command: 00 Params: 00000000000000000000000000000000 .
[20490.628197] input: Razer Razer Anansi as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.2/0003:1532:010F.001F/input/input84
[20490.629295] razerkbd 0003:1532:010F.001F: input,hidraw3: USB HID v1.11 Mouse [Razer Razer Anansi] on usb-0000:00:14.0-8/input2

Linuxine commented Jul 28, 2017

I compiled the driver from the source, and added some print in razercommon.c, if this could help : I added in razer_send_control_msg the following line:

printk("send_control_msg len=%d size=%u\n");

and in razer_get_usb_response:

printk("get_usb_response len=%d size=%u\n");  

The log are displaying:

[20490.626426] send_control_msg len=500812384 size=488300
[20490.626428] razer driver: Device data transfer failed.
[20490.626596] get_usb_response len=0 size=393548
[20490.627433] razer driver: Invalid USB repsonse. USB Report length: -32
[20490.627442] razerkbd: Invalid Report Length. Start Marker: 00 id: 00 Num Params: 00 Reserved: 00 Command: 00 Params: 00000000000000000000000000000000 .
[20490.628197] input: Razer Razer Anansi as /devices/pci0000:00/0000:00:14.0/usb1/1-8/1-8:1.2/0003:1532:010F.001F/input/input84
[20490.629295] razerkbd 0003:1532:010F.001F: input,hidraw3: USB HID v1.11 Mouse [Razer Razer Anansi] on usb-0000:00:14.0-8/input2
@Zerophase

This comment has been minimized.

Show comment
Hide comment
@Zerophase

Zerophase Aug 3, 2017

Contributor

Think I found the issue.

response and report index had their values changed. I'm guessing this could affect other keyboards as well.

    return razer_get_usb_response(usb_dev, 0x02, request_report, 0x02, response_report, RAZER_BLACKWIDOW_CHROMA_WAIT_MIN_US, RAZER_BLACKWIDOW_CHROMA_WAIT_MAX_US);

The twos were changed to ones.

return razer_get_usb_response(usb_dev, 0x01, request_report, 0x01, response_report, RAZER_BLACKWIDOW_CHROMA_WAIT_MIN_US, RAZER_BLACKWIDOW_CHROMA_WAIT_MAX_US);

I fixed the issue. This could possibly apply to other keyboards as well.

#349

Contributor

Zerophase commented Aug 3, 2017

Think I found the issue.

response and report index had their values changed. I'm guessing this could affect other keyboards as well.

    return razer_get_usb_response(usb_dev, 0x02, request_report, 0x02, response_report, RAZER_BLACKWIDOW_CHROMA_WAIT_MIN_US, RAZER_BLACKWIDOW_CHROMA_WAIT_MAX_US);

The twos were changed to ones.

return razer_get_usb_response(usb_dev, 0x01, request_report, 0x01, response_report, RAZER_BLACKWIDOW_CHROMA_WAIT_MIN_US, RAZER_BLACKWIDOW_CHROMA_WAIT_MAX_US);

I fixed the issue. This could possibly apply to other keyboards as well.

#349

@Linuxine

This comment has been minimized.

Show comment
Hide comment
@Linuxine

Linuxine Aug 3, 2017

Thanks a lot ! I tested your patch and now it works \o/ I am able to choose and apply the colors on my Anansi -. Thanks again for you responsiveness !

Linuxine commented Aug 3, 2017

Thanks a lot ! I tested your patch and now it works \o/ I am able to choose and apply the colors on my Anansi -. Thanks again for you responsiveness !

@Linuxine Linuxine closed this Aug 3, 2017

@z3ntu

This comment has been minimized.

Show comment
Hide comment
@z3ntu

z3ntu Aug 3, 2017

Member

Thanks @Zerophase

Member

z3ntu commented Aug 3, 2017

Thanks @Zerophase

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment