Skip to content
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

Support Razer Pro Type Ultra keyboard #2136

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yuvalpoliti
Copy link

@yuvalpoliti yuvalpoliti commented Sep 23, 2023

Add support for Razer Pro Type Ultra wired and wireless.

Notes:

  • Razer Synapse supports software FN toggle, but the latest keyboard's firmware supports it at the firmware level, so I didn't bother adding it to the driver (if anyone wonders, it's FN+ESC).
  • When using the keyboard wirelessly, changing the matrix effect or brightness, fails with timeout timeout, even when the sleep between requests is disabled, I captured the USB traffic on my Ubuntu machine, and on a Windows VM, and on Windows it takes the keyboard significantly less time to ACK the request. It could be an issue only on my setup, so I decided to include the fix in the PR and consider it supported.

Fixes #1776

@z3ntu z3ntu added need pcap USB traffic packet captures are useful - see wiki "Reverse Engineering USB Protocol" Device Support and removed need pcap USB traffic packet captures are useful - see wiki "Reverse Engineering USB Protocol" labels Sep 24, 2023

USB_VID = 0x1532
USB_PID = 0x0277
METHODS = ['get_device_type_keyboard', 'set_static_effect', 'set_breath_single_effect', 'get_battery', 'is_charging', 'get_keyboard_layout']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The device really doesn't support more effects than this? At least set_none_effect maybe to turn off the lighting? Or brightness controls?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has brightness controls, both classes inherit RazerDeviceBrightnessSuspend so there's no need to declare those methods in the METHODS property.
Here are a few screenshots of that device from Razer Synapse on Windows to view the exact functionality:

Screenshot 2023-09-25 230124

Screenshot 2023-09-25 230146

Screenshot 2023-09-25 230231

@z3ntu
Copy link
Member

z3ntu commented Sep 25, 2023

Do you have usb packet captures from Razer Synapse on Windows for this device maybe? Would be great if I could have a look at them.

@yuvalpoliti
Copy link
Author

Wired capture:

  • 13-16 set brightness level to 100
  • 17-20 set static effect
  • 21-24 set breathing effect
  • 25-28 set brightness level to 53
  • 29-32 turn off LEDs (set brightness level to 0)

Wireless capture:

  • 13-18 set brightness level to 100
  • 19-24 set static effect
  • 25-30 set breathing effect
  • 31-36 set brightness level to 56
  • 37-40 turn off LEDs (set brightness level to 0)

RazerProTypeUltraCaptures.zip

report.arguments[4] = 0x01;
report.arguments[5] = 0x01;
report.arguments[6] = brightness;
return report;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not convinced making a custom function for this device is necessary.

The razer_chroma_extended_matrix_effect_static function doesn't work for this device? In the pcap I see rgb=0xFFFFFF there except that report.argument[4] = 0x01 , everything else looks to be the same.

Same with breathing effect.

CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_matrix_effect_breath); // Breathing effect
CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_level); // Battery charge level
CREATE_DEVICE_FILE(&hdev->dev, &dev_attr_charge_status); // Battery charge status
break;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You patch the brightness function above but don't actually add it to the device?

@damnms
Copy link

damnms commented Jan 21, 2024

is there anything missing before its merged? i have that keyboard and would love to have this fully supported :)
thanks for the work!

@z3ntu
Copy link
Member

z3ntu commented Mar 3, 2024

@damnms There are some outstanding comments. If you can address them yourself, please feel free to work on them and open a new PR if the original author here is not active anymore.

@damnms
Copy link

damnms commented Mar 3, 2024

i am no dev so i can unfortunately not answer those. but if you need a dump of packages, i guess i could provide them. if you maybe can help me a bit in providing them, what i need or what i should execute, i can do that.

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

Successfully merging this pull request may close these issues.

Support for Razer Pro Type Ultra -- disabling implicit fnlock for the function keys
3 participants