Simultaneous input and output Teensy 4.1 -> Audio Shield #9939
-
Hello! Does micropython support (near) simultaneous input and output on the Teensy 4.1 -> pjrc Audio Shield? If not, how could I help support that? Paul Stoffregen seems to have figured it out. His Teensy Audio library contains an example of simultaneous read-write: PassThroughStereo.ino. Also, apparently it was broken for a time and then fixed in this commit. Paul's implementation uses either...
If Paul's IS2 objects (ie: AudioOutputI2S and AudioInputI2S.cpp) use a single I2S bus, could MicroPython's I2S class be changed support something similar? Having looked at those files and their parent, AudioStream, I can't tell whether each IS2 object is its own I2S bus or if somehow, cleverly, requests from both instances of the AudioStream class are handled by a single I2S bus. I don't know C++ well enough to know where to look. If Paul uses two I2S busses with the same SCK and WS pins, how could we change MicroPython's I2S class or @rdagger 's SGTL5000 class to allow using the same SCK and WS pins for two IS2 instances? I find that I get an EPERM error when I try to use two I2S instances that use the same SCK and WS pins. Thank you! related question: simultaneous i/o for the ESP32 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I've never tried to do this, but it might be possible.
|
Beta Was this translation helpful? Give feedback.
I've never tried to do this, but it might be possible.
Here are two approaches I can suggest:
Configure two I2S instances, one for receive, one for transmit. To avoid the SCK/WS EPERM error, map the 2nd I2S instance to unused SCK/WS pins. The pin choices for Teensy I2S pins are listed here. Use an oscilloscope to determine if the SCK and WS signals from the two I2S instances are lined up. If the signals line up you will be able to simultaneously receive and transmit audio samples from the codec on the Teensy audio shield. However, I doubt that this approach will work as I suspect that …