diff --git a/50-nova-pro-wireless.rules b/50-nova-pro-wireless.rules deleted file mode 100644 index 4938c06..0000000 --- a/50-nova-pro-wireless.rules +++ /dev/null @@ -1 +0,0 @@ -SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12e0", TAG+="uaccess", ENV{SYSTEMD_USER_WANTS}="nova-chatmix.service" diff --git a/50-nova-pro.rules b/50-nova-pro.rules new file mode 100644 index 0000000..4677a7c --- /dev/null +++ b/50-nova-pro.rules @@ -0,0 +1,7 @@ +# Arctis Nova Pro - Wireless +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12e0", TAG+="uaccess", ENV{SYSTEMD_USER_WANTS}="nova-chatmix.service" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12e5", TAG+="uaccess", ENV{SYSTEMD_USER_WANTS}="nova-chatmix.service" + +# Arctis Nova Pro - Wired +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12cb", TAG+="uaccess", ENV{SYSTEMD_USER_WANTS}="nova-chatmix.service" +SUBSYSTEMS=="usb", ATTRS{idVendor}=="1038", ATTRS{idProduct}=="12cd", TAG+="uaccess", ENV{SYSTEMD_USER_WANTS}="nova-chatmix.service" diff --git a/README.md b/README.md index dc9e931..e131123 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Arctis Nova Pro Wireless ChatMix on Linux +# Arctis Nova Pro ChatMix on Linux ## About this project @@ -6,7 +6,7 @@ Some SteelSeries headsets have a feature called ChatMix where you can easily adj In previous SteelSeries headsets ChatMix was always a hardware feature. It worked by providing 2 sound devices to the host, 1 for general audio and the other for chat audio. -In newer generations of their headsets however, in particular the Arctis Nova Pro Wireless, this feature was taken out of the hardware itself, and made into a feature of their audio software called Sonar. +In newer generations of their headsets however, in particular the Arctis Nova Pro, this feature was taken out of the hardware itself, and made into a feature of their audio software called Sonar. Sonar of course only works on Windows and requires a SteelSeries account. @@ -17,9 +17,7 @@ I wanted to be able to use ChatMix on linux, so I reverse engineered the communi ## Disclaimer THIS PROJECT HAS NO ASSOCIATION TO STEELSERIES, NOR IS IT IN ANY WAY SUPPORTED BY THEM. - I AM NOT RESPONSIBLE FOR BRICKED/BROKEN DEVICES NOR DO I GUARANTEE IT WILL WORK FOR YOU. - USING ANYTHING IN THIS PROJECT _MIGHT_ VOID YOUR WARRANTY AND IS AT YOUR OWN RISK. ## Usage @@ -35,13 +33,13 @@ For this project I created a simple Python program to both enable the controls a On Fedora these can be installed with: -``` +```bash sudo dnf install pulseaudio-utils python3 python3-hidapi ``` On Debian based systems (like Ubuntu or Pop!_OS) these can be installed with: -``` +```bash sudo apt install pulseaudio-utils python3 python3-hid ``` @@ -49,17 +47,17 @@ sudo apt install pulseaudio-utils python3 python3-hid Clone this repo and cd into it -``` +```bash git clone https://git.dymstro.nl/Dymstro/nova-chatmix-linux.git cd nova-chatmix-linux ``` To be able to run the script as a non-root user, some udev rules need to be applied. This will allow regular users to access the base station USB device. It also starts the script when it gets plugged in (only when the systemd service is also set up). -Copy `50-nova-pro-wireless.rules` to `/etc/udev/rules.d` and reload udev rules: +Copy `50-nova-pro.rules` to `/etc/udev/rules.d` and reload udev rules: -``` -sudo cp 50-nova-pro-wireless.rules /etc/udev/rules.d/50-nova-pro-wireless.rules +```bash +sudo cp 50-nova-pro.rules /etc/udev/rules.d/ sudo udevadm control --reload-rules sudo udevadm trigger @@ -67,7 +65,7 @@ sudo udevadm trigger If you want to run this script on startup you can add and enable the systemd service -``` +```bash ## The systemd service expects the script in .local/bin # Create the folder if it doesn't exist mkdir -p ~/.local/bin @@ -92,7 +90,7 @@ This will create 2 virtual sound devices: - NovaGame for game/general audio - NovaChat for chat audio -``` +```bash # You do not need to run this if you installed the systemd unit! python nova-chatmix.py ``` diff --git a/nova-chatmix.py b/nova-chatmix.py index 5786c3e..0c8b6a0 100755 --- a/nova-chatmix.py +++ b/nova-chatmix.py @@ -40,7 +40,7 @@ def _create_virtual_sink(self, name: str, output_sink: str) -> Popen: CMD_PWLOOPBACK, "-P", output_sink, - "--capture-props=media.class=Audio/Sink", + "--capture-props=media.class=Audio/Sink,audio.rate=44100,audio.channels=2", "-n", name, ] @@ -51,9 +51,10 @@ def _set_volume(self, sink: str, volume: int): class NovaProWireless: - # USB IDs + # USB VendorID VID = 0x1038 - PID = 0x12E0 + # USB ProductIDs for Acrtis Nova Pro Wireless & Wired + PID_LIST = [0x12E0, 0x12E5, 0x12CB, 0x12CD] # bInterfaceNumber INTERFACE = 0x4 @@ -85,7 +86,7 @@ class NovaProWireless: # PipeWire Names ## String used to automatically select output sink - PW_OUTPUT_SINK_AUTODETECT = "SteelSeries_Arctis_Nova_Pro_Wireless" + PW_OUTPUT_SINK_AUTODETECT = "SteelSeries_Arctis_Nova_Pro" ## Names of virtual sound devices PW_GAME_SINK = "NovaGame" PW_CHAT_SINK = "NovaChat" @@ -100,16 +101,18 @@ class NovaProWireless: # Device not found error string ERR_NOTFOUND = "Device not found" + @staticmethod + def ResolveHidDevPath(): + for pid in NovaProWireless.PID_LIST: + for hiddev in hidenumerate(NovaProWireless.VID, pid): + if hiddev["interface_number"] == NovaProWireless.INTERFACE: + return hiddev["path"] + raise DeviceNotFoundException + # Selects correct device, and makes sure we can control it def __init__(self, output_sink=None): # Find HID device path - devpath = None - for hiddev in hidenumerate(self.VID, self.PID): - if hiddev["interface_number"] == self.INTERFACE: - devpath = hiddev["path"] - break - if not devpath: - raise DeviceNotFoundException + devpath = NovaProWireless.ResolveHidDevPath() # Try to automatically detect output sink, this is skipped if output_sink is given if not output_sink: diff --git a/nova-chatmix.service b/nova-chatmix.service index 13d21b6..676e686 100644 --- a/nova-chatmix.service +++ b/nova-chatmix.service @@ -1,5 +1,5 @@ [Unit] -Description=Enable ChatMix for the Steelseries Arctis Nova Pro Wireless +Description=Enable ChatMix for the Steelseries Arctis Nova Pro After=pipewire.service pipewire-pulse.service Wants=network-online.target