Skip to content

I2SOut: Pad data to 16 bits for compat with MAX98357A #2323

Open
@jepler

Description

@jepler

In theory, I2S works transparently for any number of sample bits. However, for MAX98357A, 8-bit samples are out of spec and appear to produce no audio!

After a discord discussion, we have decided to add padding so that 8 bit samples are extended to 16 bits before being put on the i2s bus.

Since the other I2S DAC, UDA1334 is discontinued, this should either be done all the time, or if it is not much work to do it optionally, it will default to enabled. This gives a better user experience with the MAX I2S breakout.

As a part of this, consider making sample transformation (e.g., 8->16 bits, unsigned->signed) happen at the audiocore level so that code duplication in the hardware interfaces is reduced. Likely this would allow eventual deletion of some duplicated code and maybe reduce code size overall on boards that have more than one audio output (e.g., dac + i2s, pwm + i2s)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions