From e6c5c04fd6c2659ab89f36f58620225229ceaefa Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 2 Aug 2020 10:56:33 -0700 Subject: [PATCH 1/6] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 39b948c5..05398911 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ data=,clk=[,dc=][,host=1|2] ### DAC/I2S The NVS parameter "dac_config" set the gpio used for i2s communication with your DAC. You can define the defaults at compile time but nvs parameter takes precedence except for SqueezeAMP and A1S where these are forced at runtime. If your DAC also requires i2c, then you must go the re-compile route. Syntax is ``` -bck=,ws=,do=[,model=TAS57xx|TAS5713|AC101|I2S][,sda=,scl=gpio] +bck=,ws=,do=[,mute=[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=,scl=gpio] ``` if "model" is not set or is not recognized, then default "I2S" is used. ### SPDIF @@ -124,7 +124,7 @@ The parameter "set_GPIO" is used to assign GPIO to various functions. GPIO can be set to GND provide or Vcc at boot. This is convenient to power devices that consume less than 40mA from the side connector. 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. -The \ parameter can use used to assign a GPIO that will be set to 1 when playback starts. It will be reset to 0 when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \ +The \ parameter can use used to assign a GPIO that will be set to active level when playback starts. It will be reset when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \ If you have an audio jack that supports insertion (use :0 or :1 to set the level when inserted), you can specify which GPIO it's connected to. Using the parameter jack_mutes_amp allows to mute the amp when headset (e.g.) is inserted. @@ -135,7 +135,7 @@ The \ parameter set the GPIO associated to an IR receiver. No need to add p Syntax is: ``` -=Vcc|GND|amp|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,] +=Vcc|GND|amp[:0|1]|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,] ``` You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for SqueezeAMP where these are forced at runtime. ### LED From 80188e944c1e0ca9dbe23676c06f2abd6f31e71b Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 2 Aug 2020 10:57:30 -0700 Subject: [PATCH 2/6] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 05398911..65edb567 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ if you want to rebuild, use the `squeezelite-esp32-SqueezeAmp-sdkconfig.defaults NB: You can use the pre-build binaries SqueezeAMP4MBFlash/SqueezeAMP8MBFlash which has all the hardware I/O set properly. You can also use the generic binary I2S4MBFlash in which case the NVS parameters shall be set to get the exact same behavior - set_GPIO: 12=green,13=red,34=jack,2=spkfault - batt_config: channel=7,scale=20.24 -- dac_config: model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14 +- dac_config: model=TAS57xx,bck=33,ws=25,do=32,sda=27,scl=26,mute=14:0 - spdif_config: bck=33,ws=25,do=15 ### ESP32-A1S @@ -124,7 +124,7 @@ The parameter "set_GPIO" is used to assign GPIO to various functions. GPIO can be set to GND provide or Vcc at boot. This is convenient to power devices that consume less than 40mA from the side connector. 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. -The \ parameter can use used to assign a GPIO that will be set to active level when playback starts. It will be reset when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \ +The \ parameter can use used to assign a GPIO that will be set to active level (default 1) when playback starts. It will be reset when squeezelite becomes idle. The idle timeout is set on the squeezelite command line through -C \ If you have an audio jack that supports insertion (use :0 or :1 to set the level when inserted), you can specify which GPIO it's connected to. Using the parameter jack_mutes_amp allows to mute the amp when headset (e.g.) is inserted. @@ -135,7 +135,7 @@ The \ parameter set the GPIO associated to an IR receiver. No need to add p Syntax is: ``` -=Vcc|GND|amp[:0|1]|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,] +=Vcc|GND|amp[:1|0]|ir|jack[:0|1]|green[:0|1]|red[:0|1]|spkfault[:0|1][,] ``` You can define the defaults for jack, spkfault leds at compile time but nvs parameter takes precedence except for SqueezeAMP where these are forced at runtime. ### LED From a4200b4b855f2a5f3210b1dfd077021d665c3977 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 2 Aug 2020 18:16:09 -0700 Subject: [PATCH 3/6] Update README.md --- README.md | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65edb567..d176ef2d 100644 --- a/README.md +++ b/README.md @@ -64,9 +64,18 @@ data=,clk=[,dc=][,host=1|2] ### DAC/I2S The NVS parameter "dac_config" set the gpio used for i2s communication with your DAC. You can define the defaults at compile time but nvs parameter takes precedence except for SqueezeAMP and A1S where these are forced at runtime. If your DAC also requires i2c, then you must go the re-compile route. Syntax is ``` -bck=,ws=,do=[,mute=[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,sda=,scl=gpio] +bck=,ws=,do=[,mute=[:0|1][,model=TAS57xx|TAS5713|AC101|I2S][,i2c=,sda=,scl=gpio] ``` -if "model" is not set or is not recognized, then default "I2S" is used. +if "model" is not set or is not recognized, then default "I2S" is used. I2C parameters are optional an only needed if your dac requires and I2C control (See 'dac_controlset' below). Note that "i2c" parameters is decimal, hex notation is not allowed. + +The parameter "dac_controlset" allows definition of simple commands to be sent of i2c for init, power on and off using a JSON syntax: +``` +{ init: [ {"reg":,"val":,"mode":|"or"|"and"}, ... {{"reg":,"val":,"mode":|"or"|"and"} ], + poweron: [ {"reg":,"val":,"mode":|"or"|"and"}, ... {{"reg":,"val":,"mode":|"or"|"and"} ], + poweroff: [ {"reg":,"val":,"mode":|"or"|"and"}, ... {{"reg":,"val":,"mode":|"or"|"and"} ] } +``` +This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but tht does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal** + ### SPDIF The NVS parameter "spdif_config" sets the i2s's gpio needed for SPDIF. From 9d7c0eb48ffed1fae2a4180a8393d0b57df08134 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 2 Aug 2020 18:17:13 -0700 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d176ef2d..ebdf944b 100644 --- a/README.md +++ b/README.md @@ -74,7 +74,7 @@ The parameter "dac_controlset" allows definition of simple commands to be sent o poweron: [ {"reg":,"val":,"mode":|"or"|"and"}, ... {{"reg":,"val":,"mode":|"or"|"and"} ], poweroff: [ {"reg":,"val":,"mode":|"or"|"and"}, ... {{"reg":,"val":,"mode":|"or"|"and"} ] } ``` -This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but tht does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal** +This is standard JSON notation, so if you are not familiar with it, Google is your best friend. Be aware that the '...' means you can have as many entries as you want, it's not part of the syntax. Every section is optional, but it does not make sense to set i2c in the 'dac_config' parameter and not setting anything here. The parameter 'mode' allows to *or* the register with the value or to *and* it. Don't set 'mode' if you simply want to write. **Note that all values must be decimal** ### SPDIF The NVS parameter "spdif_config" sets the i2s's gpio needed for SPDIF. From 0bcc2bceccbf000ff2713363886a2847d5c1f170 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 2 Aug 2020 18:39:59 -0700 Subject: [PATCH 5/6] Update README.md --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index ebdf944b..b4f1e593 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,13 @@ So a possible config would be ``` [{"gpio":5,"normal":{"pressed":"ACTRLS_TOGGLE"}},{"gpio":18,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLUP"}, "shifted":{"pressed":"ACTRLS_NEXT"}}, {"gpio":23,"pull":true,"shifter_gpio":5,"normal":{"pressed":"ACTRLS_VOLDOWN"},"shifted":{"pressed":"ACTRLS_PREV"}}] ``` +### T-WATCH2020 by LilyGo +This is a fun [smartwatch](http://www.lilygo.cn/prod_view.aspx?TypeId=50036&Id=1290&FId=t3:50036:3) based on ESP32. It has a 240x240 ST7789 screen and onboard audio. Not very useful to listen to anything but it works. This is an example of a device that requires an I2C set of commands for its dac (see below). There is a build-option if you decide to rebuild everything by yourself, otherwise the I2S default option works with the following parameters +- dac_config: model=I2S,bck=26,ws=25,do=33,i2c=106,sda=21,scl=22 +- dac_controlset: { "init": [ {"reg":41, "val":128}, {"reg":18, "val":255} ], "poweron": [ {"reg":18, "val":2}, "mode":"or" ], "poweroff": [ {"reg":18, "val":253}, "mode":"and" ] } +- spi_config: dc=27,data=19,clk=18 +- display_config: SPI,driver=ST7789,width=240,height=240,cs=5,back=12,speed=16000000,HFlip,VFlip ### ESP32-WROVER + I2S DAC 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: From 1dcd0aeacbaff363057a8ade5578b75b879faf0f Mon Sep 17 00:00:00 2001 From: philippe44 Date: Sun, 2 Aug 2020 19:15:24 -0700 Subject: [PATCH 6/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b4f1e593..86f078c2 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ So a possible config would be This is a fun [smartwatch](http://www.lilygo.cn/prod_view.aspx?TypeId=50036&Id=1290&FId=t3:50036:3) based on ESP32. It has a 240x240 ST7789 screen and onboard audio. Not very useful to listen to anything but it works. This is an example of a device that requires an I2C set of commands for its dac (see below). There is a build-option if you decide to rebuild everything by yourself, otherwise the I2S default option works with the following parameters - dac_config: model=I2S,bck=26,ws=25,do=33,i2c=106,sda=21,scl=22 -- dac_controlset: { "init": [ {"reg":41, "val":128}, {"reg":18, "val":255} ], "poweron": [ {"reg":18, "val":2}, "mode":"or" ], "poweroff": [ {"reg":18, "val":253}, "mode":"and" ] } +- dac_controlset: { "init": [ {"reg":41, "val":128}, {"reg":18, "val":255} ], "poweron": [ {"reg":18, "val":64, "mode":"or"} ], "poweroff": [ {"reg":18, "val":191, "mode":"and"} ] } - spi_config: dc=27,data=19,clk=18 - display_config: SPI,driver=ST7789,width=240,height=240,cs=5,back=12,speed=16000000,HFlip,VFlip ### ESP32-WROVER + I2S DAC