Announcement

Collapse
No announcement yet.

ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • ANNOUNCE: Squeezelite-ESP32 (dedicated thread)

    I've decided to separate the SqueezeAMP (HW) and the SqueezeliteESP32 (SW) threads for better clarity. So, this is a sort of re-announce of the software only work that we are doing with @sle118 and contributions from @daduke.

    The Squeezelite-ESP32 shall not be confused with the squeezeesp32 project that was doing a native re-implementation of the slimproto on ESP8266/ESP32 devices, even with very small memory. This project is a port of Squeezelite to ESP32 devices that have at least 4MB of flash and 4MB of sram (e.g. WROVER modules, but not WROOM). The project technical part lives here https://github.com/sle118/squeezelite-esp32 and you'll find all the details how configure it.
    • full port of squeezelite (up to 192kHz samplerate, but 16 bits only)
    • pcm, wav, aif, alac, flac, mp3, ogg, ogf, ops, aac (mp4) codecs
    • resampling to and from any rate
    • 10-bands equalizer
    • synchronization with other squeezeboxes
    • output to I2S DAC. Special drivers exist for TAS5754/56/13/80 and AC101 but most I2S-connected DAC will work and it's possible to configure rudimentary I2C commands.
    • SPDIF output using one wire
    • Bluetooth source to send LMS audio to a BT speaker
    • Bluetooth sink (play from any BT-capable devices, iPhone, Android ...)
    • AirPlay sink with synchronization (play from any iOS/iTunes or compatible device)
    • Display support for monochrome SH1106 (128x64), SSD1306 (128x32), grayscale SSD1322 (256x32), SSD1326 (256x64), SSD1327 (128x128), color 65k ST7735 (128x160) and ST7789 (240x320) with deemable backlight
    • Buttons
    • Rotary encoder
    • InfraRed
    • Control LED (green & red - both deemable)
    • Web Interface for configuration and updates

    Display is very much like a Boom/SB3/Transporter with a few visual improvements as height is larger than classical SB. It supports VU-meter, spectrum analyzer, artwork. Note that display, Buttons, Rotary encoder, InfraRed, SPDIF, I2S DAC are all optional. I strongly recommend using Michael's plugin MusicInfoSCR to tweak display.

    There are pre-existing builds for SqueezeAMP, and MuseLuxe speaker devices and a generic I2S version. All option can be sets by a dedicated web interface, so you can use the I2S generic version as well on the SqueezeAMP and Muse, it's just more config work on you . Just look here https://github.com/sle118/squeezelite-esp32#readme

    Example of kit using Espressif's native WROVER can be found here https://a.aliexpress.com/_dY83WTf and also using the 3rd-party ESP32-A1S module can be found here https://a.aliexpress.com/_dZMwS57 but again, any device based on these module will work. The main difference is that the WROVER does not include a DAC, you must add one where the A1S does have a build-in DAC.

    Don't forget to add the LMS associated plugin here https://github.com/sle118/squeezelit...lugin/repo.xml. It's not mandatory for the SqueezeESP32 to work, but if you want display or equalizer, then you need it.

    If you don't use a SqueezeAMP where I pre-load the basic firmware then you should first flash your device with a version found here https://github.com/sle118/squeezelite-esp32/tags, download one of the .zip version and use the espressif download tool here https://www.espressif.com/en/support...ad/other-tools. You want to download:
    • ota_data_initial.bin at 0xd000
    • bootloader.bin at 0x1000
    • partition-table.bin at 0x8000
    • recovery.bin at 0x10000

    You can also use the python downloader directly with (on debian-based Linux, use "apt install esptool" to install espressif's tools)
    Code:
    python ${IDF_PATH}/components/esptool_py/esptool/esptool.py --chip esp32 --port ${ESPPORT} --baud ${ESPBAUD} --before default_reset --after hard_reset write_flash -z --flash_mode dio --flash_freq 80m --flash_size detect 0xd000 ota_data_initial.bin 0x1000 bootloader.bin 0x10000 recovery.bin 0x8000 partitions.bin
    Once this is done, the ESP32 will broadcast a WiFi Access Point that you can use from any WiFi-enable device. Default password is 'squeezelite' and from there, follow the webUI to configure your device. Then, once it is connected o your home WiFi, connect to it again using any web browser and load a full firmware. Again, look at the README on github. You should never have to use again this initial download procedure (unless you want to or have bricked your device), all updated can be done through the WebUI.
    Last edited by philippe_44; 2022-02-13, 06:53.
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

  • #2
    Updated information

    if you have an issue with updates (fails due to certificate), please use the following plain HTTP url to move to a newer version that will then allow you to continue normal updates

    Code:
    http://squeezeesp32.ngrok.io/squeezelite-esp32-master-cmake-ESP32-A1S-16-V0.634.bin
    http://squeezeesp32.ngrok.io/squeezelite-esp32-master-cmake-I2S-4MFlash-16-V0.634.bin
    http://squeezeesp32.ngrok.io/squeezelite-esp32-master-cmake-SqueezeAmp-16-V0.634.bin
    Michael kindly provided an additional update feature that is going to be very useful. Starting with plugin version 0.300, LMS can act as a HTTP proxy, instead of going to GitHub for downloading the firmware. We'll improve the UI, but as of this writing (04/03), you can use LMS by doing the following, in the player's UI, tab "updates"

    Once you have selected the FW you want the usual way, go into the URL box where it is displayed and replace the left part in red by the part in blue
    Code:
    [COLOR="#FF0000"]https://github.com/sle118/squeezelite-esp32/releases/download[/COLOR]/SqueezeAmp.16.634.master-cmake/squeezelite-esp32-master-cmake-SqueezeAmp-16-V0.634.bin
    [COLOR="#0000FF"]http://<yourlmsip>:9000/plugins/SqueezeESP32/firmware[/COLOR]/SqueezeAmp.16.634.master-cmake/squeezelite-esp32-master-cmake-SqueezeAmp-16-V0.634.bin
    You can also get the GitHub's asset ID and enter directly in the URL box
    Code:
    http://<yourlms>:9000/plugins/SqueezeESP32/firmware/34298863
    Last edited by philippe_44; 2021-04-04, 07:20.
    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

    Comment


    • #3
      Prioritise Bluetooth

      I was trying out the Squeezelite ESP32 on an A1s demo board running v0.5.640-v3.1.5-ESP32-A1S today and wanted to switch between LMS and Bluetooth there seems to be some issues with Bluetooth playback after switching between an active LMS connection and Bluetooth. I find that after doing so I can still create the connection but I will not have any audio output through the line-out jack unless I reset both board and restart player. In general I can not see how Squeezelite handles the priority of two simultaneous connections to one player such as trying to connect to an active player connected to LMS and connecting by Bluetooth. Handling this by prioritising one connection could be a way to force a clean exit and change over between sources. I would think that Bluetooth could be prioritised as the normal use would probably be LMS , so this would run in normal use, Bluetooth would be more likely for short term source, and when so it would be a priority. If you can see a better logic then that that would be OK by me, I am more interested in finding a way to cleanly switch between the sources with minimal user interaction

      Comment


      • #4
        Originally posted by justjason
        I find that after doing so I can still create the connection but I will not have any audio output through the line-out jack unless I reset both board and restart player.
        Could you please describe the steps to reproduce the issue, in a sequential manner?

        I suspect there might be an issue with the Bluetooth state machine, but need some more info.

        Thank you!
        LMS 7.9 - 1xRadio, 1xBoom, 5xDuet,3xTouch, 1 SB2. Sony PlayStation, Emby, Chromecast v1 and v2 and...
        6xSqueezeAmp, several other ESP32-Wrover boards with jumper wires flying around, some with ethernet!

        Comment


        • #5
          I have managed to narrow this down to an issue with the pause function handling between LMS and Squeezelite.
          to reproduce it is quite simple.
          1. Start LMS and Squeezelite.
          2. Start a Bluetooth stream to the the Squeezelite.
          3. Start a Radio stream from LMS. ( should automatically stop the Bluetooth stream - great )
          4. Try and restart Bluetooth stream ( will not work - great )
          5. Pause the LMS stream.
          6. Restart the Bluetooth stream ( will start, but audio from Bluetooth is muted)
          7. Stop LMS steam ( nothing changes -BT stream still runs , audio muted )
          8. Restart LMS stream ( BT is stoped )
          9 Stop LMS steam
          10. Restart BT stream (all good )

          It makes sense to me that when the LMS stream is started the BT steam is automatically stopped and blocked. However it can be confusing when the LMS stream has been paused and the Squeezelite is seemingly unused that the the BT stream can be successfully started but no audio comes through. I do not know if there is a conventional behaviour , but could it be an idea to handle the paused LMS stream in a similar way, ie, blocks the starting of the BT stream until the LMS stream is cleanly stopped.
          I only discovered this behaviour after finding the option to add the stop button next to the play button on LMS. Before that I was using the pause button thinking that this was the standard LMS way and was thinking the whole time that I had "stopped" the LMS stream and the BT stream was starting
          and running and thought so why was there no audio after switching between sources.
          Last edited by justjason; 2020-08-12, 12:19.

          Comment


          • #6
            Stand-alone Bluetooth streaming

            I am not sure if I have missed something ,but when I have an instance of LMS running ( but not streaming anything ) I can connect and steam to the Squeezelite via Bluetooth successfully. However If LMS is shut down, I am able to make a BT connection to the Squeezelite and start a stream, but there is no audio output. Is it possible to use the Squeezelite as a stand-alone BT device without LMS running in the background ?

            #### EDIT: ####

            I found what was causing this issue. Even after cleanly stopping the LMS stream it was necessary to remove the radio streams I had in the playlist. After clearing those out, It worked perfect. This raises the next issue, with cleanly switching between streams. Is it really necessary to have to stop and clear-out the playlist just to switch sources ?
            Last edited by justjason; 2020-08-12, 12:18.

            Comment


            • #7
              no s/pdif in 604

              Upgraded from fw: v0.5.604-IDFv3.1.5-I2S-4MFlash to v0.5.641 on my ESP-WROOM S/PDIF system via OTA, but there is no sound.
              Checked with my scope and there is no S/PDIF signal coming out. Went back to 604 and am back to normal.

              Did I miss a config change or something?
              Thx

              Comment


              • #8
                Originally posted by ElFishi
                Upgraded from fw: v0.5.604-IDFv3.1.5-I2S-4MFlash to v0.5.641 on my ESP-WROOM S/PDIF system via OTA, but there is no sound.
                Checked with my scope and there is no S/PDIF signal coming out. Went back to 604 and am back to normal.

                Did I miss a config change or something?
                Thx
                There is no default GPIO config anymore for SPDIF or DAC in I2S version, it was causing too many issues, so you have to set them up in spdif_config (using the webUI). I forgot to mention it, sorry
                LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

                Comment


                • #9
                  my spdif_config was already 'bck=33,ws=25,do=32'
                  Do I need to change this?

                  rest of config:
                  Code:
                  {"timestamp":1597299341149,"a2dp_ctmt":{"value":"1000","type":33},"a2dp_ctrld":{"value":"500","type":33},"a2dp_dev_name":{"value":"Squeezelite","type":33},"a2dp_sink_name":{"value":"SMSL BT4.2","type":33},"actrls_config":{"value":"","type":33},"airplay_name":{"value":"ESP32-AirPlay-Vector","type":33},"airplay_port":{"value":"5000","type":33},"ap_channel":{"value":"1","type":33},"ap_ip_address":{"value":"192.168.4.1","type":33},"ap_ip_gateway":{"value":"192.168.4.1","type":33},"ap_ip_netmask":{"value":"255.255.255.0","type":33},"ap_pwd":{"value":"squeezelite","type":33},"ap_ssid":{"value":"squeezelite-Vector","type":33},"autoexec":{"value":"1","type":33},"autoexec1":{"value":"squeezelite -b 500:2000 -d all=info -n \"Vector\" -o SPDIF -R -Z 192000","type":33},"bat_config":{"value":"","type":33},"bt_name":{"value":"ESP32-BT-Vector","type":33},"bt_sink_pin":{"value":"1234","type":33},"bypass_wm":{"value":"0","type":33},"dac_config":{"value":"","type":33},"dac_controlset":{"value":"","type":33},"display_config":{"value":"I2C,width=128,height=64,address=60,driver=SH1106,VFLIP,HFLIP","type":33},"enable_airplay":{"value":"1","type":33},"enable_bt_sink":{"value":"1","type":33},"host_name":{"value":"Vector","type":33},"i2c_config":{"value":"sda=22,scl=23","type":33},"jack_mutes_amp":{"value":"n","type":33},"led_brightness":{"value":"","type":33},"lms_ctrls_raw":{"value":"n","type":33},"metadata_config":{"value":"","type":33},"ota_erase_blk":{"value":"249856","type":33},"ota_prio":{"value":"6","type":33},"ota_stack":{"value":"10240","type":33},"release_url":{"value":"https://github.com/sle118/squeezelite-esp32/releases","type":33},"rotary_config":{"value":"","type":33},"set_GPIO":{"value":"12=green:1,13=amp","type":33},"spdif_config":{"value":"bck=33,ws=25,do=32","type":33},"spi_config":{"value":"","type":33},"stats":{"value":"n","type":33},"telnet_block":{"value":"500","type":33},"telnet_buffer":{"value":"40000","type":33},"telnet_enable":{"value":"Y","type":33}}

                  Comment


                  • #10
                    Originally posted by ElFishi
                    my spdif_config was already 'bck=33,ws=25,do=32'
                    Do I need to change this?

                    rest of config:
                    Code:
                    {"timestamp":1597299341149,"a2dp_ctmt":{"value":"1000","type":33},"a2dp_ctrld":{"value":"500","type":33},"a2dp_dev_name":{"value":"Squeezelite","type":33},"a2dp_sink_name":{"value":"SMSL BT4.2","type":33},"actrls_config":{"value":"","type":33},"airplay_name":{"value":"ESP32-AirPlay-Vector","type":33},"airplay_port":{"value":"5000","type":33},"ap_channel":{"value":"1","type":33},"ap_ip_address":{"value":"192.168.4.1","type":33},"ap_ip_gateway":{"value":"192.168.4.1","type":33},"ap_ip_netmask":{"value":"255.255.255.0","type":33},"ap_pwd":{"value":"squeezelite","type":33},"ap_ssid":{"value":"squeezelite-Vector","type":33},"autoexec":{"value":"1","type":33},"autoexec1":{"value":"squeezelite -b 500:2000 -d all=info -n \"Vector\" -o SPDIF -R -Z 192000","type":33},"bat_config":{"value":"","type":33},"bt_name":{"value":"ESP32-BT-Vector","type":33},"bt_sink_pin":{"value":"1234","type":33},"bypass_wm":{"value":"0","type":33},"dac_config":{"value":"","type":33},"dac_controlset":{"value":"","type":33},"display_config":{"value":"I2C,width=128,height=64,address=60,driver=SH1106,VFLIP,HFLIP","type":33},"enable_airplay":{"value":"1","type":33},"enable_bt_sink":{"value":"1","type":33},"host_name":{"value":"Vector","type":33},"i2c_config":{"value":"sda=22,scl=23","type":33},"jack_mutes_amp":{"value":"n","type":33},"led_brightness":{"value":"","type":33},"lms_ctrls_raw":{"value":"n","type":33},"metadata_config":{"value":"","type":33},"ota_erase_blk":{"value":"249856","type":33},"ota_prio":{"value":"6","type":33},"ota_stack":{"value":"10240","type":33},"release_url":{"value":"https://github.com/sle118/squeezelite-esp32/releases","type":33},"rotary_config":{"value":"","type":33},"set_GPIO":{"value":"12=green:1,13=amp","type":33},"spdif_config":{"value":"bck=33,ws=25,do=32","type":33},"spi_config":{"value":"","type":33},"stats":{"value":"n","type":33},"telnet_block":{"value":"500","type":33},"telnet_buffer":{"value":"40000","type":33},"telnet_enable":{"value":"Y","type":33}}
                    I might have screwed something then (I did a fair bit of changes in that part). I'll try tomorrow. What do the log say wrt SPDIF when booting?
                    LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

                    Comment


                    • #11
                      Originally posted by ElFishi
                      Upgraded from fw: v0.5.604-IDFv3.1.5-I2S-4MFlash to v0.5.641 on my ESP-WROOM S/PDIF system via OTA, but there is no sound.
                      Checked with my scope and there is no S/PDIF signal coming out. Went back to 604 and am back to normal.

                      Did I miss a config change or something?
                      Thx
                      I thought the ESP-WROOM chip couldn't be used?

                      Comment


                      • #12
                        my bad, its a WROVER.

                        Comment


                        • #13
                          Originally posted by philippe_44
                          I might have screwed something then (I did a fair bit of changes in that part). I'll try tomorrow. What do the log say wrt SPDIF when booting?
                          something like this?

                          Code:
                          [00:03:35.215439] output_init_embedded:70 init device: SPDIF
                          [00:03:35.226814] output_init_common:427 supported rates: 48000 44100 
                          [00:03:35.227781] output_init_embedded:86 init I2S/SPDIF
                          I (5617) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=24
                          I (5627) I2S: APLL: Req RATE: 88200, real rate: 88199.977, BITS: 32, CLKM: 1, BCK_M: 8, MCLK: 45158388.000, SCLK: 5644798.500000, diva: 1, divb: 0
                          [00:03:35.253162] output_init_i2s:236 SPDIF using I2S bck:33, ws:25, do:32
                          [00:03:35.264422] output_init_i2s:290 Initializing I2S mode S/PDIF with rate: 88200, bits per sample: 32, buffer frames: 256, number of buffers: 24 
                          [00:03:35.276850] set_amp_gpio:144 setting amplifier GPIO 13 (active:1)
                          [00:03:35.277995] output_thread_i2s:432 Output state is 0
                          [00:03:35.289590] output_thread_i2s:495 Restarting I2S.
                          [00:03:35.290717] output_thread_i2s:504 changing sampling rate 88200 to 44100
                          I (5687) I2S: APLL: Req RATE: 88200, real rate: 88199.977, BITS: 32, CLKM: 1, BCK_M: 8, MCLK: 45158388.000, SCLK: 5644798[00:03:35.290717] output_visu_init:75 Initialize VISUEXPORT 2048 16 bits samples
                          .500000, diva: 1, divb: 0
                          [00:03:35.316063] equalizer_open:51 equalizer initialized 0
                          [00:03:35.335243] output_init_embedded:94 init completed.
                          [00:03:35.336604] decode_init:153 init decode

                          Comment


                          • #14
                            Originally posted by ElFishi
                            something like this?

                            Code:
                            [00:03:35.215439] output_init_embedded:70 init device: SPDIF
                            [00:03:35.226814] output_init_common:427 supported rates: 48000 44100 
                            [00:03:35.227781] output_init_embedded:86 init I2S/SPDIF
                            I (5617) I2S: DMA Malloc info, datalen=blocksize=2048, dma_buf_count=24
                            I (5627) I2S: APLL: Req RATE: 88200, real rate: 88199.977, BITS: 32, CLKM: 1, BCK_M: 8, MCLK: 45158388.000, SCLK: 5644798.500000, diva: 1, divb: 0
                            [00:03:35.253162] output_init_i2s:236 SPDIF using I2S bck:33, ws:25, do:32
                            [00:03:35.264422] output_init_i2s:290 Initializing I2S mode S/PDIF with rate: 88200, bits per sample: 32, buffer frames: 256, number of buffers: 24 
                            [00:03:35.276850] set_amp_gpio:144 setting amplifier GPIO 13 (active:1)
                            [00:03:35.277995] output_thread_i2s:432 Output state is 0
                            [00:03:35.289590] output_thread_i2s:495 Restarting I2S.
                            [00:03:35.290717] output_thread_i2s:504 changing sampling rate 88200 to 44100
                            I (5687) I2S: APLL: Req RATE: 88200, real rate: 88199.977, BITS: 32, CLKM: 1, BCK_M: 8, MCLK: 45158388.000, SCLK: 5644798[00:03:35.290717] output_visu_init:75 Initialize VISUEXPORT 2048 16 bits samples
                            .500000, diva: 1, divb: 0
                            [00:03:35.316063] equalizer_open:51 equalizer initialized 0
                            [00:03:35.335243] output_init_embedded:94 init completed.
                            [00:03:35.336604] decode_init:153 init decode
                            Yes - It all seems good. I've also tried on a SqueezeAMP release and an I2S release configured with SPDIF parameters and they both for me. Are you sure there is not something else? Does the led emit something? Could it be somewhere else (the amp gpio for example?)
                            LMS 8.2 on Odroid-C4 - SqueezeAMP!, 5xRadio, 5xBoom, 2xDuet, 1xTouch, 1xSB3. Sonos PLAY:3, PLAY:5, Marantz NR1603, Foobar2000, ShairPortW, 2xChromecast Audio, Chromecast v1 and v2, Squeezelite on Pi, Yamaha WX-010, AppleTV 4, Airport Express, GGMM E5, RivaArena 1 & 3

                            Comment


                            • #15
                              Originally posted by ElFishi
                              my bad, its a WROVER.
                              Rats! Thought there was a change that I missed.

                              I tried to OTA 5.642, but got the dreaded HTTP error, so had to flash wired. I too got no spdif out as well. Pretty sure I filled in spdif_config and still nothing.
                              I left set_GPIO blank, as I'm only using pin 32 (do).

                              I was able to OTA back to 5.541, and got the signal back.

                              Mike

                              Comment

                              Working...
                              X
                              😀
                              🥰
                              🤢
                              😎
                              😡
                              👍
                              👎