Beta support for equilizer on PCM5122

I invite everyone to beta-test BQ-filters support on the PCM5122 DAC. Right now, it is available via the ESPHome driver, and work on snapclient is ongoing.

First implementation of the BQ-filters I did on the TAS5805M DAC, and it definitely has a much more complicated DSP engine, with 15 BQs per channel, and fairly good support in the PPC3 app. PCM5122 is a simpler device with only 6x BQ-filters, which are shared between both channels. It is still incredibly useful if you need to tune your audio to your taste or music conditions – create a filter appropriate to the speakers or enclosure.

What makes this implementation special is that all the BQ-filter parameters are calculated on the fly based on the user inputs – needed filter frequency, gain, and q-factor. So you’re not limited to pre-calculated values, but can set up your own set of filters via simple configuration

There is a fly in the ointment, though 🙂 Since I don’t have a PCM5122 EVM (and could not find a second-hand one), and the PPC app would not allow exporting BQ parameters without a device connected, I had to do a fair bit of reverse engineering to determine the data format and calculation formulas for each filter type. The only helpful part of the datasheet is the information on the correct register addresses for the biquad filter configuration, but even there, many coefficients lack documentation and must be set for audio processing.

While I have tested that changes to the gain parameter do have an effect on the audio output, I have not been able to fully verify that the frequency and Q-factor settings are applied correctly, due to a lack of test equipment. If you notice any issues with the EQ controls or if the frequency/Q settings don’t seem to have any effect, please open an issue with details about your hardware setup and observations. At this point, I’m pretty sure it doesn’t work correctly at high frequencies and at high gain values, but I’m not able to determine if that is expected behavior of the filters or if there is a bug in the implementation.

If you have a “Plus” version of the HiFi-ESP32 or Amped-ESP32 feel free to try it out, looking at the examples in the project repo


Comments

Leave a Reply