Introduce internal equalizer baseline and band limit #320
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
inutility.c
(now namedget_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!