From a45c4f7f0691a76905fa9b6d241161105f7fb319 Mon Sep 17 00:00:00 2001 From: philippe44 Date: Wed, 3 Jul 2019 14:20:30 -0700 Subject: [PATCH] freeze fix by increasing WiFi RX buffer *or* forcing L2-to-L3 copy --- README.md | 25 +++++++++++++++++++++++++ main/console.c | 5 +++-- sdkconfig.defaults | 2 +- 3 files changed, 29 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index ee3785a2..8874a2b8 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,23 @@ Then - make -j4 - make flash monitor +Once the application is running, under monitor, add autoexec to launch squeezelite at boot + +1/ setup WiFi +nvs_set autoexec1 str -v "join " + +2/ setup squeezelite command line (optional) +nvs_set autoexec2 str -v "squeezelite -o I2S -b 500:2000 -d all=info -m ESP32" + +3/ enable autoexec +nv_set autoexec u8 -v 1 + +The "join" and "squeezelite" commands can alos be types at the prompt to start manually. Use "help" to see the list. +The squeezelite options are very similar to the regular squeezelite options. Differences are : + - the output is -o [BT ] | [I2S] + - if you've compiled RESAMPLE option, normal soxr options are available using -R [-u ]. Note that anything above LQ or MQ will overload the CPU + - if you've used RESAMPLE16, are (b|l|m)[:i], with b = basic linear interpolation, l = 13 taps, m = 21 taps, i = interpolate filter coefficients + # Additional misc notes - for all libraries, add -mlongcalls - libmad, libflac (no esp's version), libvorbis (tremor - not esp's version), alac work @@ -20,3 +37,11 @@ Then - set IDF_PATH=/home/esp-idf - set ESPPORT=COM9 - update flash partition size +- other compiler #define + - use no resampling or set RESAMPLE (soxr) or set RESAMPLE16 for fast fixed 16 bits resampling + - use LOOPBACK (mandatory) + - use BYTES_PER_FRAME=4 (8 is not fully functionnal) + - LINKALL (mandatory) + - NO_FAAD unless you want to us faad, which currently overloads the CPU + - TREMOR_ONLY (mandatory) + diff --git a/main/console.c b/main/console.c index 5476c617..58e55308 100644 --- a/main/console.c +++ b/main/console.c @@ -145,8 +145,9 @@ void process_autoexec(){ { ESP_LOGD(TAG,"No matching command found for name autoexec. Adding default entries"); uint8_t autoexec_dft=0; - char autoexec1_dft[]="join MySSID MyPASSWORD"; - char autoexec2_dft[]="squeezelite -o \"DAC\" -b 500:2000 -d all=debug -M esp32 -r \"44100,4800\" -N \"playername.txt\""; + char autoexec1_dft[64]; + char autoexec2_dft[]="squeezelite -o \"I2S\" -b 500:2000 -d all=info -M esp32"; + snprintf(autoexec1_dft, 64, "join %s %s", CONFIG_WIFI_SSID, CONFIG_WIFI_PASSWORD); store_nvs_value(NVS_TYPE_U8,"autoexec",&autoexec_dft); store_nvs_value(NVS_TYPE_STR,"autoexec1",autoexec1_dft); store_nvs_value(NVS_TYPE_STR,"autoexec2",autoexec2_dft); diff --git a/sdkconfig.defaults b/sdkconfig.defaults index 909f707c..f659affb 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -97,7 +97,7 @@ CONFIG_ESP32_WIFI_SW_COEXIST_ENABLE=y CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_BALANCE=y CONFIG_ESP32_WIFI_SW_COEXIST_PREFERENCE_VALUE=2 CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=12 -CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=24 +CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12