Page 2 of 2

Re: Internet radio ESP32 and PCM5102

Posted: Wed Jun 30, 2021 7:00 am
by cicciocb
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jun 29, 2021 5:51 pm Hello Fernando,

Thank you for clearing up my confusion about the I2C and I2S buses.
Now I understand that I can indeed use both the OLED on the I2C (software-emulated) bus and the I2S DAC simultaneously.

This is a great community! I only joined a few days ago and all my questions were answered quickly and in detail.

If you don't mind, I have one more:
Did you have to tie any of the pins on the DAC board to ground (FLT, DEMP, FMT) or 3.3/5V (XSMT)?

Regards,
Eric
HI Eric,
just to clarify, as you stated, the I2S and the I2C can be used at the same time BUT they cannot share the same pins (the GPIO5, in your case).
Another point to clarify is that the I2C is not software emulated in the ESP32 ( as is the case for the ESP8266) as it reles on H/W I2C internal controller.

Re: Internet radio ESP32 and PCM5102

Posted: Wed Jun 30, 2021 8:43 am
by Fernando Perez
Another point to clarify is that the I2C is not software emulated in the ESP32 (as is the case for the ESP8266) as it reles on H / W I2C internal controller.

Does this mean that on the ESP32 only the GPIO21 (SDA) and GPIO22 (SCL) pins can be used to connect our I2C devices?

Re: Internet radio ESP32 and PCM5102

Posted: Wed Jun 30, 2021 11:53 am
by cicciocb
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Jun 30, 2021 8:43 am Another point to clarify is that the I2C is not software emulated in the ESP32 (as is the case for the ESP8266) as it relies on H / W I2C internal controller.

Does this mean that on the ESP32 only the GPIO21 (SDA) and GPIO22 (SCL) pins can be used to connect our I2C devices?
Hi Fernando,
no, the ESP32 has internally a switching matrix that can route almost any signal to any GPIO pin.
However, Some exception exists, such as the analog DAC outputs (fixed to pins 25 and 26).

So, the I2C can be routed to any GPIO pin still using the internal H/W I2C module

Re: Internet radio ESP32 and PCM5102

Posted: Thu Jul 01, 2021 5:59 pm
by ebs
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Jun 30, 2021 7:00 am HI Eric,
just to clarify, as you stated, the I2S and the I2C can be used at the same time BUT they cannot share the same pins (the GPIO5, in your case).
Another point to clarify is that the I2C is not software emulated in the ESP32 ( as is the case for the ESP8266) as it reles on H/W I2C internal controller.
Believe it or not, I did manage to use both the I2C OLED and the I2S DAC! My simple test program looks like this:

Code: [Local Link Removed for Guests]

i2c.setup 5, 4
oled.init 1
oled.cls
oled.font 2
oled.color 1

StreamName$ = "Beatles Radio"
StreamURL$ = "http://64.40.99.76:8000/"

oled.print 0, 0, StreamName$

play.setup 1, 64
play.stream StreamURL$
The program works, but there was some unexplained (until now) strange behavior - initial stuttering when the stream playback started, and the OLED seemed to operate much more slowly than normal. Given that both devices are trying to use GPIO5, I'm surprised it worked at all.
I was planning to use the OLED to show the stream and song name, but I may use an HTML interface, borrowing heavily from Fernando's code.

Thanks to both of you for all your help!

Regards,
Eric

Re: Internet radio ESP32 and PCM5102

Posted: Mon Jul 05, 2021 2:28 pm
by cicciocb
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Jun 30, 2021 11:53 am I was planning to use the OLED to show the stream and song name, but I may use an HTML interface, borrowing heavily from Fernando's code.
You should try to flash the ESP32 device in QIO mode as this is gives a little boost in performance with a nice benefit for the MP3 player

Re: Internet radio ESP32 and PCM5102

Posted: Tue Jul 06, 2021 2:41 am
by ebs
You should try to flash the ESP32 device in QIO mode as this is gives a little boost in performance with a nice benefit for the MP3 player
I'm not familiar with QIO mode - can you please give me a link to explain what it is and how to do it? Thanks!

Regards,
Eric

Re: Internet radio ESP32 and PCM5102

Posted: Tue Jul 06, 2021 10:19 am
by Fernando Perez
Before recording Annex on your ESP32, check the "Advanced Option" box and make sure the QIO option appears in the drop-down menu. Then proceed normally.
When you mentioned it, I remembered that I also got some nasty stuttering when I started playing a station, and sometimes during playback. However, it has not happened to me for a long time. Unfortunately, I don't remember if it was for linking GND to SCK pin, for placing the "bluetooth.delete" instruction at the beginning of the program, for using the latest version of Annex or for checking the QIO box.

image.png

Re: Internet radio ESP32 and PCM5102

Posted: Sun Jul 25, 2021 1:25 pm
by AndyGadget
I used a slightly different PCM5102A board and have finally got it working.
I had to connect FMT to Gnd and Xmt to 3v3 to get enything more than a strangled burp out of it.
Now it's working . . . It's BRILLIANT!
Love the quality on the VoiceRSS TTS.

Lots of new goodness to explore here :D :D :D

Re: Internet radio ESP32 and PCM5102

Posted: Thu Aug 05, 2021 3:39 pm
by AndyGadget
There's a good list of UK streaming stations (including the BBC) here : http://www.radiofeeds.co.uk/mp3.asp
To get the stream URL, click on the 'bitrate' button then use a text editor to examine the downloaded file and copy out the URL.