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

Remove single_channel_output from the audio API layer #9877

Open
jepler opened this issue Dec 6, 2024 · 1 comment
Open

Remove single_channel_output from the audio API layer #9877

jepler opened this issue Dec 6, 2024 · 1 comment

Comments

@jepler
Copy link
Member

jepler commented Dec 6, 2024

This was added originally because it was needed on the first chips that had stereo output (samd51). However, of all the audio HW we support, this is only required for samd51 analog AudioOut, and only in certain cases (8-bit stereo or swapped 16-bit stereo). Supporting single_channel_output has been a hassle that is spread across all audio sources.

Instead, move the handling down into samd51 in a way that doesn't require support in each audio source, or have samd51 expand & channel swap into a temporary buffer as necessary.

Prompted by comments in #9876 and my own experiences with synthio & mp3decoder.

@dhalbert dhalbert added this to the Long term milestone Dec 9, 2024
@dhalbert dhalbert added the audio label Dec 9, 2024
@jepler
Copy link
Member Author

jepler commented Dec 9, 2024

This WIP branch saves just shy of 1kB on feather rp2350: https://github.com/jepler/circuitpython/tree/audioio-remove-single-buffer -- that gives an idea of the best possible savings. other platforms will save less. It also removes a net ~182 lines of code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants