Closed artheist closed 3 years ago
Hi Sylvain,
I tried to recreate the problem, using:
play-stereo-wav-from-internal-flash.py
example code (no change to bck, ws, sd pins)Result: the side-to-side audio file played correctly through the attached ear buds.
I am having difficulty to explain the problem you are seeing. The frequency used in the example is 8000 Hz. That should translate to a frequency of 8000 Hz (0.125ms period) on the WS pin (LRClk).
Here is something to try: change the sample rate in the example code to see if there is a change in the WS (LRClk) period that you measure on the scope. Try a few different samples rates such as 16000, 22050, 32000, 44100 Hz. Does the measured signal change?
The ESP-IDF code bug that swaps the L and R channels should not be causing this problem.
Sometime this month I will be releasing a new PR for I2S that supports the ESP32, and PyBoards. Hopefully the maintainers will merge the new PR into the mainline. The new PR has an API that is easier to understand.
There is always an answer to these problems. We'll figure it out ! Mike
Hi Mike, thanks for your quick reply.
1 . OK (I have ESP32 version, not ESP8266)
I tried first without anything attached, just the board powered over USB, nothing else. Changed the sample rate according to the same values you suggested and LRClk is perfectly fine. I took pictures of LRClk for different sample rates, but nothing to report here.
At 44.1k, sdout looks kind of ok, even though a bit small, but I guess the fact that the wav file is 8k played at 44.1k might give weirder shapes.
But BCK is still wacky, it looks like there is an underlying clock at the correct rate, but with some modulation over it ... I suspect my power in the house to be the pb ... as if the 50Hz was modulating my clock ... This is a wild guess since I am in total despair atm.
Hi Mike,
Just wanted to let you know that I finally got it working ! I think my main problem was the PCM5102A was fried ... Replacing it with another one got it fixed.
Cheers,
Closing the issue since it is resolved for me :)
Thanks for following up on the problem. I'm really glad you were able to find the root cause of the flakiness because I was out of ideas !
Hi,
First, I would like to thank you for this amazing work, and if I can be of any help for beta-testing let me know, as far as my knowledge goes.
I am struggling to make the example work for the one with the internal SD card. I tried out with the Huzzah Feather as well as with TT-GO and the problem is the same: both Sdout and LRClk look fine on the scope but not BCK ... I am not sure how to describe it and what type of information you would need to help me out on this ...
What I can say is, with only the board plugged to the USB and nothing else attached, the LRClk is clean and ~50-60 ms periodic, where the sdout has a nice waveform about the same frequency, whereas the BCK looks like a bunch of random bursts of square waves ...
Also, I am using the firmware without the spiram and I read that you mentioned a bug in ESP-IDF about LR channel inversion. Could this also be related and should I rather compile my own firmware from your PR ?
Last question, it looks like your PR is 99% there, you are basically just waiting for approval, is that it ?