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

Introduce internal equalizer baseline and band limit #320

Merged
merged 3 commits into from
Dec 30, 2023

Conversation

AnErrupTion
Copy link
Contributor

@AnErrupTion AnErrupTion commented Dec 27, 2023

Hello! This PR introduces an internal equalizer baseline and band limit. On the one hand, having the baseline means is that, instead of having to input band values specific to the device for the equalizer, e.g.:

headsetcontrol -e "0x1c 0x19 0x11 0x14 0x14 0x14"

you can specify the band value shown in the software, e.g.:

headsetcontrol -e "4 2.5 -1.5 0 0 0"

Essentially, the baseline is the band value sent in a USB command when it's flat. The band limit, on the other hand, sets limits for those arbitrary values in the equalizer argument string. For example, on the Arctis Nova 3, the minimum and maximum band values are -6 and +6 respectively.

Moreover, this PR fixes potential bugs. For example, the send and send-feature commands used a signed byte buffer instead of an unsigned one, which could cause some issues.

Furthermore, the function get_data_from_parameter in utility.c (now named get_byte_data_from_parameter) allocated a buffer which was never used, but worse, sometimes was never freed if a certain condition was met. That buffer has been removed.

Finally, I've mentionned support for the Arctis Nova 3 on the README file, something I forgot to do in my last PR. 😅

However, this PR has been created as a draft PR due to one issue. The Arctis Nova Pro Wireless is yet another headset that implements the EQ feature, however, I've been unable to find its baseline value. This is because the Equalizer Preset capability for this headset directly sends a value corresponding to an internal preset, unlike the others implementing it which basically send a specific equalizer string directly to the headset.
(cc @Anden: If you can help me figure out the baseline value (perhaps by setting a custom all-flat EQ preset), it would be awesome! Thanks!)

EDIT: This has been solved now!

@Anden
Copy link
Contributor

Anden commented Dec 28, 2023

@AnErrupTion The Arctis Nova Pro Wireless base-station allows to set each band from -10 to +10 in 0.5 increments, which corresponds to baseline 20 (0x14), minimum 0 and max 40 (0x28) in the data.

The preset stuff is just to ensure that the custom equalizer takes effect.
In set_equalizer the passed band values are set immediately after enabling custom equalizer:

set_equalizer_preset(device_handle, EQUALIZER_PRESET_CUSTOM);

uint8_t data[MSG_SIZE] = { 0x06, 0x33 };
for (int i = 0; i < settings->size; i++) {
    data[i + 2] = (uint8_t)settings->bands_values[i];
}

@AnErrupTion AnErrupTion marked this pull request as ready for review December 28, 2023 14:58
@AnErrupTion
Copy link
Contributor Author

@Anden Thank you! This is exactly what I needed. :D

@Anden
Copy link
Contributor

Anden commented Dec 28, 2023

I tested with my Arctis Nova Pro Wireless, and it works as expected. 👍

@AnErrupTion
Copy link
Contributor Author

@Sapd Just so you know, this is ready to be reviewed/merged. 😄

@Sapd Sapd merged commit 464a12a into Sapd:master Dec 30, 2023
5 checks passed
@Sapd
Copy link
Owner

Sapd commented Dec 30, 2023

Thank you!

@AnErrupTion AnErrupTion deleted the equalizer-baseline branch December 30, 2023 12:15
rpbaptist pushed a commit to rpbaptist/HeadsetControl that referenced this pull request May 31, 2024
* Introduce internal equalizer baseline

Signed-off-by: AnErrupTion <[email protected]>

* Add Arctis Nova 3 in README.md

Signed-off-by: AnErrupTion <[email protected]>

* Add baseline and band limit to Arctis Nova Pro Wireless

Signed-off-by: AnErrupTion <[email protected]>

---------

Signed-off-by: AnErrupTion <[email protected]>
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.

None yet

3 participants