-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use only DMA0 for PIO background read/write #9980
Conversation
Great, thanks for these changes, and sorry about the broken tests, I will get them going. |
@dhalbert The |
@relic-se Would you be willing to test the artifact builds here with those examples? Maybe if you are already set up to do so. |
@relic-se if you could describe how to set up a simple test, that would be great. I see the examples programs in the library, but I'm not sure how to set them up to actually send data and test the functionality, in the simplest way possible. For instance, I'm not sure if I need to connect an I2s mic and amp to verify that it works, or whether some loopback test could be set up. |
@dhalbert Here's a basic loopback test: https://gist.github.com/relic-se/b90aae77ec4fccb7b03826007b0e41b3. I haven't gotten around to building the fork of this PR, but I've tested it on v9.2.3 using an RP2040-Zero. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this build using the example provided in the gist above. The program locks up with the following traceback:
Traceback (most recent call last):
File "<stdin>", line 16, in <module>
File "pio_i2s.py", line 361, in write
File "pio_i2s.py", line 340, in write_ready
File "pio_i2s.py", line 316, in _get_write_index
The changes in this review result in a functioning test with an error output of 0.
3d3b81d
to
a9d41bb
Compare
@relic-se I added your changes and rebased as well, to catch up. Could you re-test? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good and test runs without a hitch!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Though I didn't follow the whole discussion this looks sensible and I didn't spot any mistakes. No testing performed.
Changes PIO background read/write to use only DMA0, not DMA1. This is a minimal change that does not change the current use of a static IRQ handler in
ports/raspberrypi/audio_dma.c
. It reverts to using only DMA0, and uses twobackground_pio...
arrays to distinguish between read and write.picodvi
now works again.If this works, then I can explore using
irq_add_shared_handler()
as discussed in #9868.@timchinowsky I tried to test this using a loopback test from https://github.com/timchinowsky/tac5/blob/main/README.md. But those tests as written use a
test=
arg which is no longer present. Could you test this (and update the loopback tests)? Thanks.