diff --git a/build-scripts/ESP32-A1S-sdkconfig.defaults b/build-scripts/ESP32-A1S-sdkconfig.defaults index 6ab2894c..98217f4d 100644 --- a/build-scripts/ESP32-A1S-sdkconfig.defaults +++ b/build-scripts/ESP32-A1S-sdkconfig.defaults @@ -198,13 +198,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y diff --git a/build-scripts/I2S-4MFlash-sdkconfig.defaults b/build-scripts/I2S-4MFlash-sdkconfig.defaults index 35a8c193..233fc07b 100644 --- a/build-scripts/I2S-4MFlash-sdkconfig.defaults +++ b/build-scripts/I2S-4MFlash-sdkconfig.defaults @@ -199,13 +199,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y diff --git a/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults b/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults index 683b7459..081f1d6f 100644 --- a/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults +++ b/build-scripts/NonOTA-I2S-4MFlash-sdkconfig.defaults @@ -199,13 +199,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y diff --git a/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults b/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults index af16ca61..4fdc0d18 100644 --- a/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults +++ b/build-scripts/NonOTA-SqueezeAmp-sdkconfig.defaults @@ -198,13 +198,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y diff --git a/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults b/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults index f7498b6d..55357d66 100644 --- a/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults +++ b/build-scripts/SqueezeAmp4MBFlash-sdkconfig.defaults @@ -198,13 +198,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y diff --git a/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults b/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults index e01dccf1..bde75ce2 100644 --- a/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults +++ b/build-scripts/SqueezeAmp8MBFlash-sdkconfig.defaults @@ -192,13 +192,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y diff --git a/components/codecs/component.mk b/components/codecs/component.mk index 99e87521..4e4e1eaa 100644 --- a/components/codecs/component.mk +++ b/components/codecs/component.mk @@ -4,23 +4,21 @@ # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) COMPONENT_ADD_LDFLAGS=-l$(COMPONENT_NAME) \ $(COMPONENT_PATH)/lib/libmad.a \ - $(COMPONENT_PATH)/lib/libesp-flac.a \ + $(COMPONENT_PATH)/lib/libFLAC.a \ $(COMPONENT_PATH)/lib/libhelix-aac.a \ $(COMPONENT_PATH)/lib/libvorbisidec.a \ $(COMPONENT_PATH)/lib/libogg.a \ $(COMPONENT_PATH)/lib/libalac.a \ $(COMPONENT_PATH)/lib/libresample16.a \ - $(COMPONENT_PATH)/lib/libsoxr.a \ $(COMPONENT_PATH)/lib/libopusfile.a \ $(COMPONENT_PATH)/lib/libopus.a - + + #$(COMPONENT_PATH)/lib/libFLAC.a + #$(COMPONENT_PATH)/lib/libesp-flac.a + #$(COMPONENT_PATH)/lib/libsoxr.a #$(COMPONENT_PATH)/lib/libfaad.a #$(COMPONENT_PATH)/lib/libvorbisidec.a #$(COMPONENT_PATH)/lib/libesp-opus.a #$(COMPONENT_PATH)/lib/libogg.a #$(COMPONENT_PATH)/lib/libesp-tremor.a #$(COMPONENT_PATH)/lib/libesp-ogg-container.a - - - - diff --git a/components/codecs/lib/libFLAC.a b/components/codecs/lib/libFLAC.a new file mode 100644 index 00000000..80e9caaf Binary files /dev/null and b/components/codecs/lib/libFLAC.a differ diff --git a/components/codecs/lib/libesp-flac.a b/components/codecs/lib/libesp-flac.a deleted file mode 100644 index 1050d0d8..00000000 Binary files a/components/codecs/lib/libesp-flac.a and /dev/null differ diff --git a/components/codecs/lib/libesp-ogg-container.a b/components/codecs/lib/libesp-ogg-container.a deleted file mode 100644 index 40ce6cab..00000000 Binary files a/components/codecs/lib/libesp-ogg-container.a and /dev/null differ diff --git a/components/codecs/lib/libesp-tremor.a b/components/codecs/lib/libesp-tremor.a deleted file mode 100644 index 4cb36e74..00000000 Binary files a/components/codecs/lib/libesp-tremor.a and /dev/null differ diff --git a/components/codecs/lib/libesp_processing.a b/components/codecs/lib/libesp_processing.a deleted file mode 100644 index 1d92b644..00000000 Binary files a/components/codecs/lib/libesp_processing.a and /dev/null differ diff --git a/components/codecs/lib/libfaad.a b/components/codecs/lib/libfaad.a deleted file mode 100644 index ef14f406..00000000 Binary files a/components/codecs/lib/libfaad.a and /dev/null differ diff --git a/components/codecs/lib/libsoxr.a b/components/codecs/lib/libsoxr.a deleted file mode 100644 index 377edc18..00000000 Binary files a/components/codecs/lib/libsoxr.a and /dev/null differ diff --git a/components/squeezelite/flac.c b/components/squeezelite/flac.c index f3fbb938..cd08aeb3 100644 --- a/components/squeezelite/flac.c +++ b/components/squeezelite/flac.c @@ -36,6 +36,7 @@ struct flac { FLAC__StreamDecoder *decoder; + u8_t container; #if !LINKALL // FLAC symbols to be dynamically loaded const char **FLAC__StreamDecoderErrorStatusString; @@ -55,6 +56,18 @@ struct flac { FLAC__StreamDecoderErrorCallback error_callback, void *client_data ); + FLAC__StreamDecoderInitStatus (* FLAC__stream_decoder_init_ogg_stream)( + FLAC__StreamDecoder *decoder, + FLAC__StreamDecoderReadCallback read_callback, + FLAC__StreamDecoderSeekCallback seek_callback, + FLAC__StreamDecoderTellCallback tell_callback, + FLAC__StreamDecoderLengthCallback length_callback, + FLAC__StreamDecoderEofCallback eof_callback, + FLAC__StreamDecoderWriteCallback write_callback, + FLAC__StreamDecoderMetadataCallback metadata_callback, + FLAC__StreamDecoderErrorCallback error_callback, + void *client_data + ); FLAC__bool (* FLAC__stream_decoder_process_single)(FLAC__StreamDecoder *decoder); FLAC__StreamDecoderState (* FLAC__stream_decoder_get_state)(const FLAC__StreamDecoder *decoder); #endif @@ -220,18 +233,30 @@ static void error_cb(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErro LOG_INFO("flac error: %s", FLAC_A(f, StreamDecoderErrorStatusString)[status]); } +static void flac_close(void) { + FLAC(f, stream_decoder_delete, f->decoder); + f->decoder = NULL; +} + static void flac_open(u8_t sample_size, u8_t sample_rate, u8_t channels, u8_t endianness) { + if ( f->decoder && f->container != sample_size ) { + flac_close(); + } + + f->container = sample_size; + if (f->decoder) { FLAC(f, stream_decoder_reset, f->decoder); } else { f->decoder = FLAC(f, stream_decoder_new); } - FLAC(f, stream_decoder_init_stream, f->decoder, &read_cb, NULL, NULL, NULL, NULL, &write_cb, NULL, &error_cb, NULL); -} - -static void flac_close(void) { - FLAC(f, stream_decoder_delete, f->decoder); - f->decoder = NULL; + + if ( f->container == 'o' ) { + LOG_DEBUG("ogg/flac container - using init_ogg_stream"); + FLAC(f, stream_decoder_init_ogg_stream, f->decoder, &read_cb, NULL, NULL, NULL, NULL, &write_cb, NULL, &error_cb, NULL); + } else { + FLAC(f, stream_decoder_init_stream, f->decoder, &read_cb, NULL, NULL, NULL, NULL, &write_cb, NULL, &error_cb, NULL); + } } static decode_state flac_decode(void) { @@ -267,6 +292,7 @@ static bool load_flac() { f->FLAC__stream_decoder_reset = dlsym(handle, "FLAC__stream_decoder_reset"); f->FLAC__stream_decoder_delete = dlsym(handle, "FLAC__stream_decoder_delete"); f->FLAC__stream_decoder_init_stream = dlsym(handle, "FLAC__stream_decoder_init_stream"); + f->FLAC__stream_decoder_init_ogg_stream = dlsym(handle, "FLAC__stream_decoder_init_ogg_stream"); f->FLAC__stream_decoder_process_single = dlsym(handle, "FLAC__stream_decoder_process_single"); f->FLAC__stream_decoder_get_state = dlsym(handle, "FLAC__stream_decoder_get_state"); @@ -284,7 +310,7 @@ static bool load_flac() { struct codec *register_flac(void) { static struct codec ret = { 'f', // id - "flc", // types + "ogf,flc", // types 16384, // min read 204800, // min space flac_open, // open @@ -303,6 +329,6 @@ struct codec *register_flac(void) { return NULL; } - LOG_INFO("using flac to decode flc"); + LOG_INFO("using flac to decode ogf,flc"); return &ret; } diff --git a/sdkconfig.defaults b/sdkconfig.defaults index ba1d6f53..0d9e7da8 100644 --- a/sdkconfig.defaults +++ b/sdkconfig.defaults @@ -166,13 +166,7 @@ CONFIG_BT_A2DP_SOURCE_TASK_STACK_SIZE=2048 CONFIG_BT_SSP_ENABLED=y -CONFIG_BT_BLE_ENABLED=y -CONFIG_BT_GATTS_ENABLE=y - -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_AUTO=y -CONFIG_BT_GATTS_SEND_SERVICE_CHANGE_MODE=0 -CONFIG_BT_GATTC_ENABLE=y - +CONFIG_BT_BLE_ENABLED=n CONFIG_BT_BLE_SMP_ENABLE=y @@ -497,6 +491,8 @@ 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 +CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=n +CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=n @@ -613,7 +609,7 @@ CONFIG_LWIP_MAX_SOCKETS=16 CONFIG_LWIP_SO_REUSE=y CONFIG_LWIP_SO_REUSE_RXTOALL=y - +CONFIG_LWIP_IP_REASSEMBLY=y