浏览代码

Merge branch 'master-v4.3' of https://github.com/sle118/squeezelite-esp32 into master-v4.3

philippe44 1 年之前
父节点
当前提交
bc6e25c85c
共有 5 个文件被更改,包括 87 次插入36 次删除
  1. 0 5
      .github/workflows/Platform_build.yml
  2. 23 1
      CMakeLists.txt
  3. 57 17
      Dockerfile
  4. 6 6
      README.md
  5. 1 7
      components/wifi-manager/webapp/.babelrc

+ 0 - 5
.github/workflows/Platform_build.yml

@@ -137,11 +137,6 @@ jobs:
       if: ${{ needs.bootstrap.outputs.mock == 0 }} 
       run: |
         . ${IDF_PYTHON_ENV_PATH}/bin/activate
-        chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/protoc
-        chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/protoc-gen-nanopb
-        chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/*.py
-        chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/*.py2
-        chmod +x ./components/spotify/cspot/bell/external/nanopb/generator/proto/*.py      
         echo "Copying target sdkconfig"
         cp build-scripts/${TARGET_BUILD_NAME}-sdkconfig.defaults sdkconfig
         echo "Building project"

+ 23 - 1
CMakeLists.txt

@@ -70,6 +70,7 @@ set_target_properties(recovery.elf PROPERTIES LINK_LIBRARIES "${BCA};idf::app_re
 # create files with size for recovery 
 # build_size(recovery)
 
+
 # build squeezelite, add app_squeezelite to the link
 add_executable(squeezelite.elf "CMakeLists.txt")
 add_dependencies(squeezelite.elf recovery.elf)
@@ -105,7 +106,28 @@ add_custom_target(_jtag_scripts  ALL
 					POST_BUILD
 					COMMAND ${CMAKE_COMMAND} -P "${CMAKE_CURRENT_SOURCE_DIR}/generate_debug_scripts.cmake"
 )
- 
+
+if(CMAKE_HOST_UNIX)
+  # Add custom target to set executable permissions before build for cspot component
+    add_custom_target(set_cspot_permissions
+        COMMAND ${CMAKE_COMMAND} -E echo "************************************************************************************************"
+        COMMAND ${CMAKE_COMMAND} -E echo "**** Setting permissions for required files"
+        COMMAND ${CMAKE_COMMAND} -E echo "**** ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/protoc-gen-nanopb"
+        COMMAND ${CMAKE_COMMAND} -E echo "**** ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/*.py"
+        COMMAND ${CMAKE_COMMAND} -E echo "**** ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/*.py2"
+        COMMAND ${CMAKE_COMMAND} -E echo "**** ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/proto/*.py"
+        COMMAND ${CMAKE_COMMAND} -E echo "**** ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/protoc"
+        COMMAND chmod +x ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/protoc-gen-nanopb
+        COMMAND chmod +x ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/*.py
+        COMMAND chmod +x ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/*.py2
+        COMMAND chmod +x ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/proto/*.py
+        COMMAND chmod +x ${CMAKE_SOURCE_DIR}/components/spotify/cspot/bell/external/nanopb/generator/protoc
+        COMMAND ${CMAKE_COMMAND} -E echo "************************************************************************************************"    
+    )
+
+  # Add a dependency to ensure permissions are set before building cspot component
+  add_dependencies(__idf_spotify set_cspot_permissions)
+endif()
 
 # ======================= DEBUG FLAGS ============================
 

+ 57 - 17
Dockerfile

@@ -2,29 +2,34 @@ FROM ubuntu:20.04
 
 
 ARG DEBIAN_FRONTEND=noninteractive
-ENV GCC_TOOLS_BASE=/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-
+ENV GCC_TOOLS_BASE=/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-
 # To build the image for a branch or a tag of IDF, pass --build-arg IDF_CLONE_BRANCH_OR_TAG=name.
 # To build the image with a specific commit ID of IDF, pass --build-arg IDF_CHECKOUT_REF=commit-id.
 # It is possibe to combine both, e.g.:
 #   IDF_CLONE_BRANCH_OR_TAG=release/vX.Y
 #   IDF_CHECKOUT_REF=<some commit on release/vX.Y branch>.
-# The following commit contains the ldgen fix: eab738c79e063b3d6f4c345ea5e1d4f8caef725b
-# to build an image using that commit: docker build . --build-arg IDF_CHECKOUT_REF=eab738c79e063b3d6f4c345ea5e1d4f8caef725b -t sle118/squeezelite-esp32-idfv43
-# Docker build for release 4.3.2 as of 2022/02/28
-# docker build . --build-arg IDF_CHECKOUT_REF=8bf14a9238329954c7c5062eeeda569529aedf75 -t sle118/squeezelite-esp32-idfv43
-# To run the image interactive (windows): 
-# docker run --rm -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv43
-# To run the image interactive (linux):
-# docker run --rm -v `pwd`:/project -w /project -it sle118/squeezelite-esp32-idfv43
+# Docker build for release 4.3.5 as of 2023/05/18
+# docker build . --build-arg IDF_CHECKOUT_REF=6d04316cbe4dc35ea7e4885e9821bd9958ac996d -t sle118/squeezelite-esp32-idfv435 
+# Updating the docker image in the repository
+# docker push sle118/squeezelite-esp32-idfv435
+# or to do both:
+# docker build . --build-arg IDF_CHECKOUT_REF=6d04316cbe4dc35ea7e4885e9821bd9958ac996d -t sle118/squeezelite-esp32-idfv435 && docker push sle118/squeezelite-esp32-idfv435
+#
+# (windows) To run the image interactive : 
+# docker run --rm -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv435
+# (windows powershell)
+# docker run --rm -v ${PWD}:/project -w /project -it sle118/squeezelite-esp32-idfv435
+# (linux) To run the image interactive :
+# docker run --rm -v `pwd`:/project -w /project -it sle118/squeezelite-esp32-idfv435
 # to build the web app inside of the interactive session
 # pushd components/wifi-manager/webapp/ && npm install && npm run-script build && popd
 #
 # to run the docker with netwotrk port published on the host:
-# docker run --rm -p 5000:5000/tcp -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv43
+# docker run --rm -p 5000:5000/tcp -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv435
 
 ARG IDF_CLONE_URL=https://github.com/espressif/esp-idf.git
 ARG IDF_CLONE_BRANCH_OR_TAG=master
-ARG IDF_CHECKOUT_REF=8bf14a9238329954c7c5062eeeda569529aedf75
+ARG IDF_CHECKOUT_REF=6d04316cbe4dc35ea7e4885e9821bd9958ac996d
 
 ENV IDF_PATH=/opt/esp/idf
 ENV IDF_TOOLS_PATH=/opt/esp
@@ -35,6 +40,7 @@ RUN : \
   && apt-get update \
   && apt-get install -y \
     apt-utils \
+    build-essential \
     bison \
     ca-certificates \
     ccache \
@@ -42,22 +48,26 @@ RUN : \
     curl \
     flex \
     git \
+    git-lfs \    
     gperf \
     lcov \
+    libbsd-dev \    
+    libpython3.8 \
     libffi-dev \
     libncurses-dev \
-    libpython2.7 \
     libusb-1.0-0-dev \
     make \
     ninja-build \
-    python3 \
+    python3.8 \
     python3-pip \
+    python3-venv \
+    ruby \
     unzip \
     wget \
     xz-utils \
     zip \
-    	npm \
-	nodejs \
+   	npm \
+  	nodejs \
   && apt-get autoremove -y \
   && rm -rf /var/lib/apt/lists/* \
   && update-alternatives --install /usr/bin/python python /usr/bin/python3 10 \
@@ -97,8 +107,8 @@ RUN : \
 COPY docker/patches $IDF_PATH
 
 #set idf environment variabies
-ENV PATH /opt/esp/idf/components/esptool_py/esptool:/opt/esp/idf/components/espcoredump:/opt/esp/idf/components/partition_table:/opt/esp/idf/components/app_update:/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin:/opt/esp/tools/xtensa-esp32s2-elf/esp-2021r2-8.4.0/xtensa-esp32s2-elf/bin:/opt/esp/tools/xtensa-esp32s3-elf/esp-2021r2-8.4.0/xtensa-esp32s3-elf/bin:/opt/esp/tools/riscv32-esp-elf/esp-2021r2-8.4.0/riscv32-esp-elf/bin:/opt/esp/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/opt/esp/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/opt/esp/tools/cmake/3.16.4/bin:/opt/esp/tools/openocd-esp32/v0.10.0-esp32-20211111/openocd-esp32/bin:/opt/esp/python_env/idf4.3_py3.8_env/bin:/opt/esp/idf/tools:$PATH
-ENV GCC_TOOLS_BASE="/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-"
+ENV PATH /opt/esp/idf/components/esptool_py/esptool:/opt/esp/idf/components/espcoredump:/opt/esp/idf/components/partition_table:/opt/esp/idf/components/app_update:/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin:/opt/esp/tools/xtensa-esp32s2-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s2-elf/bin:/opt/esp/tools/xtensa-esp32s3-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32s3-elf/bin:/opt/esp/tools/riscv32-esp-elf/esp-2021r2-patch3-8.4.0/riscv32-esp-elf/bin:/opt/esp/tools/esp32ulp-elf/2.28.51-esp-20191205/esp32ulp-elf-binutils/bin:/opt/esp/tools/esp32s2ulp-elf/2.28.51-esp-20191205/esp32s2ulp-elf-binutils/bin:/opt/esp/tools/cmake/3.16.4/bin:/opt/esp/tools/openocd-esp32/v0.11.0-esp32-20220706/openocd-esp32/bin:/opt/esp/python_env/idf4.3_py3.8_env/bin:/opt/esp/idf/tools:$PATH
+ENV GCC_TOOLS_BASE="/opt/esp/tools/xtensa-esp32-elf/esp-2021r2-patch3-8.4.0/xtensa-esp32-elf/bin/xtensa-esp32-elf-"
 ENV IDF_PATH="/opt/esp/idf"
 ENV IDF_PYTHON_ENV_PATH="/opt/esp/python_env/idf4.3_py3.8_env"
 ENV IDF_TOOLS_EXPORT_CMD="/opt/esp/idf/export.sh"
@@ -109,7 +119,32 @@ ENV NODE_VERSION="8"
 ENV OPENOCD_SCRIPTS="/opt/esp/tools/openocd-esp32/v0.10.0-esp32-20211111/openocd-esp32/share/openocd/scripts"
 # Ccache is installed, enable it by default
 
+# The constraint file has been downloaded and the right Python package versions installed. No need to check and
+# download this at every invocation of the container.
+ENV IDF_PYTHON_CHECK_CONSTRAINTS=no
+
+# Ccache is installed, enable it by default
 ENV IDF_CCACHE_ENABLE=1
+
+# Install QEMU runtime dependencies
+RUN : \
+  && apt-get update && apt-get install -y -q \
+    libglib2.0-0 \
+    libpixman-1-0 \
+  && rm -rf /var/lib/apt/lists/* \
+  && :
+
+# Install QEMU
+ARG QEMU_VER=esp-develop-20220919
+ARG QEMU_DIST=qemu-${QEMU_VER}.tar.bz2
+ARG QEMU_SHA256=f6565d3f0d1e463a63a7f81aec94cce62df662bd42fc7606de4b4418ed55f870
+RUN : \
+  && wget --no-verbose https://github.com/espressif/qemu/releases/download/${QEMU_VER}/${QEMU_DIST} \
+  && echo "${QEMU_SHA256} *${QEMU_DIST}" | sha256sum --check --strict - \
+  && tar -xf ${QEMU_DIST} -C /opt \
+  && rm ${QEMU_DIST} \
+  && :
+
 COPY docker/entrypoint.sh /opt/esp/entrypoint.sh
 COPY components/wifi-manager/webapp/package.json /opt
 
@@ -142,6 +177,9 @@ RUN : \
   && node --version \
   && npm install -g \  
   && :      
+RUN : \
+  && npm install -g html-webpack-plugin 
+
 
 ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
 ENV PATH $IDF_PYTHON_ENV_PATH:$NVM_DIR/v$NODE_VERSION/bin:$PATH
@@ -152,5 +190,7 @@ RUN : \
   && chmod +x /usr/sbin/build_tools.py \  
   && :
 
+
+
 ENTRYPOINT [ "/opt/esp/entrypoint.sh" ]
 CMD [ "/bin/bash" ]

+ 6 - 6
README.md

@@ -89,7 +89,7 @@ NB: You can use the pre-build binaries Muse4MBFlash which has all the hardware I
 - define a "buttons" variable with: `[{"gpio":32, "pull":true, "debounce":10, "normal":{"pressed":"ACTRLS_VOLDOWN"}}, {"gpio":19, "pull":true, "debounce":40, "normal":{"pressed":"ACTRLS_VOLUP"}}, {"gpio":12, "pull":true, "debounce":40, "long_press":1000, "normal":{"pressed":"ACTRLS_TOGGLE"},"longpress":{"pressed":"ACTRLS_POWER"}}]`
 
 ### ESP32-A1S
-Works with [ESP32-A1S](https://docs.ai-thinker.com/esp32-a1s) module that includes audio codec and headset output. You still need to use a demo board like [this](https://www.aliexpress.com/item/4001060963585.html) or an external amplifier if you want direct speaker connection. Note that there is a version with AC101 codec and another one with ES8388 with probably two variants - these boards are a mess (see below)
+Works with [ESP32-A1S](https://docs.ai-thinker.com/esp32-a1s) module that includes audio codec and headset output. You still need to use a demo board like [this](https://aliexpress.com/item/4000130915903.html) or an external amplifier if you want direct speaker connection. Note that there is a version with AC101 codec and another one with ES8388 with probably two variants - these boards are a mess (see below)
 
 The board shown above has the following IO set
 - amplifier: GPIO21
@@ -305,7 +305,7 @@ See [set_GPIO](#set-gpio) for how to set the green and red LEDs. In addition, th
 ```
 [green=0..100][,red=0..100]
 ```
-NB: For well-known configuration, this is ignored
+NB: For well-known configuration, GPIO affected to green and red LED cannot be changed but brightness option applies
 
 ### Rotary Encoder
 One rotary encoder is supported, quadrature shift with press. Such encoders usually have 2 pins for encoders (A and B), and common C that must be set to ground and an optional SW pin for press. A, B and SW must be pulled up, so automatic pull-up is provided by ESP32, but you can add your own resistors. A bit of filtering on A and B (~470nF) helps for debouncing which is not made by software. 
@@ -543,21 +543,21 @@ See squeezlite command line, but keys options are
 A simple alternative to building the project's binaries is to leverage the same docker image that is being used on the GitHub Actions to build our releases. The instructions below assume that you have cloned  the squeezelite-esp32 code that you want to build locally and that you have opened a command line/bash session in the folder that contains the code. 
 Pull the most recent docker image for the environment: 
 ```
-docker pull sle118/squeezelite-esp32-idfv43
+docker pull sle118/squeezelite-esp32-idfv435
 ```
 Then run the container interactively :
 ```
 for windows:
-docker run -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv43
+docker run -v %cd%:/project -w /project -it sle118/squeezelite-esp32-idfv435
 for linux:
-docker run -it -v `pwd`:/workspace/squeezelite-esp32 sle118/squeezelite-esp32-idfv43
+docker run -it -v `pwd`:/workspace/squeezelite-esp32 sle118/squeezelite-esp32-idfv435
 ```
 The above command will mount this repo into the docker container and start a bash terminal. From there, simply run idf.py build to build, etc. Note that at the time of writing these lines, flashing is not possible for docker running under windows https://github.com/docker/for-win/issues/1018.
 
 ### Manual Install of ESP-IDF
 You can install IDF manually on Linux or Windows (using the Subsystem for Linux) following the instructions at: https://www.instructables.com/id/ESP32-Development-on-Windows-Subsystem-for-Linux/ or see here https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html for a direct install. 
 
-**Use the esp-idf 4.0 https://github.com/espressif/esp-idf/tree/release/v4.0 and a recent add esp-dsp (after 08/2020)**
+**Use the esp-idf 4.3.5 https://github.com/espressif/esp-idf/tree/release/v4.3.5 **
 
 ## Building Squeezelite-esp32
 When initially cloning the repo, make sure you do it recursively. For example: `git clone --recursive https://github.com/sle118/squeezelite-esp32.git`

+ 1 - 7
components/wifi-manager/webapp/.babelrc

@@ -9,11 +9,5 @@
         "minify"
       ]
     }
-  },
-  "plugins": [
-    "@babel/plugin-proposal-nullish-coalescing-operator",
-    "@babel/plugin-proposal-optional-chaining",
-    ["@babel/plugin-transform-runtime"],
-
-  ],
+  }
 }