Re: ESP32 Webradio
Posted: Mon Nov 06, 2017 8:53 pm
Hi Buddy,
I'm studying your project and I have a problem with playing music in APLL mode with PDM. First I compiled the sources without any change and start radio with APPL + PDM. And the problem is that output play very-very-very slow - actually even I can't understand what is playing. I've tried without APLL - it plays OK (but not a long time).
Below is the output for APLL and non-APLL modes. For APLL It looks good except XTAL 35MHz. Could you please advice what is the problem? Maybe for APLL I need another configuration of HW?
>>> Output for APLL
...
I (66) boot: Detected ESP32
W (68) rtc_clk: Potentially bogus XTAL frequency: 35 MHz, guessing 40 MHz
...
I (3756) renderer: init I2S mode 3, port 0, 16 bit, 44100 Hz
I (3756) renderer: chip revision 1, enabling APLL
I (3766) I2S: queue free spaces: 1
I (3766) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=32
I (3776) I2S: APLL: Req RATE: 44100, real rate: 44099.020, BITS: 16, CLKM: 1, BC K: 8, MCLK: 5.669, SCLK: 1411168.625000, diva: 1, divb: 0
I (3786) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldo wn: 0| Intr:1
I (3796) main: RAM left 170588
....
I (4226) audio_player: Buffer fill 50%, 16012 bytes
I (4316) audio_player: RAM left 170968
I (4316) audio_player: created decoder task: mp3_decoder_task
I (4316) mad_decoder: decoder start
E (4316) mad_decoder: dec err 0x0235 (bad main_data_begin pointer)
E (4326) mad_decoder: dec err 0x0235 (bad main_data_begin pointer)
I (4326) audio_player: Buffer fill 91%, 29134 bytes
I (4516) wifi: pm start, type:0
I (8016) audio_player: Buffer fill 94%, 30123 bytes
I (12126) audio_player: Buffer fill 96%, 30985 bytes
...
I (51116) audio_player: Buffer fill 99%, 31832 bytes
I (53846) http_client: ... done reading from socket. Last read return=0 errno=12 8
I (53846) http_client: socket closed
I (53846) web_radio: http_client_get completed
I (63186) mad_decoder: decoder stopped
I (63186) mad_decoder: MAD decoder stack: 540
>>> Output for non-APLL
I (3276) renderer: init I2S mode 3, port 0, 16 bit, 44100 Hz
I (3276) renderer: chip revision 1, enabling APLL
I (3286) I2S: queue free spaces: 1
I (3286) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=32
I (3296) I2S: PLL_D2: Req RATE: 44100, real rate: 200000.000, BITS: 16, CLKM: 5, BCK: 5, MCLK: 5.669, SCLK: 6400000.000000, diva: 64, divb: 42
....
For me it is strange digits i I2S output here. Playing is OK, but not a long time as it plays lower rate than in browser and I suppose output buffer of server finished. Thank for help in advance.
I'm studying your project and I have a problem with playing music in APLL mode with PDM. First I compiled the sources without any change and start radio with APPL + PDM. And the problem is that output play very-very-very slow - actually even I can't understand what is playing. I've tried without APLL - it plays OK (but not a long time).
Below is the output for APLL and non-APLL modes. For APLL It looks good except XTAL 35MHz. Could you please advice what is the problem? Maybe for APLL I need another configuration of HW?
>>> Output for APLL
...
I (66) boot: Detected ESP32
W (68) rtc_clk: Potentially bogus XTAL frequency: 35 MHz, guessing 40 MHz
...
I (3756) renderer: init I2S mode 3, port 0, 16 bit, 44100 Hz
I (3756) renderer: chip revision 1, enabling APLL
I (3766) I2S: queue free spaces: 1
I (3766) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=32
I (3776) I2S: APLL: Req RATE: 44100, real rate: 44099.020, BITS: 16, CLKM: 1, BC K: 8, MCLK: 5.669, SCLK: 1411168.625000, diva: 1, divb: 0
I (3786) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldo wn: 0| Intr:1
I (3796) main: RAM left 170588
....
I (4226) audio_player: Buffer fill 50%, 16012 bytes
I (4316) audio_player: RAM left 170968
I (4316) audio_player: created decoder task: mp3_decoder_task
I (4316) mad_decoder: decoder start
E (4316) mad_decoder: dec err 0x0235 (bad main_data_begin pointer)
E (4326) mad_decoder: dec err 0x0235 (bad main_data_begin pointer)
I (4326) audio_player: Buffer fill 91%, 29134 bytes
I (4516) wifi: pm start, type:0
I (8016) audio_player: Buffer fill 94%, 30123 bytes
I (12126) audio_player: Buffer fill 96%, 30985 bytes
...
I (51116) audio_player: Buffer fill 99%, 31832 bytes
I (53846) http_client: ... done reading from socket. Last read return=0 errno=12 8
I (53846) http_client: socket closed
I (53846) web_radio: http_client_get completed
I (63186) mad_decoder: decoder stopped
I (63186) mad_decoder: MAD decoder stack: 540
>>> Output for non-APLL
I (3276) renderer: init I2S mode 3, port 0, 16 bit, 44100 Hz
I (3276) renderer: chip revision 1, enabling APLL
I (3286) I2S: queue free spaces: 1
I (3286) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=32
I (3296) I2S: PLL_D2: Req RATE: 44100, real rate: 200000.000, BITS: 16, CLKM: 5, BCK: 5, MCLK: 5.669, SCLK: 6400000.000000, diva: 64, divb: 42
....
For me it is strange digits i I2S output here. Playing is OK, but not a long time as it plays lower rate than in browser and I suppose output buffer of server finished. Thank for help in advance.