|
5 سال پیش | |
---|---|---|
.settings | 5 سال پیش | |
build-scripts | 5 سال پیش | |
components | 5 سال پیش | |
idf-patch | 5 سال پیش | |
main | 5 سال پیش | |
plugin | 5 سال پیش | |
server_certs | 5 سال پیش | |
.cproject | 5 سال پیش | |
.gitattributes | 5 سال پیش | |
.gitignore | 5 سال پیش | |
.gitmodules | 5 سال پیش | |
.project | 5 سال پیش | |
CMakeLists.txt | 5 سال پیش | |
Dockerfile | 5 سال پیش | |
Makefile | 5 سال پیش | |
Makefile_std.mk | 5 سال پیش | |
README.md | 5 سال پیش | |
TODO | 5 سال پیش | |
alltags.txt | 5 سال پیش | |
github.pem | 5 سال پیش | |
makeBuildDocs.sh | 5 سال پیش | |
non-ota-partitions.csv | 5 سال پیش | |
partitions.csv | 5 سال پیش | |
repo.xml | 5 سال پیش |
Works with the SqueezeAMP see here and here. Add repository https://raw.githubusercontent.com/sle118/squeezelite-esp32/master/plugin/repo.xml to LMS if you want to have a display
Use the squeezelite-esp32-SqueezeAmp-sdkconfig.defaults
configuration file.
Squeezelite-esp32 requires esp32 chipset and 4MB PSRAM. ESP32-WROVER meets these requirements.
To get an audio output an I2S DAC can be used. Cheap PCM5102 I2S DACs work others may also work. PCM5012 DACs can be hooked up via:
I2S - WROVER
VCC - 3.3V
3.3V - 3.3V
GND - GND
FLT - GND
DMP - GND
SCL - GND
BCK - 26
DIN - 22
LCK - 25
FMT - GND
XMT - 3.3V
Use the squeezelite-esp32-I2S-4MFlash-sdkconfig.defaults
configuration file.
To access NVS, in the webUI, go to credits and select "shows nvs editor". Go into the NVS editor tab to change NFS parameters. In syntax description below <> means a value while [] describe optional parameters.
The NVS parameter "i2c_config" set the I2C's gpio needed to enable. Leave it blank to disable I2C usage. Note that on SqueezeAMP, port must be 1. Syntax is
sda=<gpio_num>,scl=<gpio_num>,port=0|1
The NVS parameter "display_config" sets the parameters for an optional display. Syntax is
I2C|SPI,width=<pixels>,height=<pixels>[,address=<i2c_address>][,HFlip][,VFlip]
The parameter "Vcc_GPIO" is a comma-separated list of GPIO that will be configured as output with their value set to 1 (Vcc) at boot. Be careful because there is no conflict checks being made wrt which GPIO you're changing, so you might damage your board or create a conflict here.
Buttons are described using a JSON string with the following syntax
[
{"gpio":<num>,
"type":"BUTTON_LOW | BUTTON_HIGH",
"pull":[true|false],
"long_press":<ms>,
"debounce":<ms>,
"shifter_gpio":<-1|num>,
"normal": {"pressed":"<action>","released":"<action>"},
"longpress": { <same> },
"shifted": { <same> },
"longshifted": { <same> },
},
{ ... },
{ ... },
]
Where (all parameters are optionals except gpio)
Where is either the name of another configuration to load or one amongst
ACTRLS_NONE, ACTRLS_VOLUP, ACTRLS_VOLDOWN, ACTRLS_TOGGLE, ACTRLS_PLAY,
ACTRLS_PAUSE, ACTRLS_STOP, ACTRLS_REW, ACTRLS_FWD, ACTRLS_PREV, ACTRLS_NEXT,
BCTRLS_PUSH, BCTRLS_UP, BCTRLS_DOWN, BCTRLS_LEFT, BCTRLS_RIGHT
One you've created such a string, use it to fill a new NVS parameter with any name below 16(?) characters. You can have as many of these configs as you can. Then set the config parameter "actrls_config" with the name of your default config
For example a config named "buttons" :
[{"gpio":4,"type":"BUTTON_LOW","pull":true,"long_press":1000,"normal":{"pressed":"ACTRLS_VOLDOWN"},"longpress":{"pressed":"buttons_remap"}},
{"gpio":5,"type":"BUTTON_LOW","pull":true,"shifter_gpio":4,"normal":{"pressed":"ACTRLS_VOLUP"}, "shifted":{"pressed":"ACTRLS_TOGGLE"}}]
Defines two buttons
While the config named "buttons_remap"
[{"gpio":4,"type":"BUTTON_LOW","pull":true,"long_press":1000,"normal":{"pressed":"BCTRLS_DOWN"},"longpress":{"pressed":"buttons"}},
{"gpio":5,"type":"BUTTON_LOW","pull":true,"shifter_gpio":4,"normal":{"pressed":"BCTRLS_UP"}}]
Defines two buttons
Below is a difficult but functional 2-buttons interface for your decoding pleasure
buttons
[{"gpio":4,"type":"BUTTON_LOW","pull":true,"long_press":1000,
"normal":{"pressed":"ACTRLS_VOLDOWN"},
"longpress":{"pressed":"buttons_remap"}},
{"gpio":5,"type":"BUTTON_LOW","pull":true,"long_press":1000,"shifter_gpio":4,
"normal":{"pressed":"ACTRLS_VOLUP"},
"shifted":{"pressed":"ACTRLS_TOGGLE"},
"longpress":{"pressed":"ACTRLS_NEXT"}}
]
buttons_remap
[{"gpio":4,"type":"BUTTON_LOW","pull":true,"long_press":1000,
"normal":{"pressed":"BCTRLS_DOWN"},
"longpress":{"pressed":"buttons"}},
{"gpio":5,"type":"BUTTON_LOW","pull":true,"long_press":1000,"shifter_gpio":4,
"normal":{"pressed":"BCTRLS_UP"},
"shifted":{"pressed":"BCTRLS_PUSH"},
"longpress":{"pressed":"ACTRLS_PLAY"},
"longshifted":{"pressed":"BCTRLS_LEFT"}}
]
You can use docker to build squeezelite-esp32
First you need to build the Docker container:
docker build -t esp-idf .
Then you need to run the container:
docker run -i -t -v `pwd`:/workspace/squeezelite-esp32 esp-idf
The above command will mount this repo into the docker container and start a bash terminal for you to then follow the below build steps
Currently this project requires a specific combination of IDF 4 with gcc 5.2. You'll have to implement the gcc 5.2 toolchain from an IDF 3.2 install into the IDF 4 directory in order to successfully compile it
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/ And then copying the i2s.c patch file from this repo over to the esp-idf folder
MOST IMPORTANT: create the right default config file
make menuconfig Then
# Build recovery.bin, bootloader.bin, ota_data_initial.bin, partitions.bin
# force appropriate rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
export PROJECT_NAME="recovery"
make -j4 all EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=1'
make flash
#
# Build squeezelite.bin
# Now force a rebuild by touching all the files which may have a RECOVERY_APPLICATION specific source compile logic
find . \( -name "*.cpp" -o -name "*.c" -o -name "*.h" \) -type f -print0 | xargs -0 grep -l "RECOVERY_APPLICATION" | xargs touch
export PROJECT_NAME="squeezelite"
make -j4 app EXTRA_CPPFLAGS='-DRECOVERY_APPLICATION=0'
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 0x150000 ./build/squeezelite.bin
# monitor serial output
make monitor
1/ setup WiFi
2/ setup squeezelite command line (optional)
At this point, the device should have disabled its built-in access point and should be connected to a known WiFi network.
3/ Updating Squeezelite
3/ Recovery
The squeezelite options are very similar to the regular Linux ones. Differences are :
- the output is -o ["BT -n '<sinkname>' "] | [I2S]
- if you've compiled with RESAMPLE option, normal soxr options are available using -R [-u <options>]. Note that anything above LQ or MQ will overload the CPU
- if you've used RESAMPLE16, <options> are (b|l|m)[:i], with b = basic linear interpolation, l = 13 taps, m = 21 taps, i = interpolate filter coefficients
For example, so use a BT speaker named MySpeaker, accept audio up to 192kHz and resample everything to 44100 and use 16 bits resample with medium quality, the command line is:
squeezelite -o "BT -n 'BT <sinkname>'" -b 500:2000 -R -u m -Z 192000 -r "44100-44100"
See squeezlite command line, but keys options are
- Z <rate> : tell LMS what is the max sample rate supported before LMS resamples
- R (see above)
- r "<minrate>-<maxrate>"