Real-time I2S audio mixing/passthrough? #2210
-
I'm attempting to salvage a project of mine by setting up a Pico W as a real time I2S audio mixer. After reading through the wiki and examples, I was able to write a short program to receive two standard I2S inputs and output a mixed one, When I tested it however, the output was all noise, almost like a jet turbine. The input devices are configured as I2S slave and the output device unfortunately must be configured as I2S master. I'll put my code below - Any advice would be greatly appreciated. (As an alternative question, is this even feasible with an rp2040?)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
One thing that occurs to me is that the addition can cause an overflow, though that shouldn't explain always just getting noise because it wouldn't happen for smaller signals. You could eliminate that as a problem by doing the division first: (a + b) / 2 can overflow Also, what happens if you lower the bit rate significantly? I don't know if there's a minimum but maybe try 12kHz first, which ought to give better bandwidth than a landline telephone, enough to reproduce speech. |
Beta Was this translation helpful? Give feedback.
-
There is no I2S slave mode support in the core. You can use those input devices since the Pico will be the master, but the output one needs the Pico to be a slave and it's not going to work at all. |
Beta Was this translation helpful? Give feedback.
There is no I2S slave mode support in the core. You can use those input devices since the Pico will be the master, but the output one needs the Pico to be a slave and it's not going to work at all.