duncanthrax / roccat-vulcan

Linux RGB LED effect support for the Roccat Vulcan 100/120 Keyboard
GNU General Public License v3.0
79 stars 20 forks source link

Roccat Vulcan II Max version has different IDs #39

Open takosalad opened 3 months ago

takosalad commented 3 months ago

Bus 001 Device 005: ID 1e7d:2ee2 ROCCAT ROCCAT Vulcan II Max

takosalad commented 3 months ago

I added the Vulcan II Max device, but it doesn't work:

$ sudo roccat-vulcan -v
ROCCAT Vulcan for Linux [github.com/duncanthrax/roccat-vulcan]
Effect Color Table (change these with -c option)
colorIdx    R      G      B  Desc
------------------------------------------------
0           0      0    119  Base keyboard color (dark blue)
1        2303      0   -255  Typing color, initial key (over-red, under-blue)
2        2303      0   -143  Typing color, first neighbor key
3        2303      0      0  Typing color, second neighbor key
4         187      0    204  Ghost typing color, initial key
5         153      0    187  Ghost typing color, first neighbor key
6          85      0    170  Ghost typing color, second neighbor key
7           0      0      0  (null)
8           0      0      0  (null)
9           0      0      0  (null)
open_device(1e7d, 3098): No LED device found
open_device(1e7d, 307a): No LED device found
open_device(1e7d, 2ee2): ignoring non-LED interface #0
open_device(1e7d, 2ee2): ignoring non-LED interface #1
open_device(1e7d, 2ee2): ignoring non-LED interface #2
open_device(1e7d, 2ee2): LED interface at USB path 1-9:1.3
open_device(1e7d, 2ee2): CTRL interface at /dev/hidraw4
rv_get_ctrl_report(0f) failed (0)
Error: Failed to send initialization sequence (2).

Here is the diff:

diff --git a/src/99-roccat-vulcan.rules b/src/99-roccat-vulcan.rules
index 416ca6a..cb9125b 100644
--- a/src/99-roccat-vulcan.rules
+++ b/src/99-roccat-vulcan.rules
@@ -1,2 +1,3 @@
 ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e7d", ATTRS{idProduct}=="307a", MODE="660", GROUP="plugdev"
 ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e7d", ATTRS{idProduct}=="3098", MODE="660", GROUP="plugdev"
+ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="1e7d", ATTRS{idProduct}=="2ee2", MODE="660", GROUP="plugdev"
diff --git a/src/hid.c b/src/hid.c
index 7101b97..b54ca38 100644
--- a/src/hid.c
+++ b/src/hid.c
@@ -205,7 +205,7 @@ int rv_get_ctrl_report(unsigned char report_id) {
                return 0;
        }
        else {
-               rv_printf(RV_LOG_VERBOSE, "rv_get_ctrl_report(%02hhx) failed\n", report_id);
+               rv_printf(RV_LOG_VERBOSE, "rv_get_ctrl_report(%02hhx) failed (0)\n", report_id);
                free(buffer);
                return RV_FAILURE;
        }
@@ -362,7 +362,7 @@ int rv_set_ctrl_report(unsigned char report_id, int mode, int byteopt) {
                return RV_SUCCESS;
        }
        else {
-               rv_printf(RV_LOG_VERBOSE, "rv_set_ctrl_report(%02hhx) failed\n", report_id);
+               rv_printf(RV_LOG_VERBOSE, "rv_set_ctrl_report(%02hhx) failed (1)\n", report_id);
                return RV_FAILURE;
        }
 }
diff --git a/src/roccat-vulcan.c b/src/roccat-vulcan.c
index 241057a..3d2ea99 100644
--- a/src/roccat-vulcan.c
+++ b/src/roccat-vulcan.c
@@ -11,8 +11,9 @@
 #define FX_MODE_PIPED 1

 // Globals
-uint16_t rv_products[3]   = { 0x3098, 0x307a,  0x0000 };
-char * rv_products_str[3] = { "3098", "307a",  NULL };
+#define VARIANTS 4
+uint16_t rv_products[VARIANTS]   = { 0x3098, 0x307a,  0x2ee2, 0x0000 };
+char * rv_products_str[VARIANTS] = { "3098", "307a",  "2ee2", NULL };
 int rv_verbose = 0;
 rv_rgb rv_colors[RV_NUM_COLORS] = {
        { .r = 0x0000, .g = 0x0000, .b =  0x0077 },
@@ -201,7 +202,7 @@ int main(int argc, char* argv[])
                        }

                        if (rv_send_init(RV_MODE_FX, -1)) {
-                               rv_printf(RV_LOG_NORMAL, "Error: Failed to send initialization sequence.\n");
+                               rv_printf(RV_LOG_NORMAL, "Error: Failed to send initialization sequence (0).\n");
                                return RV_FAILURE;
                        }

@@ -240,7 +241,7 @@ int main(int argc, char* argv[])
                                }

                                if (rv_send_init(RV_MODE_FX, -1)) {
-                                       rv_printf(RV_LOG_NORMAL, "Error: Failed to send initialization sequence.\n");
+                                       rv_printf(RV_LOG_NORMAL, "Error: Failed to send initialization sequence (1).\n");
                                        return RV_FAILURE;
                                }

@@ -266,7 +267,7 @@ int main(int argc, char* argv[])
                                }

                                if (rv_send_init(RV_MODE_FX, -1)) {
-                                       rv_printf(RV_LOG_NORMAL, "Error: Failed to send initialization sequence.\n");
+                                       rv_printf(RV_LOG_NORMAL, "Error: Failed to send initialization sequence (2).\n");
                                        return RV_FAILURE;
                                }

diff --git a/src/roccat-vulcan.h b/src/roccat-vulcan.h
index 24bb38f..a8fa48c 100644
--- a/src/roccat-vulcan.h
+++ b/src/roccat-vulcan.h
@@ -53,8 +53,9 @@ extern rv_rgb rv_color_off;

 // Globals (roccat-vulcan.c)
 extern int rv_verbose;
-extern uint16_t rv_products[3];
-extern char * rv_products_str[3];
+#define VARIANTS 4
+extern uint16_t rv_products[VARIANTS];
+extern char * rv_products_str[VARIANTS];
 extern rv_rgb* rv_fixed[RV_NUM_KEYS];

 // HID I/O functions (hid.c)