Closed Anton-2 closed 4 years ago
i wonder if we'd be able to play audio off sd card, something that did not work before :)
For audio playback, it’s something I’m going to try in the next days, as it would help me in my project. But I fear that reading samples in the background won’t work : auto-refreshing the display always lock the board up. I had to use manual refresh to make it work.
I fear that we can’t call python code in sdcard.py in the background while running python code in the main loop. That’s why a C version of sdcard.py would be usefull, more than speed improvements.
Tested on a pyportal, with CircuitPython 5.0.0 alpha 4.
My ad-hoc benchmark is 20 refresh of the screen, with a 64x64 OnDiskBitmap on the SDCard. Original adafruit_sdcard.py takes 19 s. By removing the CRC table re-calculation, we are down to 1s. Maxing the data rate at 24Mhz makes it 0.7s.
Other changes involve reading status bytes first before testing them. It's marginally faster, and more correct on line 257 where it was not initialized.