ESP32 Webradio

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

Re: ESP32 Webradio

Postby BuddyCasino » Fri Sep 22, 2017 8:40 am

Its for sending audio to the ESP32. Whats your use case for doing it the other way round?

Saskia
Posts: 40
Joined: Mon Jun 26, 2017 11:45 am

Re: ESP32 Webradio

Postby Saskia » Fri Sep 22, 2017 10:40 am

I could use a bluetooth speaker for sound output instead of a amplifier breakout board.

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

Re: ESP32 Webradio

Postby BuddyCasino » Fri Sep 29, 2017 6:42 pm

I went on a Bluedroid SDK search, but it seems A2DP source mode is not implemented. You'll have to ask Espressif if/when they'll plan to support it. I agree it would be quite useful.

kami_ESP32
Posts: 2
Joined: Wed Sep 20, 2017 11:38 am

Re: ESP32 Webradio

Postby kami_ESP32 » Sat Sep 30, 2017 8:53 pm

Hello,

currently I try to install and make the "ESP32 webradio streamer" from here: https://github.com/MrBuddyCasino/ESP32_MP3_Decoder
but I get the following error:

Code: Select all

Toshiba@Michael MINGW32 /c/esp/mp3
$ make
CC build/playlist/playlist.o
C:/esp/mp3/components/playlist/playlist.c:19:17: fatal error: ini.h: No such file or directory
compilation terminated.
make[1]: *** [/c/esp/esp-idf/make/component_wrapper.mk:243: playlist.o] Fehler 1
make: *** [C:/esp/esp-idf/make/project.mk:421: component-playlist-build] Fehler 2
I use Windows 8 and installed the Windows all-in-one toolchain & MSYS2 zip file from dl.espressif.com: https://dl.espressif.com/dl/esp32_win32 ... 170918.zip

After installation I switched back to release 5.2.0:

Code: Select all

cd ~/esp
git clone https://github.com/espressif/esp-idf.git esp-idf-v5.2.0
cd esp-idf-v5.2.0/
git checkout v5.2.0
git submodule update --init --recursive
The command

Code: Select all

git checkout v5.2.0
does not work.

What is the course of the make problem? I tried the

Code: Select all

git submodule init && git submodule update
but nothing happens. :shock:
My input console is MINGW64 from MSYS2 folder of Espressif installation.

Please help.
Best regards, Micha

ESP_Sprite
Posts: 8884
Joined: Thu Nov 26, 2015 4:08 am

Re: ESP32 Webradio

Postby ESP_Sprite » Sun Oct 01, 2017 2:35 am

Where did you get the 5.2.0 version number for esp-idf? At the moment, we're up to 2.1, working on 3.0; to succesfully switch to 5.2.0 you'd need a time machine :)

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: ESP32 Webradio

Postby loboris » Sun Oct 01, 2017 8:09 am

If you execute

Code: Select all

git clone https://github.com/espressif/esp-idf.git esp-idf-v5.2.0
the esp-idf master will be cloned to the local directory esp-idf-v5.2.0

https://git-scm.com/docs/git-clone
https://git-scm.com/docs/git-checkout

karawin
Posts: 6
Joined: Sat Oct 07, 2017 3:07 pm

Re: ESP32 Webradio

Postby karawin » Sat Oct 07, 2017 3:17 pm

Hi all
I made a little change on the soft to add a volume control.
Karadio32 is based on your soft and KaraDio for esp8266.
The volume control is from 0 to 256.

Check in https://github.com/karawin/Ka-Radio32

in audio_renderer.c
//KaraDio32
void renderer_volume(uint32_t vol)
{
if (vol >256) vol = 256;
renderer_instance->volume = vol<<8; // *256
}

and

//KaraDio32 Volume control
register uint32_t mult = renderer_instance->volume;
if (mult!= 0x10000) // need voluem?
{
int16_t *psample;
psample = (int16_t*)buf;
for (int i = 0; i < num_samples*buf_desc->num_channels; i++)
{
int temp = psample * mult;
psample = temp>>16 & 0xFFFF;
}
}

Works pretty well!
But still unable to play aac stations. Not enough heap i suppose.

pad_52
Posts: 3
Joined: Tue Oct 10, 2017 8:10 pm

Re: ESP32 Webradio

Postby pad_52 » Tue Oct 10, 2017 8:30 pm

Dear Folks,
First of all - Thank you for this great code!

In Master mode - everything works well as expected but I cannot find the way to use it in I2S Slave Mode with my ADAU1701.

Configuration is simple: 44100 Khz, 16bit depth, Standard I2S.

I first change this flag to:

Code: Select all

static void init_i2s(renderer_config_t *config)
{
    i2s_mode_t mode = I2S_MODE_SLAVE | I2S_MODE_TX;
This wasn't enough: The output on the I2S Data channel wasn't a standard I2S (I cannot see zeroes between Left and Right Channel);
In fact I read:

Code: Select all

const char samp32[4] = {ptr_l[0], ptr_l[1], ptr_r[0], ptr_r[1]};
                    bytes_pushed = i2s_push_sample(renderer_instance->i2s_num, (const char*) &samp32, max_wait);
I can get this fixed setting the rate at 32 bit depth like the Merus Audio kind of output.
In this mode I can see the zeroes in:

Code: Select all

const char samp64[8] = {0, 0, ptr_l[0], ptr_l[1], 0, 0, ptr_r[0], ptr_r[1]};
                    bytes_pushed = i2s_push_sample(renderer_instance->i2s_num, (const char*) &samp64, max_wait);
I imagine that I'm doing some confusion between I2S Frame lenght and Data Lenght (in 32bit of space i need to put 16bit of zeroes)...
I cannot understand so well where this could be set in my esp32...

Now I can get some audio - but really distorted.
Uncommenting the following:

Code: Select all

// takes too long
    i2s_event_t evt = {0};
    if(xQueueReceive(i2s_event_queue, &evt, 0)) {
        if(evt.type == I2S_EVENT_TX_DONE) {
            ESP_LOGE(TAG, "DMA Buffer Underflow");
        }
    }
Throw me DMA Buffer Underflow - could this be the problem?

Any help will be really appreciated!

pad52

--
It does not matter how slowly you go as long as you do not stop. - Confucio

unkown
Posts: 2
Joined: Tue Oct 10, 2017 9:08 pm

Re: ESP32 Webradio

Postby unkown » Tue Oct 10, 2017 9:34 pm

Hi,
got compiler-error and cant get missing ini.h with git submodule init && git submodule update .
My solution is download https://github.com/benhoyt/inih.git and put only content in
ESP32_MP3_Decoder-master/components/inih_port/inih/

I modified sdkconfig CONFIG_FREERTOS_HZ=10 cause ESP32 make Interrupt every
100ms for 8µs . With 1000Hz this can disturb timings. Lets try give feetback.

I use I2S with ES9023 and works. With PDM and DAC I hear good Sound with Crackling
have to check why.
Thx for ESP32 Webradio.

unkown
Posts: 2
Joined: Tue Oct 10, 2017 9:08 pm

Re: ESP32 Webradio

Postby unkown » Tue Oct 10, 2017 11:10 pm

hi again,
after CONFIG_FREERTOS_HZ=10 ,I got problems with my playlist change channels.
With CONFIG_FREERTOS_HZ=100 no problems.
So please be carefull with this option.

Who is online

Users browsing this forum: No registered users and 8 guests