ESP32 Webradio

User avatar
Jakobsen
Posts: 89
Joined: Mon Jan 16, 2017 8:12 am

Re: ESP32 Webradio

Postby Jakobsen » Mon May 08, 2017 10:50 pm

Hi Buddy

Nice work on the Bluetooth implementation - I have BT audio streaming up running with my 32 bit I2S interface to my MA12040P :-)
Push in 4 extra bytes pr L/R samples set and got stable audio flow.

But audio is very distorted / sounds more like playing what is left out in the joint_stereo setup. I will try to get deeper into the decoder and try with other controllable BT audio source.

But all in all a very big step forward for the holy grail of BT audio on the ESP32.

Grate work /Jakobsen
Analog Digital IC designer / DevOps @ Merus Audio, Copenhagen, Denmark.
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then

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

Re: ESP32 Webradio

Postby BuddyCasino » Tue May 09, 2017 1:31 pm

@bernard.xiong: I use the Fraunhofer AAC decoder now, check it out if you like. Its using a lot of RAM too, but at least radio streams seem to work better.

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP32 Webradio

Postby rudi ;-) » Tue May 09, 2017 7:16 pm

@mike
must take a short time for a general saying: "Thank you Mike!"
bt_sbc_i2s.jpg
bt_sbc_i2s.jpg (55.1 KiB) Viewed 14160 times
[/url]

best wishes
rudi ;-)
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

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

Re: ESP32 Webradio

Postby BuddyCasino » Tue May 09, 2017 7:35 pm

:D Thanks for the shout out.
Btw. I also made some progress on the Alexa client, main issue right now is that I2S RX doesn't work. If anyone can assist, I'd be grateful.

User avatar
Jakobsen
Posts: 89
Joined: Mon Jan 16, 2017 8:12 am

Re: ESP32 Webradio

Postby Jakobsen » Tue May 09, 2017 9:26 pm

Hi Buddy
Yes - Got Bluetooth 16 bits audio interleaved to 32 bits I2S and audio quality again set by i2s clock jitter. Very nice.

After syncing to lastest idf-sdk floating point performance has almost increased by 100% - Good news for anyone with plans for advanced DSP audio processing. Need to look closer into this.

/Jakobsen
Analog Digital IC designer / DevOps @ Merus Audio, Copenhagen, Denmark.
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then

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

Re: ESP32 Webradio

Postby BuddyCasino » Wed May 10, 2017 8:22 am

Jakobsen wrote: Yes - Got Bluetooth 16 bits audio interleaved to 32 bits I2S and audio quality again set by i2s clock jitter. Very nice.
Cool. Will route it through the renderer, the I2S Merus branch should work right?
Jakobsen wrote:Hi Buddy
After syncing to lastest idf-sdk floating point performance has almost increased by 100% - Good news for anyone with plans for advanced DSP audio processing. Need to look closer into this.
What lib are you using for the biquad, the Teensy one? How does the the audio processing pipeline look like, sample-by-sample or blocks of samples? I'd like to add a subsystem so filters can be plugged in easily.

User avatar
Jakobsen
Posts: 89
Joined: Mon Jan 16, 2017 8:12 am

Re: ESP32 Webradio

Postby Jakobsen » Wed May 10, 2017 1:31 pm

Hi Buddy

Still have some 16/32 bits alligenemt to look into - the BT module give out some dropped package when i do bulk i2s_write.
passing through the audio render sound like a good way to deal with diff. audio source.

My DSP code is still inline in a early port of your code. It is block based and it will come out as a module that easy can be plugged into the audio path.

/j
Analog Digital IC designer / DevOps @ Merus Audio, Copenhagen, Denmark.
We do novel and best in class Audio amplifiers for consumer products.
Programmed assembler for C-64 back in 1980's, learned some electronics - hacking since then

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

Re: ESP32 Webradio

Postby BuddyCasino » Thu May 11, 2017 2:49 pm

Jakobsen wrote: Still have some 16/32 bits alligenemt to look into - the BT module give out some dropped package when i do bulk i2s_write.
Any idea how to solve that?
Jakobsen wrote: My DSP code is still inline in a early port of your code. It is block based and it will come out as a module that easy can be plugged into the audio path.
Cool, I'll wait then. Idea: filters can register a callback with the audio renderer. They get a pointer to the PCM sample buffer and its format and are called whenever there is a buffer fresh from the decoder. Would that work?

I'm currently refactoring he renderer, I noticed you're doing this:

Code: Select all

            char high0 = sample_buff_ch0[i]>>8;
            char mid0  = sample_buff_ch0[i] & 0xff;
            char high1 = sample_buff_ch1[i]>>8;
            char mid1  = sample_buff_ch1[i] & 0xff;
            const char samp32[8] = {0,0,mid0,high0,0,0,mid1,high1};
Does that mean your chip wants LSB samples? It might be easier to configure the I2S interface as LSB and send MSB samples, so we don't have to care about that (I guess?).

EDIT: forget what I said above.The renderer is refactored, bt speaker and aac are now routed through it. 16 Bit, 32 Bit and DAC mode should work fine for all sources now.

User avatar
rudi ;-)
Posts: 1729
Joined: Fri Nov 13, 2015 3:25 pm

Re: ESP32 Webradio

Postby rudi ;-) » Sat May 13, 2017 2:55 pm

From the Tweet
Live Test with ESP Speaker Mode
and Android APP: Talking to A2DP - BabyPhone is born - done :)

direct demo show on YouTube
best wishes
rudi ;-)

Music Stream by A2DP:

First Download and Config ESP32 Webradio to Bluetooth Speaker Mode in Menuconfig

- Boot then your ESP32 with Speaker or DAC or what you want
- Activate Bluetooth on your Android
- search the A2DP SINK ( ESP-Speaker )
- connect to the Sink
- play your music, video ( audio will be streamed )

Bonus: talk to esp32 by A2DP
- run the Free A2DP Talking APP

have phun :),
thanks to @BuddyCasino for the ESP32 Webradio and support BT Speaker Mode... :mrgreen:



btw:
in the video is showing
i have power off music player ( pause ) before start the A2DP talking APP
you do not need this do - you can play your music and A2DP talking do at same time ;-)

info:
why there is a delay on A2DP talking: its a Android Security Part
cause Android does not support Hardware A2DP Service direct on each Phone ( unrootet )
- the Audio from Talking is for this showing simple buffered
next step is: Direct HW A2DP service - you need then more rights on the phone ( or rootet phone )
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪

WiFive
Posts: 3529
Joined: Tue Dec 01, 2015 7:35 am

Re: ESP32 Webradio

Postby WiFive » Sat May 13, 2017 5:54 pm

rudi ;-) wrote: you do not need this do - you can play your music and A2DP talking do at same time ;-)
Oh no esp32 karaoke machine is born

Who is online

Users browsing this forum: No registered users and 15 guests