Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

To test the library with different hardware #1

Open
baldram opened this issue Jul 5, 2017 · 35 comments
Open

To test the library with different hardware #1

baldram opened this issue Jul 5, 2017 · 35 comments

Comments

@baldram
Copy link
Owner

baldram commented Jul 5, 2017

The issue was created to test the library with different boards and collect the result.

It will be published in the documentation here: Tested and compatible boards.

I ask you for help to test the ESP_VS1053_Library and share the results.
A pull request to update this file is also very welcome!

Known working hardware - tested so far:

@baldram
Copy link
Owner Author

baldram commented Jul 5, 2017

The library was tested with two different ESP8266 based boards.
I successfully run the example sketch and managed to play the test mp3 flow.

Below the hardware details:

  • LoLin NodeMCU V3 (ESP-12F) + LC Technology VS1053 MP3 Codec board,

VS1053B and NodeMCU v3

Wiring details:

LC Technology VS1053 LoLin NodeMCU V3
SCK D5
MISO D6
MOSI D7
XRST RST
CS D1
DCS D0
DREQ D3
5V VU
GND G

The interesting part is that I also tried to connect 5V of LC Technology VS1053 board to 3V of LoLin NodeMCU V3 and it worked fine. So according to the table above, 5V ==> 3V also works. This is probably because the LC Technology board has some additional components which makes it possible, even it's not clearly documented.

  • RobotDyn WiFi D1 R2 (ESP-8266 EX) + LC Technology VS1053 MP3 Codec board.

VS1053B and RobotDyn WiFi D1 R2

Wiring details:

LC Technology VS1053 RobotDyn WiFi D1 R2
SCK SCK/D5
MISO MISO/D6
MOSI MOSI/D7
XRST RST
CS SCL/D1
DCS D0
DREQ D3
5V 5V
GND GND

@baldram
Copy link
Owner Author

baldram commented Jul 9, 2017

Below test results for ESP32 based board.

  • Espressif ESP32 Core Board V2 / ESP32 DevKitC + LC Technology VS1053 MP3 Codec board.

A test mp3 from SimpleMp3Player example sketch was successfully played with the following platformio.ini settings.

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino

lib_deps =
    ESP_VS1053_Library

esp-wroom-32-and-vs1053

Wiring details:

LC Technology VS1053 Espressif ESP32 DevKitC
SCK IO18
MISO IO19
MOSI IO23
XRST EN
CS IO5
DCS IO16
DREQ IO4
5V 5V
GND GND

Consts of SimpleMp3Player.cpp defined in the following way:

#define VS1053_CS     5
#define VS1053_DCS    16
#define VS1053_DREQ   4

When look on pinout of Wemos LoLin32, settings above should work for this board too. I assume it works, but I don't have Womos one to test it. (In platformio.ini please use the lolin32 platform then).
Here is the pinout to compare between Espressif ESP32 and Wemos LoLin32.

EDIT: The library has been tested with Lolin32. Please see here.

@Aggebitter
Copy link

Aggebitter commented Dec 20, 2017

Noticed that every one is driving the board at 5V. Is the logic output 3.3V ?

I've just got the lib up and running with a NANO32 and a Geetech VS1053 MP3 breakout board clone
(https://www.geeetech.com/vs1053-mp3-breakout-board-sd-card-slot-p-611.html)
But for the SD part I started with bypass the fixed AMS1117 3.3V regulator and drive the board at 3.3V

@baldram
Copy link
Owner Author

baldram commented Dec 20, 2017

@Aggebitter I'm glad you managed to run the lib. If you like it please do not forget to star the project :)

Yes, I successfully run those mp3 boards driving with 5V.
If about the logic, LoLin NodeMCU V3 is 3.3V and works fine with VS1053.
I also tested driving the VS1053 board differently. I connected 5V of LC Technology VS1053 board to 3V of LoLin NodeMCU V3 and it worked fine. I'm not sure it's only related to LC Technology one. Maybe it will work fine also with other manufacturer's boards.
For more details please see this comment from the thread above: #1 (comment) .

When you have the final version of your circuit up and running it would be appreciated if you share some photos or any other detailed description.

@Aggebitter
Copy link

The VS1053b is a 3.3V logic chip but when driving the Geetech board at 3.3V the dropout voltage (1.1-1.3V) over the SDCard is to high (SD cards are very tricky on the voltage). I think that the logic output is at 3.3V when driving the board at 5V but I have not confirmed that. One benefit to drive the board direkt from 3.3V is that a single LiPo pack and charger can be used.

I'm experimenting with Ogg recording so this was just a basic test to assure the Mp3 card is working

@ghost

This comment has been minimized.

@baldram

This comment has been minimized.

@ghost

This comment has been minimized.

@ghost

This comment has been minimized.

@baldram

This comment has been minimized.

@Boredot

This comment has been minimized.

@baldram

This comment has been minimized.

@baldram baldram mentioned this issue Jul 15, 2018
@baldram
Copy link
Owner Author

baldram commented Jul 21, 2018

The library has been successfully tested with Lolin32 v1.0.0 (ESP-WROOM-32 based board).
Wiring and everything else similar to Espressif ESP32 DevKitC what has been described in details here.
Lolin32 has lithium battery interface what may be a nice feature for future projects.

20180721_201816

@LucasMaciuga
Copy link

The webradio example works nice with the "New ESP8266 Programmer Socket Adapter For ESPRESSIF". Pinout is the same as for "LoLin NodeMCU V3" - just use the correct I/O ports (I used this as a mapping reference: https://www.theengineeringprojects.com/wp-content/uploads/2018/10/Introduction-to-NodeMCU-V3.png).

20200117_215256

Nice project - nice work.

Lucas

@baldram
Copy link
Owner Author

baldram commented Jan 18, 2020

@LucasMaciuga Thank you for sharing your set-up. I'm happy to see it works well.
I have one question. While this is an adapter, you probably have the possibility to put there different ESP modules (from specification I see it supports: ESP-12S/12F/12E/07S/07). Which module do you use in your set up from the picture?

@LucasMaciuga
Copy link

@baldram for the setup in the picture I used an ESP-12F.

@LucasMaciuga
Copy link

I also attached the VS1053 to a 'blank' ESP-12F. Works great.
Take note that I used a LM1117T-33 to bring a 9V battery to 3,3 V - seems to be enough for the VS1053.

image

@baldram
Copy link
Owner Author

baldram commented Jan 19, 2020

@LucasMaciuga That's interesting. I wonder how long such battery can drive ESP with VS1053, e.g. for WebRadio? WiFi needs a lot of energy.

@baldram
Copy link
Owner Author

baldram commented Jan 31, 2020

@LucasMaciuga My question above could be overlooked. Did you have a chance to observe or measure how long such a battery can drive the ESP?

@ewbarnes53
Copy link

I am using your library and examples, using Adafruit Feathers and Wings. I have the Huzzah32 ESP32 Feather (PID = 3619) with the Music Maker Wing (PID 3357). I have both the WebRadio and MP3PlayerDemo working.

The problem I have is the audio quality on the WebRadio is very poor. It sounds very good most of the time, but then there is occasional popping, clicking, and chirping on the audio.

The problem is with all of the stations I have been listening to. For example:
// 1940 UK Radio const char *host = "149.255.59.162"; const char *path = "/1"; int httpPort = 8062;

If I use one of the Adafruit examples to play music files, they sound fine. Actually, they sound quite good. I can play MP3s, WMAs, and WAVs.

I wonder if you have any suggestions about what might be the cause of all of the noise on the audio. In the for what it is worth, everything in my system is running at 3V.

@philippedc
Copy link

@ewbarnes53 can test with HTTP1.0 instead of HTTP1.1 and share the result ?

@baldram
Copy link
Owner Author

baldram commented Apr 7, 2020

@ewbarnes53 can you test with HTTP1.0 instead of HTTP1.1 and share the result?

@philippedc @ewbarnes53 This is a good idea.
To keep the discussion consistent, I would suggest sharing the result directly in issue #52 (related to clicking).
Ok?

I am using your library and examples, using Adafruit Feathers and Wings. [...].
I have both the WebRadio and MP3PlayerDemo working.

Thank you @ewbarnes53 for using the library and sharing results.

The problem I have is the audio quality on the WebRadio is very poor. It sounds very good most of the time

Please note that the attached example is a very simple code. Kind of "hello world" for web radio simple program. So the problems are related to implementation. With such a simple implementation like one from WebRadioDemo it's hard to expect a lot.
If about a more complex example, it's the "Edzelf/Esp-radio" project itself. This is the one from which I extracted the VS1053 driver code. The Edzelf's code does a lot and deals with buffering and so on to handle different issues.

there is occasional popping, clicking, and chirping on the audio.
[...] I wonder if you have any suggestions about what might be the cause of all of the noise on the audio.

As @philippedc already mentioned, there is the other thread where this problem is discussed.
In fact, I see three threads I would suggest looking at for the glitches/popping/clicking issue:

Would you please share your thoughts directly on related issues?

If I use one of the Adafruit examples to play music files, they sound fine. Actually, they sound quite good. I can play MP3s, WMAs, and WAVs.

What do you mean Adafruit examples? Which ones? Are they also for WebRadio? Or they just play sound files like mp3 from the board memory or SD card?
Then I guess you should have similar results with MP3PlayerDemo, aren't they?

@ewbarnes53
Copy link

Thank you for the responses. I will look at the other threads. I am new to Github, so I am still trying to learn my way around.

@ewbarnes53 can test with HTTP1.0 instead of HTTP1.1 and share the result ?

I did modify my code to use HTTP1.0. I did not hear any change. I am not having problems with not being able to connect, or being disconnected. I have been connected to the station I mentioned all afternoon, and it is still playing.

I did run the MP3PlayerDemo. It works, but is such a short tone, that I couldn't tell much. I listened to the tone you recorded, and they sounded the same (to my very old ears).

Adafruit has also created a VS1053 library. They have a Fileplayer class, that plays files directly from the SD card. Their demo sketch also has some problems, but the problems relate to not handling interrupts correctly when the ESP32 is used, which seems to be an issue they know about.

I will try to find and figure out the chunked demo, and then let you know what I have found.

And again, I will say that I am new to GitHub, and am more of a Hacker than an experienced programmer. I want to thank you guys for releasing your libraries and the sample code. I have not had much luck with figuring out how to use libraries, unless sample code using the library is included.

@Givy
Copy link

Givy commented Jan 13, 2021

Hi,
This is an interesting project. So, I bought an Adafruit VS1053B (Codec + MicroSD Breakout - MP3/WAV/MIDI/OGG Play + Record - v4) and a Heltec_ESP32 WIFI LoRa 32(V2). I have not had much luck in getting it working yet. What could be the Pin connection differences compared to the ESP32 that you have shown?
Also, would it be possible to display the Radio Station Name/Number/Country on the OLED that comes on this ESP32? Should that be stored on an external EEPROM etc?
Thank you for your input.

@baldram
Copy link
Owner Author

baldram commented Jan 14, 2021

Hi @Givy thank you for using the library.
I had no possibility to test Heltec_ESP32 myself but if you get luck it would be great if you share your results (I've just added Discussions tab to the project). I don't expect any specific differences. Here is DevKitC and here is yours Heltec. Looking at the schema I see you have also all those mentioned GPIO18, GPIO19, GPIO23 and so on and so forth. Maybe different side, different order, but they are there. I would try the same wiring but using the correct places for pins on your board.

Also, would it be possible to display the Radio Station ... that comes on this ESP32?

I believe it would. 😏 But it's not in the scope of this audio driver library 😄
I don't know here is something and it looks like a library from manufacturer of your board.
The ESP_VS1053_Library is just a VS1053 driver and even has nothing to Web Radio. The "radio", "mp3 file play" or "beep sound" are just example use cases, that users might try to implement using this lib.

Should that be stored on an external EEPROM etc?

Not sure I understand your question. The display handling will be simply a part of your arduino project.
I extracted the audio driver from the parent project (from where this fork is made).
The parent project has a one file app where is everything. The audio, display handling, wifi, mqtt and more. All in one file.
Now, somewhere here starts the VS1053 library. That's it. So let's say, you see an example of the complete application using this library.

Good luck! Please do not forget to click "star".
Please also share your results when you get your board up and running. Maybe a photo of your setup.

@Givy
Copy link

Givy commented Jan 14, 2021 via email

@baldram
Copy link
Owner Author

baldram commented Jan 15, 2021

Ok, now I understand EPROM related question. So for "Station Name/Country/etc" I would use the network. The ESP board has easy WiFi access, so why not benefit from this? The cloud storage sounds so up to date, but you can use some local LAN server (local cloud? 😅). Your use case ("internet radio") is about connecting the network anyway, so everything would be network oriented. Sounds good to me.

Good luck.

@strider222
Copy link

strider222 commented Mar 5, 2021

Hard to tell what the board is exactly. I think it is a ESP32 30 pin dev board. Above you show a 36 pin board. On the back of the board is says ESP32s and omits the words dev board so I'm not sure I got what I ordered. The pinout is different as per below. Compiling gives this information
Chip is ESP32-D0WDQ6 (revision 1)
Features: WiFi, BT, Dual Core, 160MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
The VS1053 board looks identical to the one shown by Lucas on Jan 17, 2020.

I had some runtime code errors but once fixed it has been working for 24 hours.

Wiring:
|----vs1053 board-----------ESP32-30pin  ------
|   --------------
|   |5v   | 5v  |            VIN   VIN
|   |dgnd | miso|            GND   D19
|   |mosi | sck |    ==      D23   D18
|   |dreq | xrst|            D35   EN
|   |xcs  | xdcs|            D32   D33
|   --------------
|                Jack     
|                  X
|                  X         
|------------------X------------

I ordered Geekcreit® ESP32 WiFi+bluetooth Development Board which on banggood's website shows ESP32 DEVKITV1 and mine shows ESP32s on the back.

Main page for order
https://m.banggood.com/Geekcreit-ESP32-WiFi+bluetooth-Development-Board-Ultra-Low-Power-Consumption-Dual-Cores-Pins-Unsoldered-p-1214159.html?akmClientCountry=CA&utm_design=41&utm_source=emarsys&utm_medium=Neworder171109&utm_campaign=trigger-order&utm_content=winna&sc_src=email_2675773&sc_eh=b45feb052732c2c31&sc_llid=17049149&sc_lid=105229698&sc_uid=jcfXFTXc6i

More product details
https://m.banggood.com/Geekcreit-ESP32-WiFi+bluetooth-Development-Board-Ultra-Low-Power-Consumption-Dual-Cores-Pins-Unsoldered-p-1214159.html?akmClientCountry=CA&utm_design=41&utm_source=emarsys&utm_medium=Neworder171109&utm_campaign=trigger-order&utm_content=winna&sc_src=email_2675773&sc_eh=b45feb052732c2c31&sc_llid=17049149&sc_lid=105229698&sc_uid=jcfXFTXc6i

@strider222
Copy link

strider222 commented Mar 5, 2021

The above based on the code from the examples will not play any BBC station although the link I think that is generated plays in my browser. The client.connect() returns success but client.connected is false.
"BBC 6 Music", "bbcmedia.ic.llnwd.net", "/stream/bbcmedia_6music_mf_p", 80,
"BBC World Service", "bbcwssc.ic.llnwd.net", "/stream/bbcwssc_mp1_ws-eieuk", 80,

This station produces a return code of zero on connection but has been known to play occasionally.
"Comet radio", "comet.shoutca.st", "/1", 8563,

I think below means that the VS1053 plays AAC files.
"Scala Radio", "stream-mz.planetradio.co.uk", "/scalahigh.aac", 80,

Playing AAC also means that player.switchToMp3Mode() is actually switch to auto-decode mode as it plays AAC. Or perhaps it is switchOutOfMidiMode(); I'm wondering if the BBC stations are streaming an unrecognized file format (or I got a broken VS1053)

Sometimes turning off the speakers causes no sound when the speakers are turned back on requiring a reboot to correct. I think this is either a speaker or VS1053 problem.

I would love a link on how to identify the URLs to use from Linux when I connect to a local radio station on my browser.

@Dr-Dawg
Copy link

Dr-Dawg commented Mar 8, 2021

Hi, I just tested both BBC stations (with a modified code using ringbuffer), both work fine, no redirection or anything.
MPEG 1 Layer 3, Bitrate 128, Sample Frequency 44100

As a hint, in the header the icy- description says "BBC radio will stop working on this device soon", but this could be an issue of me defining an user agent.

Concerning the AAC format, as far as I remember, the blue LC Technology boards contain a VS1003 chip which, unlike the VS1053 on the green boards, does not play AAC streams (not sure anyway).

@Dr-Dawg
Copy link

Dr-Dawg commented Aug 13, 2021

dawg

Hi all, I just wanted to share my current progress with you..
Turned a 1 Euro clock into a web radio with LCARS design, Web Server, Gesture recognition (PAJ7620U2) and gyroscope (MPU6050).
All started with the WebRadioDemo and Arduino IDE, but if I knew in advance the time it would take me and the functionality I would add, I would have probably started with Edzelfs ESP32-Radio. The only thing I "borrowed" from his code for now is the showstreamtitle function..
Switched from ESP8266 NodeMCU v3 to NodeMCU ESP32 and ESP-32 Dev Kit C V4. I learned a lot, from reading MP3 frame sync to using both VSPI and HSPI on the ESP32 and putting a condensator between ground and enable for not having to push the boot button for each upload.
Thanks again to all of you for all the helpful contributions posted here!

@episource
Copy link

Building on PR #90 the lib is compatible with a Raspberry PI Pico (RP2040) as well. This has been tested using the arduino-pico core by earlephilhower via platformio and the VS1053B breakout board made by Adafruit.

grafik

@episource
Copy link

Here's the follow up link to the final setup where I'm using this lib (with PRs #98 and #99 merged): https://github.com/episource/picopdio

@baldram
Copy link
Owner Author

baldram commented May 26, 2022

@episource Fantastic project with lots of resources!

Awesome PR changes. It looks like they are both for quick merging.
So let's merge all 3 MRs quickly, and then I will have to solve a conflict in the MIDI related PR.

@jenschr
Copy link

jenschr commented May 4, 2023

Thanks for making this project! To use this library with Adafruit's VS1053B breakout, be sure to reset the breakout as in this example:
https://gist.github.com/jenschr/dacf60d2c9d2bd4efee85768cd5eab82

Tested with an ESP32-S3 & the Adafruit VS1053 Codec + MicroSD Breakout (https://www.adafruit.com/product/1381)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests