Code Monkey home page Code Monkey logo

Comments (21)

ashkitten avatar ashkitten commented on August 19, 2024 1

The software I wrote will only work on Linux at the moment, due to using hidraw exclusively. Also, I'd just like to take a moment to mention that I use she/her pronouns, @Sapd :)

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024 1

The HID Library sets the value for you. Request is always set to 0x09, RequestType always to the same bits. Index is determined by the interface number, which the library also searches for "automatically".

However you need to decide between hid_write and hid_send_feature_report. The first byte of value is 02. By looking into the hidapi source code (function hid_write and hid_send_feature_report). I noticed you need hid_write because it does a (2 << 8) for it (HID_OUTPUT).

So try it with hid_write again and also try omitting the first byte (by only sending FF 07 1A 64)

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

Yes it's possible, but I need packet data, see #2

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

Ah, I forgot something. It could be, that the packets are the same as it's likely that logitech doesn't change them for every headset.

Type lsusb in the linux command line, and note the vendor and product id of the headset. Then swap out the G930's ones here https://github.com/Sapd/HeadsetControl/blob/master/main.c#L34
recompile and try if you can set the sidetone.

from headsetcontrol.

dvponomarev avatar dvponomarev commented on August 19, 2024

Hello,
I tried this with my G633,
set

#define VENDOR_LOGITECH 0x046d
#define PRODUCT_G930    0x0a5c

in main.c

when I execute sudo headsetcontrol 0 I got:

$ sudo headsetcontrol 0
Headsetcontrol written by Sapd (Denis Arnst)
	https://github.com/Sapd
Found Logitech G930!
Error in transfering data :(

Could you help please?

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

Likely the protocol is different after all. I need packet data to help you with implementing the G633

from headsetcontrol.

ashkitten avatar ashkitten commented on August 19, 2024

@Sapd I have a G933 and was starting to work on reverse engineering the protocol, but I've got no idea where to start. I've committed the .pcapng files to a repository so you can take a look if you've got the time. The relevant device is numbered 1.2.

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

Hello,

did you put the Sidetone down and Up with the original driver?

If yes, packet number 587 in your startup.pcapng could be such a packet. But I am not 100% sure, some of the values:

11:ff:04:0d:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

11:ff:04:3d:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

11:ff:04:ed:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

11:ff:04:3d:01:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00

11:ff:04:2d:00:02:00:00:00:00:00:00:00:00:00:00:00:00:00:00

When you look closely, one values seems to always change (the 4th one). 0d, 3d, ed.
So I would try to send packets like the first three lines of my quote. Look closely to the URB setup section of those packets in Wireshark, and use the same parameters when you send those packets over libUSB.

from headsetcontrol.

ashkitten avatar ashkitten commented on August 19, 2024

I've figured out that the protocol used for the G933 is at least very similar to HID++ 2.0 as detailed here: https://lekensteyn.nl/files/logitech/

The first byte describes the length of the packet, 0x11 for long (20 bytes)
The second byte describes the destination (0xff for the receiver or default device)
The third byte is the feature index
The fourth byte is a combination of the function ID and the application ID (first nibble and second nibble respectively)
The remaining bytes are arguments or return values

from headsetcontrol.

ashkitten avatar ashkitten commented on August 19, 2024

I've added some more packet captures to my repository with the latest commit, those might be very useful

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

Did you made further progress? My suggestion is, that you simply try to send some packets, which you may think could represent the sidetone by trial and error (like the ones I suggested). You could also try analysing with USBlyzer as I find it a little bit more clearer.

from headsetcontrol.

ashkitten avatar ashkitten commented on August 19, 2024

I've reverse engineered most of the relevant features, and implemented a library to address those features. There are also my notes, which contain detailed information about everything I've learned so far.

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

I see, it looks good. When I have time again I will rewrite a part of the software to support multiple features of multiple devices (the current architecture with the hard-coded function to the sidetone functions isn't well suited), as I already reverse engineered some more features of the corsair void.

from headsetcontrol.

BasBuur avatar BasBuur commented on August 19, 2024

@Sapd With the information you have on @ashkitten's repo, is it possible for you to implement support for the G933? If not I'll install Windows on my machine and try to get the values.

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

You'll have to test it. You could try using his software and simply modifying the device id's. If it works, it uses the same protocol.

You can btw. also sniff inside an virtual machine (with usb passthrough).

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

I've got now time and reworked the complete software. It now also uses hidraw. Hidraw is a better alternative as it in fact works in MacOS when reading values.

from headsetcontrol.

BasBuur avatar BasBuur commented on August 19, 2024

@Sapd I've captured the data necessary for the sidetone for the G633.:

Sidetone 0:
00000000 11 FF 07 1A 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Sidetone 100:
00000000 11 FF 07 1A 64 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

RequestType 22
Request 09
Value 0211
Index 0003

I tried adding it manually: https://gist.github.com/Moosieboy/2d1ddfbc9407aa0eb6543a94b617e4d4
But it's saying Failed to set sidetone. Error: -1: (null). I couldn't find where to change the requesttype, request, value & index in the source? Many thanks.

from headsetcontrol.

BasBuur avatar BasBuur commented on August 19, 2024

Yep, it worked when switching to hid_write. I had to leave the first byte in though, otherwise it still failed. Many thanks!

So the final file:
https://gist.github.com/Moosieboy/55e09447c06e0a50088f505fa528d5a3

from headsetcontrol.

Sapd avatar Sapd commented on August 19, 2024

Great to hear! If you want you can make a pull request. Simply fork the repo on GitHub, make changes (and care a bit for similar code style in regards to the rest of the project), push to your repo and then under Pull Requests you can open one.

from headsetcontrol.

BasBuur avatar BasBuur commented on August 19, 2024

Done. See #18

from headsetcontrol.

BasBuur avatar BasBuur commented on August 19, 2024

Sorry, see #19

from headsetcontrol.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.