flozz / rivalcfg

CLI tool and Python library to configure SteelSeries gaming mice
https://flozz.github.io/rivalcfg/
Do What The F*ck You Want To Public License
761 stars 62 forks source link

Sensei TEN has an undocumented LED intensity command #159

Open ali1234 opened 3 years ago

ali1234 commented 3 years ago

This isn't really a bug, but more of a warning, and maybe rivalcfg can support it with a warning that the Windows software can't change this setting.

Sensei TEN has an undocumented LED intensity command [0x09, 0x00]. Notice that this clashes with the SAVE command on other Steelseries mice. If you try to use the wrong protocol to talk to this mouse, it is possible to save the settings while the intensity is set to zero. At this point you will not be able to make the LEDs turn on no matter what you do. I say this command is undocumented because not even the Windows Steelseries software can fix it. I suspect it is used for the audio sync functionality.

The report seems to take a short parameter, ie two bytes, low byte first. Experimentally, if you set the LEDs a breathing animation, setting the intensity to 258 will produce the maximum output range. Any higher and the breathing animation "wraps" ie it jumps back to zero on the way up and jumps back to maximum on the way down.

The intensity setting is only saved if you send a real save request, like all other settings.

If like me you have accidentally broken your mouse like this, here is some python code to set the intensity. I recommend setting the intensty to 256 - that 258 doesn't wrap around is probably the result of a rounding error somewhere in the firmware, and there is no visible difference anyway.

from rivalcfg.mouse import get_mouse
from rivalcfg.usbhid import HID_REPORT_TYPE_OUTPUT

mouse = get_mouse(vendor_id=0x1038, product_id=0x1832)
i = 256
mouse._hid_write(HID_REPORT_TYPE_OUTPUT, data=[0x09, 0x00, i&0xff, i>>8])
mouse.save()

Anyway, I spent a whole day figuring this out, so hopefully this will help someone else.

ali1234 commented 3 years ago

As discussed on Discord, some text to add to sensei ten docs:

Troubleshooting
---------------

Problem: LEDs will not respond to any command.

This mouse has a hidden command to set the LED intensity. Using the wrong communication protocol can lead to the LED intensity being permanently programmed to 0. After this, you won't be able to make the LEDs switch on with either rivalcfg or with the Windows SteelSeries Engine software. However, it can be fixed using rivalcfg Python API and the following snippet of Python code:

(Followed by the snipped from previous comment.)