Search found 76 matches

by Mike Teachman
Fri Feb 01, 2019 3:39 pm
Forum: ESP32 boards
Topic: i2s compatibility
Replies: 15
Views: 3121

Re: i2s compatibility

I'm not aware of a uPy I2S module for the ESP32. For a project that requires an I2S microphone I ended up writing a uPy module that uses the I2S interface in the ESP-IDF. I'll be finishing that work in a couple of days, then submitting a pull request to the main uPy repo. A few things left to do, li...
by Mike Teachman
Sat Dec 29, 2018 6:03 am
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

As expected, project time "yielded" to holiday time with family and friends ;) But, a few slices of time allowed me to experiment with the Fast IO implementation of uasyncio. https://github.com/peterhinch/micropython-async/blob/master/FASTPOLL.md A time-critical coroutine that handles microphone sam...
by Mike Teachman
Tue Dec 11, 2018 4:33 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

It is possible to improve this using my fast_io fork of uasyncio. This enables I/O coros to be written in a way that ensures that, every time any coro yields, the scheduler checks for the ready status of the I/O coro. Then T1 is the maximum delay of any one coro, and T2 is the similar average. This...
by Mike Teachman
Mon Dec 10, 2018 5:38 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

might have something to do with time.ticks_ms() being a 64-bit integer on loboris port using heap. In a post on his forum he says that in the next update, the behaviour will change and time.ticks_ms() will only return a 64-bit integer if the value needs it, otherwise it'll return a small int that w...
by Mike Teachman
Mon Dec 10, 2018 4:59 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

I have doubts about uasyncio coping with i2s. It depends on how the i2s code is implemented. uasyncio can handle data streams on UARTs because the UART interface uses interrupts and buffering. So the buffer is filled below the radar of uasyncio , and so long as the latter is emptied quicker than th...
by Mike Teachman
Mon Dec 10, 2018 3:46 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

I just found this thread and decided to test the example on an M5Stack with 4MB psRam using a Lobo stock firmware (ESP32_LoBo_v3.2.24 - 2018-09-06; psram_all). If I have the ftp and mDNS services running: await asyncio.sleep_ms(0): around 3.7-3.8 ms yield: around 2.7-2.8 ms If I have nothing but wi...
by Mike Teachman
Mon Dec 10, 2018 3:43 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

I ran the script you posted. Getting times of around 1.6-1.7 ms using an ESP32 with 4 MB PSRAM running a build of the standard Micropython repo with the module uasyncio as frozen. There were other modules as well in that directory. Thanks a lot for trying this testcase using the mainline repo. I ap...
by Mike Teachman
Fri Dec 07, 2018 7:27 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

Today, it's not possible to dedicate a uPy operation to a specific ESP32 core. The closest I've seen to this ambition is an experimental dual-core option on the LoBo port . As I understand it, with this option, the uPy VM runs on one core, and the rest of the ESP32 core rtos tasks (wifi, etc) run on...
by Mike Teachman
Fri Dec 07, 2018 4:18 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

For a nominal zero delay it is quicker to issue asyncio.sleep_ms(0) and quicker still to issue yield . Thanks for these insights! .. here are the test results: asyncio.sleep(0) = 6.6 ms delay asyncio.sleep_ms(0) = 7.0 ms delay yield = 6.5 ms delay Yield came out on top, and the _ms() version is slo...
by Mike Teachman
Fri Dec 07, 2018 3:48 pm
Forum: ESP32 boards
Topic: optimizing uasyncio performance
Replies: 26
Views: 3289

Re: optimizing uasyncio performance

kevinkk525 wrote:
Wed Dec 05, 2018 9:21 am
Do you have any feature of loboris port running like ftp? They spawn a new thread making the main thread slower. Maybe this is the problem?
Thanks for this idea. I tried turning off Telnet, FTP, and MQTT. This gave about a 5% performance improvement. Not very significant, but I'll take it!