AudioPlayQueue::getBuffer() and ::playBuffer() can stall internally, dramatically impacting user code throughput. Teensyduino 1.56 beta 3 has a new ::play() function, which uses both these functions, and thus suffers the same issue.
This behaviour is undocumented, and appears to be hard (impossible?) to work around in the user's application.
Steps To Reproduce Problem
Run the example sketch, and note that loop() iterates very slowly.
Hardware & Software
Board: any
Shields / modules used: any
Arduino IDE version: any
Teensyduino version: 1.56 beta 3
Operating system & version: any
Any other software or hardware?: no
Program output from running on Teensy 4.1. Note that we achieve about 345 iterations of loop() per second, because NULL is never returned from getBuffer()
Description
AudioPlayQueue::getBuffer() and ::playBuffer() can stall internally, dramatically impacting user code throughput. Teensyduino 1.56 beta 3 has a new ::play() function, which uses both these functions, and thus suffers the same issue.
This behaviour is undocumented, and appears to be hard (impossible?) to work around in the user's application.
Steps To Reproduce Problem
Run the example sketch, and note that loop() iterates very slowly.
Hardware & Software
Board: any Shields / modules used: any Arduino IDE version: any Teensyduino version: 1.56 beta 3 Operating system & version: any Any other software or hardware?: no
Arduino Sketch
Errors or Incorrect Output
Program output from running on Teensy 4.1. Note that we achieve about 345 iterations of loop() per second, because NULL is never returned from getBuffer()
millis = 736, loops = 2, nulls = 0 millis = 837, loops = 44, nulls = 0 millis = 936, loops = 78, nulls = 0 millis = 1037, loops = 113, nulls = 0 millis = 1136, loops = 147, nulls = 0 millis = 1237, loops = 182, nulls = 0 millis = 1336, loops = 216, nulls = 0 millis = 1438, loops = 251, nulls = 0 millis = 1536, loops = 285, nulls = 0 millis = 1638, loops = 320, nulls = 0 millis = 1737, loops = 354, nulls = 0 millis = 1838, loops = 389, nulls = 0 millis = 1937, loops = 423, nulls = 0 millis = 2036, loops = 457, nulls = 0 millis = 2137, loops = 492, nulls = 0 millis = 2236, loops = 526, nulls = 0 millis = 2338, loops = 561, nulls = 0 millis = 2436, loops = 595, nulls = 0 millis = 2538, loops = 630, nulls = 0 millis = 2636, loops = 664, nulls = 0 millis = 2738, loops = 699, nulls = 0 millis = 2837, loops = 733, nulls = 0