sfera-labs / arduino-pico-i2s-audio

I2S digital audio input Arduino library for the Raspberry Pi Pico RP2040
8 stars 2 forks source link

WM8782 #3

Closed LouisCARRIOU closed 2 years ago

LouisCARRIOU commented 2 years ago

Hello, I bought a WM8782 module on audiophonics. I would like to use it to make an USB dual guitar recorder thanks to the rp pico, but I don't realy understand how to use the i2s lib with the master clock. Is it possible to do ? do you have some advice ?

giampiero7 commented 2 years ago

Hi, the functionalities of this library have now been included in the Arduino-Pico project. You find the doc here: https://arduino-pico.readthedocs.io/en/latest/i2s.html

LouisCARRIOU commented 2 years ago

It does'nt reply to the problem. Because it's same with the arduino pico project. There is no Master clock pin . So how to get the master clock that is arround 4x sclk ?

giampiero7 commented 2 years ago

Hi, If it's not documented, it means it's not implemented, you can open a feature request there. In the meantime you could maybe generate the clock using a PWM on a pin.

LouisCARRIOU commented 2 years ago

Thank you for your help, but I already tried, and it doesn't work well. I also tried with an external clock 24.567Mhz, but there are some clak (distortion) every 300ms approximativaly. Do you have an idea to transform the pio code to be able to get one more pinout signal 4 times faster than the sclk ?

giampiero7 commented 2 years ago

Hi, Adding a master clock could be a nice general addition. I'd suggest opening an issue on the arduino-pico project, which is where this is going to be further developed. All the best, G

LouisCARRIOU commented 2 years ago

Thank you. Yes I think it could be good too. The other good thing to do is to make a slave mode. I read that it's better sound quality because it's an external crystal that make the Master clock and the SCK, RLCK and DATA are generated by the audio chip. There is no data lost. I don't know how to transform the actual pio state machine to be a slave mode, I think it's not so difficult . If you have an idea you are welcome :-)