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

fix playing mono files on stereo output #7253

Merged
merged 1 commit into from
Nov 28, 2022

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Nov 24, 2022

While testing #5932, I discovered a different problem, which is that mono files played back on SAMD51 on stereo channels caused a buzz every other time. This was due to not checking the number of channels when setting up the DMA's.

Now, a mono file will play in only one channel if there are stereo channels. If two DMA's are set up (depends on the channel order), then the mono file would play twice as fast (I guess double incrementing is going on). This may be fixable but I think requires some internal API changes.

This is not the perfect fix, but is an improvement over the current situation, because it gets rid of poor sound quality (buzz) when playing mono files on stereo.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! Looks like mono in -> stereo will require refactoring since the dma setup code also manages the input buffer that would need to be shared.

@tannewt tannewt merged commit 6457827 into adafruit:main Nov 28, 2022
@dhalbert dhalbert deleted the samd51-stereo-fix branch November 28, 2022 20:54
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.

None yet

2 participants