ESP32 Webradio

Quanghoster
Posts: 3
Joined: Wed Feb 14, 2018 9:34 am

Re: ESP32 Webradio

Postby Quanghoster » Wed Feb 14, 2018 9:42 am

Hi,
I've just came across your project and am looking at using it in in a project to update an old 80s boombox. This will be the first project using the SDK as I've been using the Arduino IDE so far so a spot of learning to do, though I'm familiar with C and similar tool chains from my Linux programming days.

Cool project, thanks for sharing. One question I have (though I'm sure there will be more) is, is the Bluetooth mode and webradio mode build specific? i.e. when you load the application can you switch between modes at runtime or is the application build just as one or the other?

Thanks,
Andy

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: ESP32 Webradio

Postby BuddyCasino » Wed Feb 14, 2018 10:39 am

The problem is that Bluetooth consumes a lot of RAM, and the web radio needs a lot of it, especially for AAC. It is currently not possible to dynamically allocate and de-allocate the Bluetooth memory, which makes switching between the two modes during runtime impossible. You might get around this if you use a module with external PSRAM.

frankiPL
Posts: 9
Joined: Thu Nov 16, 2017 8:59 am

Re: ESP32 Webradio

Postby frankiPL » Wed Feb 14, 2018 10:46 am

Hi

I have tried this recently. I mean to use bluetooth with this project and indeed I could not flash the chip because project was to big (I mean flashing was ok, but esp does not boot).
However, I have seen somewhere that new esp-idf (I'm not sure which version) will have or already has bluetooth memory allocated dynamically. Correct me if I'm wrong.

Best Regards
Marek

Quanghoster
Posts: 3
Joined: Wed Feb 14, 2018 9:34 am

Re: ESP32 Webradio

Postby Quanghoster » Thu Feb 15, 2018 12:38 pm

OK. I get the memory issue. However, could a workaround be that when an io pin used to change from one mode t the other the esp is forced to reboot? The selected mode could be stored in nvram and checked on boot as to which mode is required?

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: ESP32 Webradio

Postby BuddyCasino » Fri Feb 16, 2018 8:18 am

Maybe, it might be possible to allocate or deallocate BT memory once, I'm not sure. You'll have to test it.

Quanghoster
Posts: 3
Joined: Wed Feb 14, 2018 9:34 am

Re: ESP32 Webradio

Postby Quanghoster » Fri Feb 16, 2018 10:21 am

Setting up the environment atm and I'll look into it. I also happen to have an m5stack core so will take a look at working with that. I look forward to contributing as I get up to speed :-)

unkown12345
Posts: 1
Joined: Mon Feb 19, 2018 11:12 pm

Re: ESP32 Webradio

Postby unkown12345 » Tue Feb 20, 2018 10:17 am

Hi MrBuddy,
i wrote a icy-meta-parser for this projekt and like to share it.
Only little changes in http-fifo-files with example in app_main.c for Monitoring.
Please contact me ritaripp@gmx.de to send files.
:idea:
kodera2t/ESP32_OLED_webradio seems not to be interested.

regards
Reini

BuddyCasino
Posts: 263
Joined: Sun Jun 19, 2016 12:00 am

Re: ESP32 Webradio

Postby BuddyCasino » Wed Feb 21, 2018 11:36 am

Can you make a pull request on Github?

akohlsmith
Posts: 1
Joined: Fri Jan 12, 2018 11:26 pm

Re: ESP32 Webradio

Postby akohlsmith » Tue Mar 13, 2018 4:28 am

I'm having some trouble building the webradio... it seems to get itself in a boot loop.

Code: Select all

I (206) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.
I (208) main: starting app_main()
I (208) main: RAM left: 156944
I (238) main: hardware initialized
I (238) main: starting network
I (238) wifi: wifi firmware version: 9b17948
I (238) wifi: config NVS flash: enabled
I (248) wifi: config nano formating: disabled
I (248) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (258) system_api: Base MAC address is not set, read default base MAC address from BLK0 of EFUSE
I (288) wifi: Init dynamic tx buffer num: 32
I (288) wifi: Init data frame dynamic rx buffer num: 32
I (288) wifi: Init management frame dynamic rx buffer num: 32
I (288) wifi: wifi driver task: 3ffdd260, prio:23, stack:4096
I (298) wifi: Init static rx buffer num: 10
I (298) wifi: Init dynamic rx buffer num: 32
I (298) wifi: wifi power manager task: 0x3ffe2318 prio: 21 stack: 2560
I (348) phy: phy_version: 366.0, ba9923d, Dec 29 2017, 14:25:06, 0, 0
I (348) wifi: mode : sta (24:0a:c4:11:68:20)
I (348) wifi: received wifi event 2
I (358) wifi: connected successfully
I (478) wifi: n:11 0, o:1 0, ap:255 255, sta:11 0, prof:1
I (1308) wifi: state: init -> auth (b0)
I (1318) wifi: state: auth -> assoc (0)
I (1348) wifi: state: assoc -> run (10)
I (1358) wifi: connected with Kohlsmith, channel 11
I (1368) wifi: received wifi event 4
I (2228) event: sta ip: 192.168.77.95, mask: 255.255.255.0, gw: 192.168.77.1
I (2228) wifi: received wifi event 7
I (2228) playlist: Tracks:
SomaFM / Illinois Street Lounge - http://ice1.somafm.com/illstreet-128-mp3
SomaFM / Secret Agent - http://ice1.somafm.com/secretagent-128-mp3
SomaFM / Left Coast 70s - http://ice1.somafm.com/seventies-128-mp3
SomaFM / Boot Liquor - http://ice1.somafm.com/bootliquor-128-mp3
I (2258) renderer: init I2S mode 2, port 0, 16 bit, 44100 Hz
I (2258) I2S: queue free spaces: 1
I (2268) I2S: DMA Malloc info, datalen=blocksize=256, dma_buf_count=32
I (2268) I2S: PLL_D2: Req RATE: 44100, real rate: 2777.000, BITS: 16, CLKM: 30, BCK: 60, MCLK: 30.234, SCLK: 88864.000000, diva: 64, divb: 14
I (2288) gpio: GPIO[0]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 1| Pulldown: 0| Intr:1
Guru Meditation Error: Core  0 panic'ed (Interrupt wdt timeout on CPU0)
Register dump:
PC      : 0x400840d3  PS      : 0x00050034  A0      : 0x400828f4  A1      : 0x3ffc05e0
A2      : 0x00000027  A3      : 0x3ff44000  A4      : 0x00000000  A5      : 0x00000001
A6      : 0x0000001f  A7      : 0x3ffc8884  A8      : 0x00000028  A9      : 0x00000007
A10     : 0x3ffc8880  A11     : 0x3ffe5fa4  A12     : 0x800d17ba  A13     : 0x3ffe5f98
A14     : 0x3ffd7a98  A15     : 0x1300324d  SAR     : 0x00000020  EXCCAUSE: 0x00000005
EXCVADDR: 0x00000000  LBEG    : 0x4000c46c  LEND    : 0x4000c477  LCOUNT  : 0xffffffff

Backtrace: 0x400840d3:0x3ffc05e0 0x400828f1:0x3ffc0610 0x4000bfed:0x00000000

Rebooting...
ESP32_MP3_Player branch master, git commit 91e2f15, submodules updated
esp-idf git commit branch release/v3.0, commit daf1d055, submodules updated

(aside: is there any need to update the submdoules to a specific checkout when checking out a branch? If so, how?)

I've got BT support on, but I get the same CPU hang with BT support turned off. This is my BT config:

Code: Select all

 --- Bluedroid Enable
       The cpu core which Bluedroid run (Core 0 (PRO CPU))  --->
 (3072) Bluetooth event (callback to application) task stack size (NEW)
 [ ]   Bluedroid memory debug (NEW)
 [*]   Classic Bluetooth
 (2048)  A2DP sink (audio stream decoding) task stack size (NEW)
 [*]   Include GATT server module(GATTS) (NEW)
 [*]   Include GATT client module(GATTC) (NEW)
 [*]   Include BLE security module(SMP) (NEW)
 [ ]   Close the bluedroid bt stack log print (NEW)
 (4)   BT/BLE MAX ACL CONNECTIONS(1~7) (NEW)
What can I do to resolve this?

Espe21
Posts: 8
Joined: Sat May 19, 2018 6:38 am

Re: ESP32 Webradio

Postby Espe21 » Wed May 23, 2018 1:02 pm

i have a problem with the webradio.
Here is the log:

Code: Select all

(5841) http_client: ... socket send success
(6861) audio_player: Buffer fill 25%, 16026 bytes
(7781) audio_player: Buffer fill 49%, 31998 bytes
(8611) audio_player: Buffer fill 75%, 48009 bytes
(9521) audio_player: RAM left 143352
(9521) audio_player: created decoder task: mp3_decoder_task
(9521) mad_decoder: decoder start
(9531) mad_decoder: dec err 0x0235 (bad main_data_begin pointer)
(9531) mad_decoder: dec err 0x0235 (bad main_data_begin pointer)
(9841) audio_player: Buffer fill 79%, 51061 bytes
(11061) audio_player: Buffer fill 42%, 26896 bytes
(12291) audio_player: Buffer fill 8%, 5264 bytes
(12591) mad_decoder: Buffer underflow, need 2572 bytes.
(12591) mad_decoder: Buffer underflow, need 2572 bytes.
(12591) mad_decoder: Buffer underflow, need 2572 bytes.
(12741) mad_decoder: Buffer underflow, need 2861 bytes.
(12741) mad_decoder: Buffer underflow, need 2861 bytes.
(12741) mad_decoder: Buffer underflow, need 2861 bytes.
(12741) mad_decoder: Buffer underflow, need 2861 bytes.
(12751) mad_decoder: Buffer underflow, need 2861 bytes.
Here is the playerconfig.h

Code: Select all

#ifndef _PLAYER_CONFIG_H_
#define _PLAYER_CONFIG_H_
// defined via 'make menuconfig'
#define WIFI_AP_NAME CONFIG_WIFI_SSID
#define WIFI_AP_PASS CONFIG_WIFI_PASSWORD
// defined via 'make menuconfig'
#define AUDIO_OUTPUT_MODE CONFIG_AUDIO_OUTPUT_MODE
#define FAKE_SPI_BUFF
#endif
Here viewtopic.php?t=1026&start=80#p7783 i have read something about #define DAC_BUG_WORKAROUND but i can't find it.

I am new on esp32. it would be very nice if someone can help me.
thank you.

Who is online

Users browsing this forum: No registered users and 25 guests