Comments (3)
I looked further at the lsusb output, and found that the interface number that I needed (0) corresponds to the entry where bInterfaceClass = 1 Audio && bInterfaceSubClass = 1 Control Device
joe@ironforge:~/Projects/HeadsetControl-g430$ lsusb -d 046d: -v
Bus 003 Device 008: ID 046d:0a4d Logitech, Inc. G430 Surround Sound Gaming Headset
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.10
bDeviceClass 0 (Defined at Interface level)
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 16
idVendor 0x046d Logitech, Inc.
idProduct 0x0a4d G430 Surround Sound Gaming Headset
bcdDevice 1.20
iManufacturer 1 Logitech
iProduct 2 Logitech G430 Gaming Headset
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 253
bNumInterfaces 4
bConfigurationValue 1
iConfiguration 0
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 0
bInterfaceClass 1 Audio
bInterfaceSubClass 1 Control Device
bInterfaceProtocol 0
iInterface 0
...
from headsetcontrol.
That explains why it works on Mac.
On Mac claiming a device is not needed and not even possible when it's already claimed (which it usually is).
I think when I looked into some other device, it also had a different id.
Instead of using a define, we could make a new struct with information for a device:
// vendor is needed multiple times, so we can define it here
#define VENDOR_LOGITECH 0x046d
struct device {
uint16_t idVendor;
uint16_t idProduct;
int interfaceNumber;
}
// and then initialize every "device" with static initialization
struct device device_g930 = { .idVendor = VENDOR_LOGITECH, .idProduct = 0x0a1f, .interfaceNumber = 3};
On another commit, we could even insert a function pointer into the struct, so we don't need the if switches in send_sidetone
.
Such a struct could be also useful later, for having something like a bit mask with driver capabilities (e.g. I implemented locally battery information for corsair void)
from headsetcontrol.
See #27
from headsetcontrol.
Related Issues (20)
- Help with setting up Corsair HS55 Wireless HOT 2
- SteelSeries Arctis 9 not displaying battery when charging HOT 6
- Add support for Logitech H390 HOT 1
- error: ignoring return value of ‘asprintf’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result] HOT 2
- Add support for Logitech G435 HOT 9
- Not showing correct battery status HOT 2
- Can not execute any command without sudo privileges HOT 2
- Incorrect ChatMix help message HOT 1
- Integrate with D-Bus / Upower HOT 1
- Error during build HOT 1
- HyperX Cloud Core Wireless Support HOT 5
- Support for HyperX Cloud III (with wire) HOT 12
- Arctis 7 Pro - Battery Charge Level alway at 56%
- version 3.0.0 build failure in src/output.c with CMake HOT 3
- CORSAIR HS80 RGB Wireless Gaming Support HOT 2
- Add Volume Limiter Support HOT 5
- Add Eqalizer info to json output HOT 9
- URB Interupt / JBL Q810 HOT 1
- SteelSeries Arctis Nova 5 HOT 5
- Very quiet sidetone with Logitech G PRO X HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from headsetcontrol.