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 parametric equalizer and implement it for Arctis Nova 5 #393

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

ne0phyte
Copy link

@ne0phyte ne0phyte commented Feb 1, 2025

Changes made

Added support for parametric equalizers.
Added implementation for Arctis Nova 5.

Description

I did not want to break the existing basic equalizer implementation so I added it independently as

  • capability CAP_PARAMETRIC_EQUALIZER
  • struct ParametricEqualizerInfo
  • struct parametric_equalizer_settings
  • struct parametric_equalizer_band
  • enum EqualizerFilterType

I added YAML and JSON outputs, help texts, output of capabilities and the five filter types the Arctis Nova 5 supports for now.
More filter types can be added if other headsets feature different filters and the supported filters are set by each devices implementation.

I implemented the 10 band parametric equalizer for the Arctis Nova 5 and tested setting bands and the different filter types against the SteelSeries GG Windows software.

Bands are represented by the typical parameters of parametric equalizers: frequency, gain, q-factor (band width) and filter type.

This is the help text (which also gives an example of the format I chose to specify the bands):

Parametric Equalizer:
  --parametric-equalizer STRING         Set equalizer bands (bands separated by semicolon)
      Band format:                      FREQUENCY,GAIN,Q_FACTOR,FILTER_TYPE
      Availabe filter types:            lowshelf, lowpass, peaking, highpass, highshelf, 

      Examples: --parametric-equalizer  '300,3.5,1.5,peaking;14000,-2,1.414,highshelf'
                                        Sets a 300Hz +3.5dB Q1.5 peaking filter
                                        and a 14kHz -2dB Q1.414 highshelf filter

                --parametric-equalizer  reset
                                        Resets/disables all bands

This is the info the JSON (and YAML) output contains:

      "parametric_equalizer": {
        "bands": 10,
        "gain": {
            "step": 0.5,
            "min": -10,
            "max": 10,
            "base": 20
        },
        "q_factor": {
            "min": 0.2,
            "max": 10
        },
        "frequency": {
            "min": 20,
            "max": 20000
        },
        "filter_types": [
            "lowshelf",
            "lowpass",
            "peaking",
            "highpass",
            "highshelf",
        ]
      },

Headset Name

Arctis Nova 5

Checklist

  • I adjusted the README (if needed)
  • For new features in HeadsetControl: I discussed it beforehand in Issues or Discussions and adhered to the wiki

@ne0phyte ne0phyte force-pushed the parametric-equalizer branch 2 times, most recently from c30d005 to ce2a113 Compare February 7, 2025 10:11
@ne0phyte
Copy link
Author

ne0phyte commented Feb 7, 2025

I undid the formatting changes of the lines the format-check job complained about.
(https://github.com/Sapd/HeadsetControl/actions/runs/13090278501/job/36807062988?pr=393)

I don't understand why, though, since those changes were the result of running make format according to the wiki.

@ne0phyte ne0phyte force-pushed the parametric-equalizer branch from ce2a113 to e537f2f Compare February 7, 2025 10:25
@Sapd
Copy link
Owner

Sapd commented Feb 22, 2025

Thank you, very well done. (And sorry for the delay, winter flu got me for some time)

There is a small crash when opening up the help with the test device:

./headsetcontrol --test-device --help
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x24)
    frame #0: 0x00000001000053b8 headsetcontrol`print_help(programname="/build/headsetcontrol", device_found=0x00000001000202d8, _show_all=false) at main.c:450:80
   447 	        printf("      Band format:\t\t\tFREQUENCY,GAIN,Q_FACTOR,FILTER_TYPE\n");
   448 	        printf("      Availabe filter types:\t\t");
   449 	        for (int i = 0; i < NUM_EQ_FILTER_TYPES; i++) {
-> 450 	            if (show_all || has_capability(device_found->parametric_equalizer->filter_types, i)) {
   451 	                printf("%s, ", equalizer_filter_type_str[i]);
   452 	            }
   453 	        }
Target 0: (headsetcontrol) stopped.

@ne0phyte
Copy link
Author

Thank you, very well done. (And sorry for the delay, winter flu got me for some time)

Thanks and no worries. I hope you're better now :)

There is a small crash when opening up the help with the test device:

./headsetcontrol --test-device --help

[...]

I fixed the crashing test device help. I initially just added the capability but forgot to create and attach the ParametricEqualizerInfo to the test device.

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