【Feedback】I2S sound output and MP3 decoding in an ESP8266

ESP_Sprite
Posts: 25
Joined: Fri Oct 24, 2014 7:58 pm

【Feedback】I2S sound output and MP3 decoding in an ESP8266

Postby ESP_Sprite » Fri Jun 05, 2015 6:49 pm

As you all may know, the specsheet for the ESP8266 describes the chip as having an I2S port, which is a port to which you can connect an I2S DAC to get sound in and out of the chip. Unfortunately, up until now no documentation or examples about this port were available. We're working on these documents and examples right now, and I have taken the preliminary documentation and with the help of some colleagues here at Espressif have whipped up a little demonstration which uses HTTP to stream an MP3 stream (eg. webradio) to an I2S DAC. It basically is a standalone webradio streamer, everything (WiFi, HTTP streaming, MP3 decoding) happens inside the ESP8266. The only components you need to get good audio quality are an I2S audio DAC for audio output and a 23LC1024 SPI RAM chip for buffering of the MP3 stream. If bad quality audio and stuttering is acceptable, there even is a mode where you can stream audio without these two components: using only an ESP module (in theory, an ESP01 would work), a power supply and an amplifier/speaker you can get reasonable quality sound.

The code is at the official Espressif Github: https://github.com/espressif/esp8266_mp3_decoder
Be sure to read the README.md in the archive, configuration and use of the decoder can be a bit tricky.

User avatar
rudi
Posts: 197
Joined: Fri Oct 24, 2014 7:55 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby rudi » Sun Jun 07, 2015 12:34 pm

ggggggrrrrrrreeeeeáaaaaaaaaattttt!!!!

sprite!
ESP8266 goes MP3 (320 Kb)
DONE!
;-)
you did it again. ( 2:1 )
;-) perfect - no problems - test without the 2 ICS - hear with in ear phone'S and
it runs perfect!

i hear just in time in 320 kb/s streaming mp3 "summerbeat 2013" from simpy test IIS7 server.

my extended favorit tip:

run mediaserver (media encoder...) - stream audio ( voice, or other src ) over media server and you will have the babyphone ( wifi speaker ) with ESP8266 mp3

;-)

"10K thanks button"
txs! great work - sprite clear code - fine struct -
and espressif - fine documented - nice!!!
now its time for next surprise ...

best wishes
rudi ;-)

btw ;-)

welcome to espressif team!

;-)

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

mikewen
Posts: 1
Joined: Mon Jun 15, 2015 6:19 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby mikewen » Mon Jun 15, 2015 6:22 am

This is awesome!!! Thanks!

Do you know how to use I2S input device such as MEMS microphone?

Roie
Posts: 2
Joined: Wed Jun 10, 2015 2:52 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby Roie » Tue Jun 16, 2015 9:47 pm

What do you mean?

if my understanding is current, the MEMS Microphone get a clock and push data over I2S

btw,
i also try to loop every 20ms I2SRXFIFO, but still not working
data = (uint8)(READ_PERI_REG(I2SRXFIFO)&0xff);

rojer
Posts: 12
Joined: Mon Jun 15, 2015 5:51 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby rojer » Sat Jan 02, 2016 1:03 am

thanks for this, a very useful example!

i have question regarding bit/word clock generation: i am considering ESP8266 for an application which does both output (to a speaker) and input (from a microphone). i see that bit and word clock lines on ESP are separate, but the DAC/ADC i am considering uses the same BCK/WS for input and output. so the question is: (1) does ESP generate I2S clock only when there is data to output? and (2) can it use its own clock for I2S input, preferably without physically connecting I2SI_{BCK,WS} to their I2SO counterparts (to free up pins for other functions)?

micke_s
Posts: 1
Joined: Wed Jun 29, 2016 2:40 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby micke_s » Wed Jun 29, 2016 2:43 am

Hi Sprite_tm. Great work.

Is it possible to upgrade to newest SDK?
The new SDK use less ram so it will be nice to use it i think...

ESP_Greg
Posts: 49
Joined: Thu Sep 17, 2015 6:10 pm

Re: I2S sound output and MP3 decoding in an ESP8266

Postby ESP_Greg » Thu Jun 30, 2016 11:54 am

You can try with the latest SDK. Some guy already make it work.

ozzoxy
Posts: 2
Joined: Thu Jul 28, 2016 4:01 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby ozzoxy » Thu Jul 28, 2016 4:09 am

I get it from github. However i am not able to load it to esp8266. How can i do it? Could you explain it openly please ESP_Sprite.

Best regards

ESP_Rubin
Posts: 222
Joined: Wed Jun 29, 2016 11:59 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby ESP_Rubin » Thu Jul 28, 2016 7:59 pm

hello,
please refer to the README as link:https://github.com/espressif/ESP8266_MP3_DECODER/blob/master/README.md

ozzoxy
Posts: 2
Joined: Thu Jul 28, 2016 4:01 am

Re: I2S sound output and MP3 decoding in an ESP8266

Postby ozzoxy » Fri Jul 29, 2016 1:23 am

Many many thanks ESP_Rubin,

I have gotten some questions,

In the README file I get some information

Configuration options, building

All high-level options can be configured in mp3/user/playerconfig.h. Edit that file to set up your access point and a webradio stream or other source of MP3 data served over HTTP.

1. I have *.h editor like Pic C Complier And also i can edit this file taking knowledge in the playerconfig.h explanation

To build the code, try running make.sh in the mp3/ directory. Alternatively, the way to use 'make' to build this code is: make COMPILE=gcc BOOT=none APP=0 SPI_SPEED=40 SPI_MODE=QIO SPI_SIZE=1024

2. How can i run make.sh to generate .bin files as eagle.flash.bin eagle.irom0text.bin. i mean are there any compier for windows.

After that i have to flash esp8266 with these .bin files. What kind of program should i use. Could you give me a name? to success.

I have bought VS1003
http://www.aliexpress.com/item/Free-Shipping-5PCS-23LC1024-I-SN-23LC1024-SRAM-1MBIT-SDI-SQI-20-MHZ-SOP8/32653345044.html?spm=2114.13010608.0.74.xrvjXB
and 23LC1024 ram
http://www.aliexpress.com/item/Free-Shipping-5PCS-23LC1024-I-SN-23LC1024-SRAM-1MBIT-SDI-SQI-20-MHZ-SOP8/32653345044.html?spm=2114.13010608.0.74.xrvjXB

3. These components can be run with this project.


Best regards.

Who is online

Users browsing this forum: Bing [Bot] and 2 guests