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/io inits #438

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

Conversation

h4yn0nnym0u5e
Copy link
Contributor

As noted on this forum thread, from about here on, there can potentially be an issue with poor ordering of initialisation of audio I/O objects. The thread specifically mentioned the PT8211_2 object, and a change "sneaked in" in PR #436 seems to work OK.

I've been through most of the relevant objects and made them consistent, with the best (I believe) ordering being:

  • set up hardware and DMA, without enabling them
  • take update responsibility
  • attach DMA interrupt
  • enable DMA
  • enable hardware

There's no obvious reason why this should be any worse than the previous cases, what I've managed to test to date suggests nothing is broken, and it ought to serve to reduce instances of audio hardware mysteriously not working occasionally.

One caveat - I haven't managed to implement this for the AudioOutputPWM object, because I don't understand the code! I've PMed the most recent author @MarkTillotson for help.

The ::begin() functions previously had various orderings of setting up update responsibility, ISR, DMA and hardware. This fix tries to ensure that even if they execute slowly, e.g. out of FLASHMEM, or are interrupted, they will always execute and give consistent results.
Doesn't have update responsibility, but does use DMA etc.
It was on the wrong branch...
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.

1 participant