Skip to content

Commit bbf50ef

Browse files
superstromCalcProgrammer1
authored andcommitted
add Kraken V3 X
1 parent ba186cf commit bbf50ef

7 files changed

Lines changed: 599 additions & 0 deletions

File tree

Controllers/RazerController/RazerControllerDetect.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@
1414
#include "Detector.h"
1515
#include "RazerController.h"
1616
#include "RazerKrakenController.h"
17+
#include "RazerKrakenV3Controller.h"
1718
#include "RazerKrakenV4Controller.h"
1819
#include "RazerHanboController.h"
1920
#include "RazerDevices.h"
2021
#include "ResourceManager.h"
2122
#include "RGBController_Razer.h"
2223
#include "RGBController_RazerAddressable.h"
2324
#include "RGBController_RazerKraken.h"
25+
#include "RGBController_RazerKrakenV3.h"
2426
#include "RGBController_RazerKrakenV4.h"
2527
#include "RGBController_RazerHanbo.h"
2628

@@ -155,6 +157,27 @@ void DetectRazerKrakenControllers(hid_device_info* info, const std::string& name
155157
}
156158
} /* DetectRazerKrakenControllers() */
157159

160+
/******************************************************************************************\
161+
* *
162+
* DetectRazerKrakenV3Controllers *
163+
* *
164+
* Tests the USB address to see if a Razer Kraken V3 controller exists there. *
165+
* *
166+
\******************************************************************************************/
167+
168+
void DetectRazerKrakenV3Controllers(hid_device_info* info, const std::string& name)
169+
{
170+
hid_device* dev = hid_open_path(info->path);
171+
172+
if(dev)
173+
{
174+
RazerKrakenV3Controller* controller = new RazerKrakenV3Controller(dev, info->path, info->product_id, name);
175+
176+
RGBController_RazerKrakenV3* rgb_controller = new RGBController_RazerKrakenV3(controller);
177+
ResourceManager::get()->RegisterRGBController(rgb_controller);
178+
}
179+
} /* DetectRazerKrakenV3Controllers() */
180+
158181
/******************************************************************************************\
159182
* *
160183
* DetectRazerKrakenV4Controllers *
@@ -365,6 +388,7 @@ REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Edition", Det
365388
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Black Edition", DetectRazerControllers, RAZER_VID, RAZER_KRAKEN_KITTY_BLACK_EDITION_PID, 0x01, 0x01, 0x03);
366389
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty Black Edition V2", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_KITTY_BLACK_EDITION_V2_PID, 0x03, 0x0C, 0x01);
367390
REGISTER_HID_DETECTOR_IPU("Razer Kraken Ultimate", DetectRazerKrakenControllers, RAZER_VID, RAZER_KRAKEN_ULTIMATE_PID, 0x03, 0x0C, 0x01);
391+
REGISTER_HID_DETECTOR_IPU("Razer Kraken V3 X", DetectRazerKrakenV3Controllers,RAZER_VID, RAZER_KRAKEN_V3_X_PID, 0x03, 0x0C, 0x01);
368392
REGISTER_HID_DETECTOR_IPU("Razer Kraken V4 (Wired)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_V4_WIRED_PID, 0x05, 0xFF14, 0x01);
369393
REGISTER_HID_DETECTOR_IPU("Razer Kraken V4 (Wireless)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_V4_WIRELESS_PID, 0x05, 0xFF14, 0x01);
370394
REGISTER_HID_DETECTOR_IPU("Razer Kraken Kitty V3 Pro (Wired)", DetectRazerKrakenV4Controllers,RAZER_VID, RAZER_KRAKEN_KITTY_V3_PRO_WIRED_PID, 0x05, 0xFF14, 0x01);

Controllers/RazerController/RazerDevices.cpp

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7701,6 +7701,41 @@ static const razer_device kraken_kitty_black_v2_device =
77017701
NULL
77027702
};
77037703

7704+
/*-------------------------------------------------------------*\
7705+
| Razer Kraken V3 X 1532:0537 |
7706+
| |
7707+
| Zone "Headset" |
7708+
| Single |
7709+
| 1 LED |
7710+
\*-------------------------------------------------------------*/
7711+
static const razer_zone kraken_v3_x_zone =
7712+
{
7713+
"Headset",
7714+
ZONE_TYPE_SINGLE,
7715+
1,
7716+
1
7717+
};
7718+
7719+
static const razer_device kraken_v3_x_device =
7720+
{
7721+
"Razer Kraken V3 X",
7722+
RAZER_KRAKEN_V3_X_PID,
7723+
DEVICE_TYPE_HEADSET,
7724+
RAZER_MATRIX_TYPE_NONE,
7725+
0,
7726+
1,
7727+
1,
7728+
{
7729+
&kraken_v3_x_zone,
7730+
NULL,
7731+
NULL,
7732+
NULL,
7733+
NULL,
7734+
NULL
7735+
},
7736+
NULL
7737+
};
7738+
77047739
/*-------------------------------------------------------------*\
77057740
| Razer Kraken V4 Wired 1532:056B |
77067741
| |
@@ -9041,6 +9076,7 @@ const razer_device* razer_device_list[] =
90419076
&kraken_ultimate_device,
90429077
&kraken_kitty_device,
90439078
&kraken_kitty_black_v2_device,
9079+
&kraken_v3_x_device,
90449080
&kraken_v4_wired_device,
90459081
&kraken_v4_wireless_device,
90469082
&kraken_kitty_v3_pro_wired_device,

Controllers/RazerController/RazerDevices.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@
224224
#define RAZER_KRAKEN_ULTIMATE_PID 0x0527
225225
#define RAZER_KRAKEN_V2_PID 0x0510
226226
#define RAZER_KRAKEN_KITTY_BLACK_EDITION_V2_PID 0x0560
227+
#define RAZER_KRAKEN_V3_X_PID 0x0537
227228
#define RAZER_KRAKEN_V4_WIRED_PID 0x056B
228229
#define RAZER_KRAKEN_V4_WIRELESS_PID 0x056C
229230
#define RAZER_KRAKEN_KITTY_V3_PRO_WIRED_PID 0x0587
Lines changed: 170 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,170 @@
1+
/*---------------------------------------------------------*\
2+
| RGBController_RazerKrakenV3.cpp |
3+
| |
4+
| RGBController for Razer devices with 9-byte report |
5+
| |
6+
| Greg Sandstrom (superstrom) 1 Nov 2025 |
7+
| |
8+
| This file is part of the OpenRGB project |
9+
| SPDX-License-Identifier: GPL-2.0-or-later |
10+
\*---------------------------------------------------------*/
11+
12+
#include <vector>
13+
#include "RazerDevices.h"
14+
#include "RGBController_RazerKrakenV3.h"
15+
16+
RGBController_RazerKrakenV3::RGBController_RazerKrakenV3(RazerKrakenV3Controller* controller_ptr)
17+
{
18+
controller = controller_ptr;
19+
20+
name = controller->GetName();
21+
vendor = "Razer";
22+
type = controller->GetDeviceType();
23+
description = "Razer Device";
24+
location = controller->GetDeviceLocation();
25+
version = controller->GetFirmwareString();
26+
serial = controller->GetSerialString();
27+
uint8_t max_brightness = controller->GetMaxBrightness();
28+
29+
// By default, the device starts as Wave/Spectrum Cycle.
30+
// Set Wave as first mode, so switching to Direct calls DeviceUpdateMode()
31+
32+
mode Wave;
33+
Wave.name = "Wave";
34+
Wave.value = RAZER_KRAKEN_V3_MODE_WAVE;
35+
Wave.flags = MODE_FLAG_HAS_BRIGHTNESS;
36+
Wave.direction = MODE_DIRECTION_RIGHT;
37+
Wave.color_mode = MODE_COLORS_NONE;
38+
Wave.brightness_min = 0;
39+
Wave.brightness_max = max_brightness;
40+
Wave.brightness = max_brightness;
41+
modes.push_back(Wave);
42+
43+
44+
mode Direct;
45+
Direct.name = "Direct";
46+
Direct.value = RAZER_KRAKEN_V3_MODE_DIRECT;
47+
Direct.flags = MODE_FLAG_HAS_PER_LED_COLOR | MODE_FLAG_HAS_BRIGHTNESS;
48+
Direct.color_mode = MODE_COLORS_PER_LED;
49+
Direct.brightness_min = 0;
50+
Direct.brightness_max = max_brightness;
51+
Direct.brightness = max_brightness;
52+
modes.push_back(Direct);
53+
54+
SetupZones();
55+
}
56+
57+
RGBController_RazerKrakenV3::~RGBController_RazerKrakenV3()
58+
{
59+
delete controller;
60+
}
61+
62+
void RGBController_RazerKrakenV3::SetupZones()
63+
{
64+
unsigned int device_index = controller->GetDeviceIndex();
65+
66+
/*---------------------------------------------------------*\
67+
| Fill in zone information based on device table |
68+
\*---------------------------------------------------------*/
69+
for(unsigned int zone_id = 0; zone_id < RAZER_MAX_ZONES; zone_id++)
70+
{
71+
if(device_list[device_index]->zones[zone_id] != NULL)
72+
{
73+
zone new_zone;
74+
75+
new_zone.name = device_list[device_index]->zones[zone_id]->name;
76+
new_zone.type = device_list[device_index]->zones[zone_id]->type;
77+
78+
new_zone.leds_count = device_list[device_index]->zones[zone_id]->rows * device_list[device_index]->zones[zone_id]->cols;
79+
new_zone.leds_min = new_zone.leds_count;
80+
new_zone.leds_max = new_zone.leds_count;
81+
82+
if(new_zone.type == ZONE_TYPE_MATRIX)
83+
{
84+
matrix_map_type * new_map = new matrix_map_type;
85+
new_zone.matrix_map = new_map;
86+
87+
new_map->height = device_list[device_index]->zones[zone_id]->rows;
88+
new_map->width = device_list[device_index]->zones[zone_id]->cols;
89+
90+
new_map->map = new unsigned int[new_map->height * new_map->width];
91+
92+
for(unsigned int y = 0; y < new_map->height; y++)
93+
{
94+
for(unsigned int x = 0; x < new_map->width; x++)
95+
{
96+
new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x;
97+
}
98+
}
99+
}
100+
else
101+
{
102+
new_zone.matrix_map = NULL;
103+
}
104+
105+
zones.push_back(new_zone);
106+
}
107+
}
108+
109+
for(unsigned int zone_id = 0; zone_id < zones.size(); zone_id++)
110+
{
111+
for (unsigned int row_id = 0; row_id < device_list[device_index]->zones[zone_id]->rows; row_id++)
112+
{
113+
for (unsigned int col_id = 0; col_id < device_list[device_index]->zones[zone_id]->cols; col_id++)
114+
{
115+
led* new_led = new led();
116+
117+
new_led->name = device_list[device_index]->zones[zone_id]->name;
118+
119+
if(zones[zone_id].leds_count > 1)
120+
{
121+
new_led->name.append(" LED ");
122+
new_led->name.append(std::to_string(col_id + 1));
123+
}
124+
125+
leds.push_back(*new_led);
126+
}
127+
}
128+
}
129+
130+
SetupColors();
131+
}
132+
133+
void RGBController_RazerKrakenV3::ResizeZone(int /*zone*/, int /*new_size*/)
134+
{
135+
136+
}
137+
138+
void RGBController_RazerKrakenV3::DeviceUpdateLEDs()
139+
{
140+
if(modes[active_mode].value == RAZER_KRAKEN_V3_MODE_DIRECT)
141+
{
142+
controller->SetDirect(&colors[0]);
143+
}
144+
}
145+
146+
void RGBController_RazerKrakenV3::UpdateZoneLEDs(int /*zone*/)
147+
{
148+
DeviceUpdateLEDs();
149+
}
150+
151+
void RGBController_RazerKrakenV3::UpdateSingleLED(int /*led*/)
152+
{
153+
DeviceUpdateLEDs();
154+
}
155+
156+
void RGBController_RazerKrakenV3::DeviceUpdateMode()
157+
{
158+
switch(modes[active_mode].value)
159+
{
160+
case RAZER_KRAKEN_V3_MODE_DIRECT:
161+
controller->SetModeDirect();
162+
controller->SetBrightness(modes[active_mode].brightness);
163+
break;
164+
165+
case RAZER_KRAKEN_V3_MODE_WAVE:
166+
controller->SetModeWave();
167+
controller->SetBrightness(modes[active_mode].brightness);
168+
break;
169+
}
170+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*---------------------------------------------------------*\
2+
| RGBController_RazerKrakenV3.h |
3+
| |
4+
| RGBController for Razer devices with 9-byte report |
5+
| |
6+
| Greg Sandstrom (superstrom) 1 Nov 2025 |
7+
| |
8+
| This file is part of the OpenRGB project |
9+
| SPDX-License-Identifier: GPL-2.0-or-later |
10+
\*---------------------------------------------------------*/
11+
12+
#pragma once
13+
14+
#include "RGBController.h"
15+
#include "RazerKrakenV3Controller.h"
16+
17+
enum
18+
{
19+
RAZER_KRAKEN_V3_MODE_DIRECT,
20+
RAZER_KRAKEN_V3_MODE_WAVE,
21+
};
22+
23+
class RGBController_RazerKrakenV3 : public RGBController
24+
{
25+
public:
26+
RGBController_RazerKrakenV3(RazerKrakenV3Controller* controller_ptr);
27+
~RGBController_RazerKrakenV3();
28+
29+
void SetupZones();
30+
31+
void ResizeZone(int zone, int new_size);
32+
33+
void DeviceUpdateLEDs();
34+
void UpdateZoneLEDs(int zone);
35+
void UpdateSingleLED(int led);
36+
37+
void DeviceUpdateMode();
38+
39+
private:
40+
RazerKrakenV3Controller* controller;
41+
};

0 commit comments

Comments
 (0)