Updated version, working Core2 web radio player, M5Stack
-
@homeuser33
Thanks for the updates. The new version gave me compiling error because the font not found. Then I added #include "Free_Fonts.h", now it's working.
I really like this web radio player, especially the stations you chose. I play this all day by my laptop.
Looking forward to seeing the new updates. -
@raychmond
Thank you, I've added the include now in the program, not sure why it worked for me without it.I'll make the changes in the program listing above. Thank you.
Yes, I like Charlie FM : https://worldradiomap.com/us-or/play/kych_live
If you click the 'Listen with your player' button it downloads a .PLS file that has links to their station. I have not found many good stations with this option. -
Just a suggestion... Instead of posting your code and updates here, can you please upload them to Github so change management and commits are easier to track? I apologize if you already have it on Github... maybe I missed it.
-
@world101
No, It's a good point. Generally I have not shared much code since I'm still fairly new to the M5Stack hardware. I was thinking this would be a one off since I found the answer for the media player. But its a good point. I'll check into that.
Thank you. -
Okay, that seemed easier than I thought.
Link: https://github.com/bwbguard/M5Stack-Core2-MediaPlayer -
👍🏻👍🏻👍🏻 Thanks!
-
Two things based on my testing.
- The program works with latest ESP8266Audio v1.8.1 library as well.
- I had to disable PSRAM in the Arduino board settings to get the program to work. When enabled, Arduino would flash the program and reset, but nothing would happen after that. Here is my board setup for Arduino on my Mac.
Thanks!
-
@world101
I'm not sure what to say about that, PSRAM is enabled on my Linux setup and so far seems to be working. -
I think it's the matter of the board selection. When I first tried homeuser33's code I used the M5Stack OEM board: M5Stack Arduino>M5Stack-Core2(The PSRAM is enabled). It kept rebooting itself. I then switched to ESP32 Arduino>M5Stack-Core2(The PSRAM is enabled as well), it then worked.
Today, I tried different combinations. It ended up with that the only scenario that it's not working if you use M5Stack Arduino>M5Stack-Core2 with PSRAM enabled. M5Stack Arduino>M5Stack-Core2 with PSRAM disabled works perfectly like world101 said. But if you use ESP32 Arduino>M5Stack-Core2, both enabled and disabled work. So I guess this is the matter of selecting different boards.Thanks!
-
@raychmond
Thanks for the update, It's been awhile sine I added the Core2 board manager so I don't remember which source I used. If I find it I'll update here. Thank you. -
@homeuser33 I tried downloading your code and running. It compiles and load on Core2 but then the touch does not work and cannot hear any Audio, it feels like the program has halted. It does try to play something as i can hear a sound but after that it stops.
-
@homeuser33 said in Updated version, working Core2 web radio player, M5Stack:
Hello, the code runs but it is stuck on the "Connecting" screen from the initwifi() function. I put the correct SSID and password it is still not working. Please try to help me out.
-
@bhupiister
I had a similar problem. You could try to remove the line 'Serial.begin(115200);' in setup(). It has already been called by M5Core2.cpp from the library. Calling it a second time makes a couple of my sketches hang. -
@clairlune
See my reply @bhupiister (after it has been approved). Hope it solves your problem. -
Attempting to compile the web radio player on a Core2. I am getting the following errors. Any help would be appreciated.
JoeArduino: 1.8.19 (Windows 10), Board: "M5Stack-Core2, Enabled, Default (2 x 6.5 MB app, 3.6 MB SPIFFS), 240MHz (WiFi/BT), 1500000, None"
C:\Users\jld\Documents\Arduino\MediaPlayer\MediaPlayer.ino:61:1: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
};
^
In file included from C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\AudioGeneratorMIDI.cpp:65:
C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h: In function 'void tsf_channel_midi_control(tsf*, int, int, int)':
C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h:2100:1: error: insn does not satisfy its constraints:
}
^
(insn 858 343 344 51 (set (reg:SF 19 f0 [407])
(mem/u/c:SF (symbol_ref/u:SI ("*.LC248") [flags 0x2]) [0 S4 A32])) "C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h":2053 47 {movsf_internal}
(nil))
during RTL pass: postreload
C:\Users\jld\Documents\Arduino\libraries\ESP8266Audio\src\libtinysoundfont/tsf.h:2100:1: internal compiler error: in extract_constrain_insn, at recog.c:2210
Please submit a full bug report,
with preprocessed source if appropriate.
See https://gcc.gnu.org/bugs/ for instructions.
exit status 1
Error compiling for board M5Stack-Core2.
-
@jdonth Had the exact same problem.........after 3 hours of googling, finally found the issue. Take a look at this diff file:
https://git.koehlerweb.org/frodovdr/Sonoff-Tasmota/commit/8a764f86ee9f1129507f4654d07c7a7cb24cc87e
It's totally unrelated to this project. Just a bug that freaks out the IDE. Anyhow......a couple of lines need to be changed in :
\libraries\ESP8266Audio\src\libtinysoundfont\tsf.h
Hopefully it makes sense......Hope it helps....
-
Before I get too involved uploading code or showing library versions I'm using, can anyone else on this thread verify whether their Core2 player still streams correctly?
I bought a new Core2 last week and was happy to find bwbguard's code. I removed some of the stations that don't exist anymore, but left in these three:
{"Orig. Top 40", "http://ais-edge09-live365-dal02.cdnstream.com/a25710"},
{"Classic FM", "http://media-ice.musicradio.com:80/ClassicFMMP3"},
{"Lite Favorites", "http://naxos.cdnstream.com:80/1255_128"}The Classic FM sounds decent, but the other two are greatly distorted and sound like they're playing at 1/4 or 1/2 rate or so. I have tried other MP3 url's, and those sound distorted too so it definitely seems the norm and not the exception.
VLC showed me the bit rates of the 3 above are 128 kb/s, 32 bits/sample, 44.1 kHz sample rate.
What's more, this Core2 web player seems to change stations on its own sometimes and occasionally restart.
This happens with latest ESP8266Audio 1.9.7 library, but I have tried previous as well. I'm using 0.1.4 M5Stack_Core2 library.
I read this thread and tried toggling the PSRAM enable, and tried the Core2 board from M5stack as well as ESP32, but the one from ESP32 would not compile.I've tried 160 and 240 MHz which makes no difference.
I even tried the code from this thread, the 'original' thread, and the code from bwbguard's github site.
Can anyone offer some suggestions?
Thanks!
-
@analog_man I know this is more than a year old, but maybe you'll see it (or someone else will). I just installed the player code on my core2 device. I grabbed the github version. I have M5Core2 version 0.1.8 installed and initially I had the exact same issues you're describing. The two stations that worked sounded like they were playing at half or quarter speed.
See here for discussion: https://github.com/m5stack/M5Core2/issues/110
The short of it:
replace "M5.begin();" in setup() with "M5.begin(true, true, true, true, kMBusModeOutput, false); ".......
Pretty much perfect playback. I use the following links:
const int stations = 9;// Change Number here if you add feeds!
char * stationList[stations][2] = {
{"Orig. Top 40", "http://ais-edge09-live365-dal02.cdnstream.com/a25710"},
{"Lite Favorites", "http://naxos.cdnstream.com:80/1255_128"},
{"ORF O3", "http://ors-sn02.ors-shoutcast.at/oe3-q2a"},
{"ORF Salzburg", "http://ors-sn07.ors-shoutcast.at/sbg-q2a"},
{"CBC Music #1", "http://26423.live.streamtheworld.com/CBLFM_CBC_SC"},
//{"CBC Music #2", "http://19003.live.streamtheworld.com/CBLFM_CBC_SC"},
//{"CBC Music #3", "http://18063.live.streamtheworld.com/CBLFM_CBC_SC"},
{"WETA Classical #1", "http://17643.live.streamtheworld.com/WETAFM_SC"},
//{"WETA Classical #2", "http://26103.live.streamtheworld.com/WETAFM_SC"},
//{"WETA Classical #3", "http://26153.live.streamtheworld.com/WETAFM_SC"},
//{"Classic FM", "http://media-ice.musicradio.com:80/ClassicFMMP3"},
{"Radio Classique", "http://radioclassique.ice.infomaniak.ch/radioclassique-high.mp3"},
{"Concertgebouw Live", "http://i1.cdn.jetstre.am:8000/sz=RCOLiveWebradio=mp3-192"}
};I'm right now listening to these and they all work like a charm. Even the 192Kb/s RCO Live (Concertgebouw Live) works. You can check the stream links in VLC to make sure.
Hope this helps.....
-
@nerdlogger Thank you so much for passing this along! I haven't done much with this in the last year, so forgot where I was at with it, but it will be nice to formally fix the problem as listed in that discussion.
As an aside, I did have to get a new Core2 from Mouser (after discussion with M5Stack, who paid for the replacement), because my display on first Core2 started 'fogging up' / going bad around the edges. I had left it on for a while, so not sure if that was related. Anyhow, it makes me wonder about the display quality on these. I had attempted to help M5Stack out as best I could by providing the serial # of bad unit, but I had finally tossed my box a few weeks before this happened. The serial # is not embedded in any of the M5Stack memory/firmware, so that's unfortunate for them. It's only on the box it arrives in.
Finally, I realize the fun of programming a Core2 or other development board with whatever a programmer wants to do with it (which is why we buy these!), but for somebody who wants a pure streaming internet radio player that pretty much embodies what a person could eventually turn a Core2 into, check out the Yoto Player or Yoto Mini player. It is designed for children, but uses RFID cards that are inserted on top. Point is that you can program radio station URLs onto a card and select whatever station you want. Custom icons on small display, great speaker(s), excellent WIFI connectivity, and great battery life. I own both of those (well, my children do!) and can attest to the great ability as a streaming radio player. This performance is much better than portable offerings from Sangean, Lemega, Ocean Digital, etc.
Thanks again!