Skip to content

An esp32 app to play radio streams and music from a local lamp or llmp server through a i2s DAC. Compiles in the Arduino IDE.

License

Notifications You must be signed in to change notification settings

CelliesProjects/eStreamPlayer32

Repository files navigation

eStreamPlayer32

An web-based esp32 program to play webradio and mp3/aac files from a lamp or llmp server.

  • Control eStreamPlayer with your phone, pc or tablet.
  • Play your local files.
  • Play preset radio stations.
  • Add new urls and save them to favorites.

Sound output comes from an i2s dac.
Currently generic i2s dacs (with BCK, WS and DOUT pins), M5Stack Node and AI Thinker A1S AudioKit are supported.

When flashed to an M5Stack with the Node base you can see some information on the display.

m5screen

Limitations

  • The audioI2S library uses a lot of RAM. eStreamPlayer will only function properly on a board with PSRAM.

  • eStreamPlayer is written for playback over http. The esp32 does not speak NFS or SMB which are common ways to share files over a network.
    Instead eStreamPlayer uses a php script on the server to navigate the music folders.
    Copy this script to the server to use your music library.
    This is totally insecure and should only be used on a LAN!

But if you don't have a local music server you can still use eStreamPlayer to tune in to web radio stations and add your own radio stations to presets and favorites.

Web-interface screenshots

File info overlay

home

LIBRARY tab

library

WEBRADIO tab

webradio

FAVORITES tab

favorites

Setup

Use the latest ESP32 Arduino Core.

  1. Download the latest eStreamPlayer release.
  2. Install the required libraries and the drivers for your dac. See supported hardware.
  3. Copy the php script to your music folder on the server.
  4. Open the Arduino IDE.
  5. Select Tools->Partition Scheme->No OTA(2MB APP/2MB FATFS).
    If your board does not have that option you can select ESP32 Dev Module in Tools->Board.
  6. Open system_setup.h and set your wifi credentials and set SCRIPT_URL to the php script location.
  7. Flash the sketch to your esp32. Set Tools->Core Debug Level->Info before you flash so you can grab the ip address from the serial port.
  8. On first boot or after a flash erase the fatfs has to be formatted. This will take a couple of seconds.
    Flashing an update will not erase the fatfs data.
    Note: Take care to select the same partition table when updating otherwise the partition will be formatted.
    You can monitor the boot progress on the serial port.
  9. Browse to the ip address shown on the serial port.

Supported hardware

Select a board or dac by uncommenting the relevant line in system_setup.h.

  • Generic i2s dac - Select GENERIC_I2S_DAC as board.
    For dacs that only need BCK, WS and DOUT and no driver setup.
    Default pins are BCK = 21, WS = 26, DOUT = 22.
  • M5 Stack Node - Select M5STACK_NODE to compile for M5Stack Node with MCLK on GPIO0.
    You need the wm8978-esp32 library for this dac.
  • A1S Audio Kit - Select A1S_AUDIO_KIT to compile for ESP32-A1S Audio Kit.
    You need the AC101 library for this dac.

Software needed

  • ESP32-audioI2S (GNU General Public License v3.0)
  • AsyncTCP (LGPL-3.0 License)
  • ESPAsyncWebServer (LGPL-3.0 License)
  • A lamp or llmp webstack to serve local files.
    Apache2 and lighttpd were tested and should work. The php script should be fairly version agnostic.
    Note: Mp3 and aac files should have the Content-Type: audio/mpeg http headers set or the decoder will not recognise the files.

Libraries used in the web interface

MIT License

Copyright (c) 2020 Cellie

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.