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

should audio_i2s_setup claim the dma channel requested by the user? #48

Open
peterharperuk opened this issue Nov 18, 2022 · 3 comments
Open
Assignees

Comments

@peterharperuk
Copy link

peterharperuk commented Nov 18, 2022

audio_i2s_setup has a config passed in which includes the dma channel to use. It claims this dma channel. But should the caller claim the channel instead? As there's no guarantee the channel will be free by the time audio_i2s_setup tries to claim it?

@peterharperuk
Copy link
Author

It also has a configuration item for the pio state machine whereas the pio itself is a build time configuration. Would it not be better for it to just search for a free pio/sm itself?

@kilograham
Copy link
Contributor

These libraries predated the claiming APIs most likely, but sometimes it is good/important to use specific PIO/SM

All for updating them, but needs to be done in a way that preserves the existing behavior (i.e. either use a -1 or something for auto-pick, and/or use a #define to control stuff) - if you have a look around, i think there are other places where we have made previously provided #defines optional, and if they aren't present then auto-select

@peterharperuk peterharperuk self-assigned this Nov 18, 2022
@peterharperuk
Copy link
Author

it is good/important to use specific PIO/SM
That makes sense. It's just a bit clunky that the pio is a #define but the sm is a value in a config structure?

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

No branches or pull requests

2 participants