razer icon indicating copy to clipboard operation
razer copied to clipboard

Razer Naga Hex V2

Open l3iggs opened this issue 7 years ago • 28 comments

@mbuesch Hi, I just bought one of these. Looks like it's not supported here. Are you aware of its existence? I'd like to try to add support for it. Would you estimate this would be a lot of work? trivial?

lsusb -v gives

Bus 001 Device 010: ID 1532:0050 Razer USA, Ltd 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x1532 Razer USA, Ltd
  idProduct          0x0050 
  bcdDevice            2.00
  iManufacturer           1 Razer
  iProduct                2 Razer Naga Hex V2
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           84
    bNumInterfaces          3
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      1 Boot Interface Subclass
      bInterfaceProtocol      2 Mouse
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      94
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength     159
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        2
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 
      bInterfaceProtocol      1 Keyboard
      iInterface              0 
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.11
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      61
         Report Descriptors: 
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0008  1x 8 bytes
        bInterval               1
can't get device qualifier: Resource temporarily unavailable
can't get debug descriptor: Resource temporarily unavailable
Device Status:     0x0000
  (Bus Powered)

l3iggs avatar Aug 17 '16 19:08 l3iggs

The Hex v2 is a known unsupported device. (That's why it says v1 on the homepage ;) )

It is not possible to estimate the effort. That can go from just adding a USB ID to writing a completely new hardware driver module. A mouse having a predecessor even with the same name does not necessarily tell anything about its API.

But feel free to work on support for this device.

mbuesch avatar Aug 17 '16 20:08 mbuesch

I've attempted to attach here a capture I've just made of me using the Windows Razer mouse config tool to map the 1 keyboard key to the button marked 1 on the mouse.

@mbuesch does it look like I've captured something useful here?

button1-mapped-to-kb-1.zip

l3iggs avatar Aug 17 '16 20:08 l3iggs

Well, it looks like captured control data. Please compare that to the existing naga-hex driver (and possibly others). At the top of the C file you can see the on-wire data structures (those with "packed" attribute).

mbuesch avatar Aug 17 '16 20:08 mbuesch

Well, struct naga_command is 90 bytes long and my capture has a few packets with a 90 byte long field that wireshark calls "CONTROL response data". The crc in the struct seems to line up with a crc looking byte in my captures too.

l3iggs avatar Aug 17 '16 20:08 l3iggs

Good start. Please check if the structures for all commands (LEDs, DPIs, etc...) match (or not).

mbuesch avatar Aug 17 '16 21:08 mbuesch

I've just installed a build from my fork.
The mouse shows up in the dropdown in qrazercfg now, but that's about all that works. Toggling "Glowing Logo LED" makes the cursor disappear :fearful: and puts a bunch of bad things in my system log:

Aug 17 22:39:11  /usr/lib/gdm/gdm-x-session[1693]: (II) config/udev: removing device Razer Razer Naga Hex V2
Aug 17 22:39:11  /usr/lib/gdm/gdm-x-session[1693]: (**) Option "fd" "38"
Aug 17 22:39:11  /usr/lib/gdm/gdm-x-session[1693]: (II) UnloadModule: "libinput"
Aug 17 22:39:11  /usr/lib/gdm/gdm-x-session[1693]: (II) systemd-logind: releasing fd for 13:77
Aug 17 22:39:11  razerd[1352]: librazer: razer-naga: Command 0003/0401 failed with 03
...

The firmware version shows 1.00 (don't know what it should be). So it looks like I've got more work to do.

l3iggs avatar Aug 17 '16 21:08 l3iggs

I'm going to put my captures here for reference. Let me know if I should put them elsewhere.

l3iggs avatar Aug 20 '16 12:08 l3iggs

map keyboard key "2" to side mouse button 2 button2-mapped-to-kb-2.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set acceleration to 1 set-accel-to-1.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set acceleration to 10 set-accel-to-10.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set dpi to 100 set-DPI-to-100.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set dpi to 16000 set-DPI-to-16000.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set polling rate to 125 Hz set-polling-rate-to-125.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set polling rate to 1000 Hz set-polling-rate-to-1000.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set lighting effect to none set-lighting-effect-none.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set lighting effect to static set-lighting-effect-static.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

change static lighting to blue set-lighting-effect-staticBlue.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

change static lighting to red set-lighting-effect-staticRed.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

change static lighting to green set-lighting-effect-staticGreen.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set lighting brightness to 33% set-lighting-brightness-33.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set lighting brightness to 100% set-lighting-brightness-100.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

set lighting effect to spectrum cycling set-lighting-effect-spectrumCycling.zip

l3iggs avatar Aug 20 '16 12:08 l3iggs

I just bought one and really want to help! Is there any quick guide for me?

danhph avatar Jan 16 '17 06:01 danhph

I think only this document exists for this project: https://github.com/mbuesch/razer/blob/master/HACKING.md

z3ntu avatar Jan 16 '17 07:01 z3ntu

In addition to that the information from the website: https://bues.ch/h/razercfg#how_to_add_support_for_new_devices

mbuesch avatar Jan 16 '17 08:01 mbuesch

Quick update from my end-- I haven't really made any further progress. I stopped when I realized that adding support for this mouse isn't as trivial as adding the USB ID and re-using one of the already existing drivers. Unfortunately, I just don't have the time to get this working. I've dropped my captures here in hopes that the next dev that comes along with time to work on this might find them useful.

l3iggs avatar Jan 18 '17 10:01 l3iggs

For anyone else, it's supported by https://github.com/terrycain/razer-drivers

z3ntu avatar Jan 18 '17 12:01 z3ntu

:astonished:

l3iggs avatar Jan 18 '17 17:01 l3iggs