Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for SteelSeries Arctis 7. #16

Merged
merged 5 commits into from
Apr 23, 2018

Conversation

Ionic
Copy link
Contributor

@Ionic Ionic commented Apr 19, 2018

This currently only supports setting (or disabling) the sidetone feature.

Sadly, this control station falls out of line by using Output Requests instead of Feature Requests, so the code is a tad different from all the other implementations.

Further, the request needs to be sent to a non-default interface, which touches on #8. Thus, I've implemented initial interface opening, which SHOULD be backwards compatible due to initializing the device structure statically (and thus nulling the memory block) and assuming that hid_enumerate returns the default interface as the first one - which would be what hid_open(vid, pid) would normally open.

I was not able to actually test this, though, so please go ahead and make sure it doesn't break your devices.

Copy link
Owner

@Sapd Sapd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your work.

I noticed a missing free in the implementation. Also the code style differs a bit (using memcpy vs memmove; using double parentheses in if statements), however this isn't really important.

// the range of the Arctis 7 seems to be from 0 to 0x12 (18)
num = map(num, 0, 128, 0x00, 0x12);

unsigned char *buf = calloc(31, 1);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

buf is not getting free'd

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Regarding memcpy vs. memmove: I try to avoid memcpy since its potential benefit (increased speed potentially through prefetching) outweigh the risk (not safe with overlapping regions). Especially in this case it won't make any difference, neither runtime-related nor behavioral.


if (num)
{
memmove(buf, data_on, sizeof(data_on));
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

memmove is usually used when there is overlapping memory, normally I would use memcpy, but it doesn't really matter much

@Sapd
Copy link
Owner

Sapd commented Apr 19, 2018

Also I tested wether it still works with my Headset, there doesn't seem to be any problem and I also guess that there won't be with other ones. Otherwise the interface id's of the other headsets must be adapted.

@Ionic Ionic force-pushed the feature/support-steelseries-arctis7 branch from b834421 to 64e2f85 Compare April 20, 2018 00:47
@Ionic
Copy link
Contributor Author

Ionic commented Apr 20, 2018

Updated the branch. Some more cleanup, less code duplication etc.

Ionic added 5 commits April 20, 2018 02:51
Touches on Sapd#8, but doesn't fix it.

Should be backwards-compatible if all device structures are nulled
(trivially true for static variables like here) and enumerating the HID
devices returns the default one that would be opened via hid_open().
Currently only supports setting (or disabling) the sidetone feature.
@Ionic Ionic force-pushed the feature/support-steelseries-arctis7 branch from 64e2f85 to b6f6f4e Compare April 20, 2018 00:52
@Ionic
Copy link
Contributor Author

Ionic commented Apr 20, 2018

Err... I don't get why git sometimes changes more commits than would be needed, so threw in a quick branch rebase.

@Sapd Sapd merged commit 4e8d256 into Sapd:master Apr 23, 2018
@Sapd
Copy link
Owner

Sapd commented Apr 23, 2018

Thank you, I merged it into master

rpbaptist pushed a commit to rpbaptist/HeadsetControl that referenced this pull request May 31, 2024
…tis7

Add support for SteelSeries Arctis 7.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants