From fd307cd3b1d7069f3a868d90086d9b75a5e6fe5f Mon Sep 17 00:00:00 2001 From: Carlos Date: Tue, 19 Oct 2021 06:44:05 +0200 Subject: [PATCH 1/8] correct gitignore file so submodules will work --- .gitignore | 2 -- components/flac/flac | 1 + components/opus/opus | 1 + components/wifi_logger | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) create mode 160000 components/flac/flac create mode 160000 components/opus/opus create mode 160000 components/wifi_logger diff --git a/.gitignore b/.gitignore index e7428df..cfcb420 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,2 @@ build libopus -components/opus/opus -components/flac/flac diff --git a/components/flac/flac b/components/flac/flac new file mode 160000 index 0000000..b358381 --- /dev/null +++ b/components/flac/flac @@ -0,0 +1 @@ +Subproject commit b358381a102a2c1c153ee4cf95dfc04af62faa1a diff --git a/components/opus/opus b/components/opus/opus new file mode 160000 index 0000000..df9c4c8 --- /dev/null +++ b/components/opus/opus @@ -0,0 +1 @@ +Subproject commit df9c4c8e562b952ca14fa90ef21dff9a8dd2b3a4 diff --git a/components/wifi_logger b/components/wifi_logger new file mode 160000 index 0000000..23bf246 --- /dev/null +++ b/components/wifi_logger @@ -0,0 +1 @@ +Subproject commit 23bf246c863c15d118c46cce47dd3f1657809ab7 From 75c26a82aa6f2b327bfaf7e2ae95c1ec6bf1cbb3 Mon Sep 17 00:00:00 2001 From: Karl Osterseher Date: Tue, 19 Oct 2021 11:54:41 +0200 Subject: [PATCH 2/8] repair submodule configurations --- .gitmodules | 6 +++--- components/opus/opus | 2 +- components/wifi_logger | 1 - sdkconfig | 8 +++++++- 4 files changed, 11 insertions(+), 6 deletions(-) delete mode 160000 components/wifi_logger diff --git a/.gitmodules b/.gitmodules index b6ebb88..edb11e1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,9 @@ -[submodule "components/opus/opus"] - path = components/opus/opus - url = https://github.com/xiph/opus [submodule "components/esp-dsp"] path = components/esp-dsp url = https://github.com/espressif/esp-dsp [submodule "components/flac/flac"] path = components/flac/flac url = https://github.com/xiph/flac.git +[submodule "components/opus/opus"] + path = components/opus/opus + url = https://github.com/xiph/opus diff --git a/components/opus/opus b/components/opus/opus index df9c4c8..6b6035a 160000 --- a/components/opus/opus +++ b/components/opus/opus @@ -1 +1 @@ -Subproject commit df9c4c8e562b952ca14fa90ef21dff9a8dd2b3a4 +Subproject commit 6b6035ae4a29abbd237463d84a45fbeb0d92bc18 diff --git a/components/wifi_logger b/components/wifi_logger deleted file mode 160000 index 23bf246..0000000 --- a/components/wifi_logger +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 23bf246c863c15d118c46cce47dd3f1657809ab7 diff --git a/sdkconfig b/sdkconfig index ef0078e..1c27726 100644 --- a/sdkconfig +++ b/sdkconfig @@ -73,6 +73,13 @@ CONFIG_BOOTLOADER_RESERVE_RTC_SIZE=0 # CONFIG_SECURE_FLASH_ENC_ENABLED is not set # end of Security features +# +# Example Board Configuration +# +CONFIG_ESP_LYRAT_V4_3_BOARD=y +CONFIG_ESP_CUSTOM_BOARD=y +# end of Example Board Configuration + # # Serial flasher config # @@ -129,7 +136,6 @@ CONFIG_PARTITION_TABLE_MD5=y # Audio HAL # # CONFIG_AUDIO_BOARD_CUSTOM is not set -CONFIG_ESP_LYRAT_V4_3_BOARD=y # CONFIG_ESP_LYRAT_V4_2_BOARD is not set # CONFIG_ESP_LYRATD_MSC_V2_1_BOARD is not set # CONFIG_ESP_LYRATD_MSC_V2_2_BOARD is not set From 445cb9a24b05541c81a75a37daaf5034897a2b56 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Nov 2021 06:58:01 +0100 Subject: [PATCH 3/8] remove esp_peripheral and key, SD card code from custom_board to make it compatible with rest of project --- components/custom_board/generic_board/board.c | 133 ++++++++-------- .../generic_board/include/board.h | 148 +++++++++--------- 2 files changed, 147 insertions(+), 134 deletions(-) diff --git a/components/custom_board/generic_board/board.c b/components/custom_board/generic_board/board.c index c02ee82..8f9cff2 100644 --- a/components/custom_board/generic_board/board.c +++ b/components/custom_board/generic_board/board.c @@ -6,10 +6,10 @@ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in * which case, it is free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the - * Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do - * so, subject to the following conditions: + * Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. @@ -18,9 +18,9 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. * */ @@ -28,8 +28,8 @@ #include "audio_mem.h" #include "esp_log.h" -#include "periph_adc_button.h" -#include "periph_sdcard.h" +//#include "periph_adc_button.h" +//#include "periph_sdcard.h" #if CONFIG_DAC_PCM51XX extern audio_hal_func_t AUDIO_CODEC_PCM51XX_DEFAULT_HANDLE; @@ -46,67 +46,78 @@ static const char *TAG = "AUDIO_BOARD"; static audio_board_handle_t board_handle = 0; -audio_board_handle_t audio_board_init(void) { - if (board_handle) { - ESP_LOGW(TAG, "The board has already been initialized!"); - return board_handle; - } - board_handle = - (audio_board_handle_t)audio_calloc(1, sizeof(struct audio_board_handle)); - AUDIO_MEM_CHECK(TAG, board_handle, return NULL); - board_handle->audio_hal = audio_board_codec_init(); - ESP_LOGI(TAG,"board-handle done") ; +audio_board_handle_t +audio_board_init (void) +{ + if (board_handle) + { + ESP_LOGW (TAG, "The board has already been initialized!"); + return board_handle; + } + board_handle = (audio_board_handle_t)audio_calloc ( + 1, sizeof (struct audio_board_handle)); + AUDIO_MEM_CHECK (TAG, board_handle, return NULL); + board_handle->audio_hal = audio_board_codec_init (); + ESP_LOGI (TAG, "board-handle done"); return board_handle; } -audio_hal_handle_t audio_board_codec_init(void) { - ESP_LOGI("HAL", "INIT" ); - audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG(); - - audio_hal_handle_t codec_hal = - audio_hal_init(&audio_codec_cfg, &AUDIO_CODEC_DEFAULT_HANDLE); - ESP_LOGI("HAL", "codec_hal done" ); - - AUDIO_NULL_CHECK(TAG, codec_hal, return NULL); +audio_hal_handle_t +audio_board_codec_init (void) +{ + ESP_LOGI ("HAL", "INIT"); + audio_hal_codec_config_t audio_codec_cfg = AUDIO_CODEC_DEFAULT_CONFIG (); + + audio_hal_handle_t codec_hal + = audio_hal_init (&audio_codec_cfg, &AUDIO_CODEC_DEFAULT_HANDLE); + ESP_LOGI ("HAL", "codec_hal done"); + + AUDIO_NULL_CHECK (TAG, codec_hal, return NULL); return codec_hal; } -esp_err_t audio_board_key_init(esp_periph_set_handle_t set) { - esp_err_t ret = ESP_OK; - periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG(); - adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR(); - adc_btn_tag.adc_ch = ADC1_CHANNEL_0; // GPIO36 - adc_btn_tag.total_steps = 4; - int btn_array[5] = {200, 1355, 1820, 2280, 2930}; - adc_btn_tag.adc_level_step = btn_array; - adc_btn_cfg.arr = &adc_btn_tag; - adc_btn_cfg.arr_size = 1; - esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg); - AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK); - ret = esp_periph_start(set, adc_btn_handle); - return ret; +// esp_err_t audio_board_key_init(esp_periph_set_handle_t set) { +// esp_err_t ret = ESP_OK; +// periph_adc_button_cfg_t adc_btn_cfg = PERIPH_ADC_BUTTON_DEFAULT_CONFIG(); +// adc_arr_t adc_btn_tag = ADC_DEFAULT_ARR(); +// adc_btn_tag.adc_ch = ADC1_CHANNEL_0; // GPIO36 +// adc_btn_tag.total_steps = 4; +// int btn_array[5] = {200, 1355, 1820, 2280, 2930}; +// adc_btn_tag.adc_level_step = btn_array; +// adc_btn_cfg.arr = &adc_btn_tag; +// adc_btn_cfg.arr_size = 1; +// esp_periph_handle_t adc_btn_handle = periph_adc_button_init(&adc_btn_cfg); +// AUDIO_NULL_CHECK(TAG, adc_btn_handle, return ESP_ERR_ADF_MEMORY_LACK); +// ret = esp_periph_start(set, adc_btn_handle); +// return ret; +//} +// +// esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set, +// periph_sdcard_mode_t mode) { +// periph_sdcard_cfg_t sdcard_cfg = { +// .root = "/sdcard", +// .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34 +// }; +// esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg); +// esp_err_t ret = esp_periph_start(set, sdcard_handle); +// while (!periph_sdcard_is_mounted(sdcard_handle)) { +// vTaskDelay(500 / portTICK_PERIOD_MS); +// } +// return ret; +//} + +audio_board_handle_t +audio_board_get_handle (void) +{ + return board_handle; } -esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set, - periph_sdcard_mode_t mode) { - periph_sdcard_cfg_t sdcard_cfg = { - .root = "/sdcard", - .card_detect_pin = get_sdcard_intr_gpio(), // GPIO_NUM_34 - }; - esp_periph_handle_t sdcard_handle = periph_sdcard_init(&sdcard_cfg); - esp_err_t ret = esp_periph_start(set, sdcard_handle); - while (!periph_sdcard_is_mounted(sdcard_handle)) { - vTaskDelay(500 / portTICK_PERIOD_MS); - } - return ret; -} - -audio_board_handle_t audio_board_get_handle(void) { return board_handle; } - -esp_err_t audio_board_deinit(audio_board_handle_t audio_board) { +esp_err_t +audio_board_deinit (audio_board_handle_t audio_board) +{ esp_err_t ret = ESP_OK; - ret |= audio_hal_deinit(audio_board->audio_hal); - free(audio_board); + ret |= audio_hal_deinit (audio_board->audio_hal); + free (audio_board); board_handle = NULL; return ret; } diff --git a/components/custom_board/generic_board/include/board.h b/components/custom_board/generic_board/include/board.h index ee3e2b2..2a04813 100644 --- a/components/custom_board/generic_board/include/board.h +++ b/components/custom_board/generic_board/include/board.h @@ -6,10 +6,10 @@ * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in * which case, it is free of charge, to any person obtaining a copy of this * software and associated documentation files (the "Software"), to deal in the - * Software without restriction, including without limitation the rights to use, - * copy, modify, merge, publish, distribute, sublicense, and/or sell copies of - * the Software, and to permit persons to whom the Software is furnished to do - * so, subject to the following conditions: + * Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. @@ -18,9 +18,9 @@ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. * */ @@ -30,83 +30,85 @@ #include "audio_hal.h" #include "board_def.h" #include "board_pins_config.h" -#include "esp_peripherals.h" -#include "periph_sdcard.h" +//#include "esp_peripherals.h" +//#include "periph_sdcard.h" #ifdef __cplusplus -extern "C" { +extern "C" +{ #endif -/** - * @brief Audio board handle - */ -struct audio_board_handle { - audio_hal_handle_t audio_hal; /*!< pa hardware abstract layer handle */ - audio_hal_handle_t adc_hal; /*!< adc hardware abstract layer handle */ -}; + /** + * @brief Audio board handle + */ + struct audio_board_handle + { + audio_hal_handle_t audio_hal; /*!< pa hardware abstract layer handle */ + audio_hal_handle_t adc_hal; /*!< adc hardware abstract layer handle */ + }; -typedef struct audio_board_handle *audio_board_handle_t; + typedef struct audio_board_handle *audio_board_handle_t; -/** - * @brief Initialize audio board - * - * @return The audio board handle - */ -audio_board_handle_t audio_board_init(void); + /** + * @brief Initialize audio board + * + * @return The audio board handle + */ + audio_board_handle_t audio_board_init (void); -/** - * @brief Initialize codec - * - * @return The audio hal handle - */ -audio_hal_handle_t audio_board_codec_init(void); + /** + * @brief Initialize codec + * + * @return The audio hal handle + */ + audio_hal_handle_t audio_board_codec_init (void); -/** - * @brief Initialize adc - * - * @return The adc hal handle - */ -audio_hal_handle_t audio_board_adc_init(void); + /** + * @brief Initialize adc + * + * @return The adc hal handle + */ + audio_hal_handle_t audio_board_adc_init (void); -/** - * @brief Initialize key peripheral - * - * @param set The handle of esp_periph_set_handle_t - * - * @return - * - ESP_OK, success - * - Others, fail - */ -esp_err_t audio_board_key_init(esp_periph_set_handle_t set); + ///** + // * @brief Initialize key peripheral + // * + // * @param set The handle of esp_periph_set_handle_t + // * + // * @return + // * - ESP_OK, success + // * - Others, fail + // */ + // esp_err_t audio_board_key_init(esp_periph_set_handle_t set); + // + ///** + // * @brief Initialize sdcard peripheral + // * + // * @param set The handle of esp_periph_set_handle_t + // * + // * @return + // * - ESP_OK, success + // * - Others, fail + // */ + // esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set, + // periph_sdcard_mode_t mode); -/** - * @brief Initialize sdcard peripheral - * - * @param set The handle of esp_periph_set_handle_t - * - * @return - * - ESP_OK, success - * - Others, fail - */ -esp_err_t audio_board_sdcard_init(esp_periph_set_handle_t set, - periph_sdcard_mode_t mode); + /** + * @brief Query audio_board_handle + * + * @return The audio board handle + */ + audio_board_handle_t audio_board_get_handle (void); -/** - * @brief Query audio_board_handle - * - * @return The audio board handle - */ -audio_board_handle_t audio_board_get_handle(void); - -/** - * @brief Uninitialize the audio board - * - * @param audio_board The handle of audio board - * - * @return 0 success, - * others fail - */ -esp_err_t audio_board_deinit(audio_board_handle_t audio_board); + /** + * @brief Uninitialize the audio board + * + * @param audio_board The handle of audio board + * + * @return 0 success, + * others fail + */ + esp_err_t audio_board_deinit (audio_board_handle_t audio_board); #ifdef __cplusplus } From 11c2c28044bb582fbeb0536ae82a23f880a57e69 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Nov 2021 07:01:48 +0100 Subject: [PATCH 4/8] merge with origin master --- components/opus/opus | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/opus/opus b/components/opus/opus index 6b6035a..df9c4c8 160000 --- a/components/opus/opus +++ b/components/opus/opus @@ -1 +1 @@ -Subproject commit 6b6035ae4a29abbd237463d84a45fbeb0d92bc18 +Subproject commit df9c4c8e562b952ca14fa90ef21dff9a8dd2b3a4 From 177f60361f03490fea1a21bcca1f4f0f0f38eee3 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Nov 2021 08:03:26 +0100 Subject: [PATCH 5/8] repair submodule --- .gitmodules | 3 - components/opus/CMakeLists.txt | 18 --- components/opus/component.mk | 12 -- components/opus/config.h | 208 --------------------------------- components/opus/opus | 1 - 5 files changed, 242 deletions(-) delete mode 100644 components/opus/CMakeLists.txt delete mode 100644 components/opus/component.mk delete mode 100644 components/opus/config.h delete mode 160000 components/opus/opus diff --git a/.gitmodules b/.gitmodules index edb11e1..9f5f81f 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,6 +4,3 @@ [submodule "components/flac/flac"] path = components/flac/flac url = https://github.com/xiph/flac.git -[submodule "components/opus/opus"] - path = components/opus/opus - url = https://github.com/xiph/opus diff --git a/components/opus/CMakeLists.txt b/components/opus/CMakeLists.txt deleted file mode 100644 index 6ddb221..0000000 --- a/components/opus/CMakeLists.txt +++ /dev/null @@ -1,18 +0,0 @@ -file(GLOB srcs "opus/src/*.c") -file(GLOB silk "opus/silk/*.c") -file(GLOB celt "opus/celt/*.c") -file(GLOB fixed "opus/slik/fixed/*.c") -file(GLOB float "opus/slik/float/*.c") - - -idf_component_register(SRCS "${srcs}" "${silk}" "${celt}" "${fixed}" "${float}" - INCLUDE_DIRS . - "opus/include" - "opus/silk" - "opus/silk/fixed" - "opus/silk/float" - "opus/celt" - ) - -set_source_files_properties(opus/silk/quant_LTP_gains.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) -target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-DHAVE_CONFIG_H") diff --git a/components/opus/component.mk b/components/opus/component.mk deleted file mode 100644 index 024e046..0000000 --- a/components/opus/component.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -# Main Makefile. This is basically the same as a component makefile. -# -# This Makefile should, at the very least, just include $(SDK_PATH)/make/component_common.mk. By default, -# this will take the sources in the src/ directory, compile them and link them into -# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, -# please read the ESP-IDF documents if you need to do this. -# - -COMPONENT_SRCDIRS := opus/src opus/silk opus/silk/fixed opus/celt -COMPONENT_ADD_INCLUDEDIRS := . opus/include opus/silk opus/silk/fixed opus/celt -CFLAGS += -DHAVE_CONFIG_H diff --git a/components/opus/config.h b/components/opus/config.h deleted file mode 100644 index 03f3999..0000000 --- a/components/opus/config.h +++ /dev/null @@ -1,208 +0,0 @@ -/* config.h. Generated from config.h.in by configure. */ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Get CPU Info by asm method */ -/* #undef CPU_INFO_BY_ASM */ - -/* Get CPU Info by c method */ -/* #undef CPU_INFO_BY_C */ - -/* Custom modes */ -/* #undef CUSTOM_MODES */ - -/* Do not build the float API */ -//#define DISABLE_FLOAT_API 1 - -/* Assertions */ -/* #undef ENABLE_ASSERTIONS */ - -/* Ambisonics Support */ -/* #undef ENABLE_EXPERIMENTAL_AMBISONICS */ - -/* Enable bitstream changes from draft-ietf-codec-opus-update */ -/* #undef ENABLE_UPDATE_DRAFT */ - -/* Debug fixed-point implementation */ -/* #undef FIXED_DEBUG */ - -/* Compile as fixed-point (for machines without a fast enough FPU) */ -#define FIXED_POINT 1 - -/* Float approximations */ -/* #undef FLOAT_APPROX */ - -/* Fuzzing */ -/* #undef FUZZING */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_ALLOCA_H */ - -/* NE10 library is installed on host. Make sure it is on target! */ -/* #undef HAVE_ARM_NE10 */ - -/* Define to 1 if you have the header file. */ -/* #undef HAVE_DLFCN_H */ -#define HAVE_DLFCN_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_INTTYPES_H 1 - -/* Define to 1 if you have the `lrint' function. */ -/* #undef HAVE_LRINT */ -#define HAVE_LRINT 1 -/* Define to 1 if you have the `lrintf' function. */ -/* #undef HAVE_LRINTF */ -#define HAVE_LRINTF 1 -/* Define to 1 if you have the header file. */ -/* #undef HAVE_MEMORY_H */ -#define HAVE_MEMORY_H 1 -/* Define to 1 if you have the header file. */ -#define HAVE_STDINT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STDLIB_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRINGS_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_STRING_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_STAT_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_SYS_TYPES_H 1 - -/* Define to 1 if you have the header file. */ -#define HAVE_UNISTD_H 1 - -/* Define to 1 if you have the `__malloc_hook' function. */ -/* #undef HAVE___MALLOC_HOOK */ - -/* Define to the sub-directory where libtool stores uninstalled libraries. */ -#define LT_OBJDIR ".libs/" - -/* Make use of ARM asm optimization */ -/* #undef OPUS_ARM_ASM */ - -/* Use generic ARMv4 inline asm optimizations */ -/* #undef OPUS_ARM_INLINE_ASM */ - -/* Use ARMv5E inline asm optimizations */ -/* #undef OPUS_ARM_INLINE_EDSP */ - -/* Use ARMv6 inline asm optimizations */ -/* #undef OPUS_ARM_INLINE_MEDIA */ - -/* Use ARM NEON inline asm optimizations */ -/* #undef OPUS_ARM_INLINE_NEON */ - -/* Define if assembler supports EDSP instructions */ -/* #undef OPUS_ARM_MAY_HAVE_EDSP */ - -/* Define if assembler supports ARMv6 media instructions */ -/* #undef OPUS_ARM_MAY_HAVE_MEDIA */ - -/* Define if compiler supports NEON instructions */ -/* #undef OPUS_ARM_MAY_HAVE_NEON */ - -/* Compiler supports ARMv7/Aarch64 Neon Intrinsics */ -/* #undef OPUS_ARM_MAY_HAVE_NEON_INTR */ - -/* Define if binary requires Aarch64 Neon Intrinsics */ -/* #undef OPUS_ARM_PRESUME_AARCH64_NEON_INTR */ - -/* Define if binary requires EDSP instruction support */ -/* #undef OPUS_ARM_PRESUME_EDSP */ - -/* Define if binary requires ARMv6 media instruction support */ -/* #undef OPUS_ARM_PRESUME_MEDIA */ - -/* Define if binary requires NEON instruction support */ -/* #undef OPUS_ARM_PRESUME_NEON */ - -/* Define if binary requires NEON intrinsics support */ -/* #undef OPUS_ARM_PRESUME_NEON_INTR */ - -/* This is a build of OPUS */ -#define OPUS_BUILD /**/ - -/* Run bit-exactness checks between optimized and c implementations */ -/* #undef OPUS_CHECK_ASM */ - -/* Use run-time CPU capabilities detection */ -/* #undef OPUS_HAVE_RTCD */ - -/* Compiler supports X86 AVX Intrinsics */ -/* #undef OPUS_X86_MAY_HAVE_AVX */ - -/* Compiler supports X86 SSE Intrinsics */ -/* #undef OPUS_X86_MAY_HAVE_SSE */ - -/* Compiler supports X86 SSE2 Intrinsics */ -/* #undef OPUS_X86_MAY_HAVE_SSE2 */ - -/* Compiler supports X86 SSE4.1 Intrinsics */ -/* #undef OPUS_X86_MAY_HAVE_SSE4_1 */ - -/* Define if binary requires AVX intrinsics support */ -/* #undef OPUS_X86_PRESUME_AVX */ - -/* Define if binary requires SSE intrinsics support */ -/* #undef OPUS_X86_PRESUME_SSE */ - -/* Define if binary requires SSE2 intrinsics support */ -/* #undef OPUS_X86_PRESUME_SSE2 */ - -/* Define if binary requires SSE4.1 intrinsics support */ -/* #undef OPUS_X86_PRESUME_SSE4_1 */ - -/* Define to the address where bug reports for this package should be sent. */ -#define PACKAGE_BUGREPORT "opus@xiph.org" - -/* Define to the full name of this package. */ -#define PACKAGE_NAME "opus" - -/* Define to the full name and version of this package. */ -#define PACKAGE_STRING "opus 1.3.1" - -/* Define to the one symbol short name of this package. */ -#define PACKAGE_TARNAME "opus" - -/* Define to the home page for this package. */ -#define PACKAGE_URL "" - -/* Define to the version of this package. */ -#define PACKAGE_VERSION "1.3.1" - -/* Define to 1 if you have the ANSI C header files. */ -#define STDC_HEADERS 1 - -/* Make use of alloca */ -/* #undef USE_ALLOCA */ - -/* Use C99 variable-size arrays */ -#define VAR_ARRAYS 1 - -/* Define to empty if `const' does not conform to ANSI C. */ -/* #undef const */ - -/* Define to `__inline__' or `__inline' if that's what the C compiler - calls it, or to nothing if 'inline' is not supported under any name. */ -#ifndef __cplusplus -/* #undef inline */ -#endif - -/* Define to the equivalent of the C99 'restrict' keyword, or to - nothing if this is not supported. Do not define if restrict is - supported directly. */ -#define restrict __restrict -/* Work around a bug in Sun C++: it does not support _Restrict or - __restrict__, even though the corresponding Sun C compiler ends up with - "#define restrict _Restrict" or "#define restrict __restrict__" in the - previous line. Perhaps some future version of Sun C++ will work with - restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ -#if defined __SUNPRO_CC && !defined __RESTRICT -#define _Restrict -#define __restrict__ -#endif diff --git a/components/opus/opus b/components/opus/opus deleted file mode 160000 index df9c4c8..0000000 --- a/components/opus/opus +++ /dev/null @@ -1 +0,0 @@ -Subproject commit df9c4c8e562b952ca14fa90ef21dff9a8dd2b3a4 From d136010d82cd2e791cd2e80bed35c48b7a0c2b85 Mon Sep 17 00:00:00 2001 From: Carlos Date: Fri, 12 Nov 2021 08:04:24 +0100 Subject: [PATCH 6/8] repair submodule --- .gitmodules | 3 + components/opus/CMakeLists.txt | 18 +++ components/opus/component.mk | 12 ++ components/opus/config.h | 208 +++++++++++++++++++++++++++++++++ components/opus/opus | 1 + 5 files changed, 242 insertions(+) create mode 100644 components/opus/CMakeLists.txt create mode 100644 components/opus/component.mk create mode 100644 components/opus/config.h create mode 160000 components/opus/opus diff --git a/.gitmodules b/.gitmodules index 9f5f81f..edb11e1 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,6 @@ [submodule "components/flac/flac"] path = components/flac/flac url = https://github.com/xiph/flac.git +[submodule "components/opus/opus"] + path = components/opus/opus + url = https://github.com/xiph/opus diff --git a/components/opus/CMakeLists.txt b/components/opus/CMakeLists.txt new file mode 100644 index 0000000..6ddb221 --- /dev/null +++ b/components/opus/CMakeLists.txt @@ -0,0 +1,18 @@ +file(GLOB srcs "opus/src/*.c") +file(GLOB silk "opus/silk/*.c") +file(GLOB celt "opus/celt/*.c") +file(GLOB fixed "opus/slik/fixed/*.c") +file(GLOB float "opus/slik/float/*.c") + + +idf_component_register(SRCS "${srcs}" "${silk}" "${celt}" "${fixed}" "${float}" + INCLUDE_DIRS . + "opus/include" + "opus/silk" + "opus/silk/fixed" + "opus/silk/float" + "opus/celt" + ) + +set_source_files_properties(opus/silk/quant_LTP_gains.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) +target_compile_definitions(${COMPONENT_TARGET} PRIVATE "-DHAVE_CONFIG_H") diff --git a/components/opus/component.mk b/components/opus/component.mk new file mode 100644 index 0000000..024e046 --- /dev/null +++ b/components/opus/component.mk @@ -0,0 +1,12 @@ +# +# Main Makefile. This is basically the same as a component makefile. +# +# This Makefile should, at the very least, just include $(SDK_PATH)/make/component_common.mk. By default, +# this will take the sources in the src/ directory, compile them and link them into +# lib(subdirectory_name).a in the build directory. This behaviour is entirely configurable, +# please read the ESP-IDF documents if you need to do this. +# + +COMPONENT_SRCDIRS := opus/src opus/silk opus/silk/fixed opus/celt +COMPONENT_ADD_INCLUDEDIRS := . opus/include opus/silk opus/silk/fixed opus/celt +CFLAGS += -DHAVE_CONFIG_H diff --git a/components/opus/config.h b/components/opus/config.h new file mode 100644 index 0000000..03f3999 --- /dev/null +++ b/components/opus/config.h @@ -0,0 +1,208 @@ +/* config.h. Generated from config.h.in by configure. */ +/* config.h.in. Generated from configure.ac by autoheader. */ + +/* Get CPU Info by asm method */ +/* #undef CPU_INFO_BY_ASM */ + +/* Get CPU Info by c method */ +/* #undef CPU_INFO_BY_C */ + +/* Custom modes */ +/* #undef CUSTOM_MODES */ + +/* Do not build the float API */ +//#define DISABLE_FLOAT_API 1 + +/* Assertions */ +/* #undef ENABLE_ASSERTIONS */ + +/* Ambisonics Support */ +/* #undef ENABLE_EXPERIMENTAL_AMBISONICS */ + +/* Enable bitstream changes from draft-ietf-codec-opus-update */ +/* #undef ENABLE_UPDATE_DRAFT */ + +/* Debug fixed-point implementation */ +/* #undef FIXED_DEBUG */ + +/* Compile as fixed-point (for machines without a fast enough FPU) */ +#define FIXED_POINT 1 + +/* Float approximations */ +/* #undef FLOAT_APPROX */ + +/* Fuzzing */ +/* #undef FUZZING */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_ALLOCA_H */ + +/* NE10 library is installed on host. Make sure it is on target! */ +/* #undef HAVE_ARM_NE10 */ + +/* Define to 1 if you have the header file. */ +/* #undef HAVE_DLFCN_H */ +#define HAVE_DLFCN_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_INTTYPES_H 1 + +/* Define to 1 if you have the `lrint' function. */ +/* #undef HAVE_LRINT */ +#define HAVE_LRINT 1 +/* Define to 1 if you have the `lrintf' function. */ +/* #undef HAVE_LRINTF */ +#define HAVE_LRINTF 1 +/* Define to 1 if you have the header file. */ +/* #undef HAVE_MEMORY_H */ +#define HAVE_MEMORY_H 1 +/* Define to 1 if you have the header file. */ +#define HAVE_STDINT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STDLIB_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRINGS_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_STRING_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_STAT_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_SYS_TYPES_H 1 + +/* Define to 1 if you have the header file. */ +#define HAVE_UNISTD_H 1 + +/* Define to 1 if you have the `__malloc_hook' function. */ +/* #undef HAVE___MALLOC_HOOK */ + +/* Define to the sub-directory where libtool stores uninstalled libraries. */ +#define LT_OBJDIR ".libs/" + +/* Make use of ARM asm optimization */ +/* #undef OPUS_ARM_ASM */ + +/* Use generic ARMv4 inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_ASM */ + +/* Use ARMv5E inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_EDSP */ + +/* Use ARMv6 inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_MEDIA */ + +/* Use ARM NEON inline asm optimizations */ +/* #undef OPUS_ARM_INLINE_NEON */ + +/* Define if assembler supports EDSP instructions */ +/* #undef OPUS_ARM_MAY_HAVE_EDSP */ + +/* Define if assembler supports ARMv6 media instructions */ +/* #undef OPUS_ARM_MAY_HAVE_MEDIA */ + +/* Define if compiler supports NEON instructions */ +/* #undef OPUS_ARM_MAY_HAVE_NEON */ + +/* Compiler supports ARMv7/Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_MAY_HAVE_NEON_INTR */ + +/* Define if binary requires Aarch64 Neon Intrinsics */ +/* #undef OPUS_ARM_PRESUME_AARCH64_NEON_INTR */ + +/* Define if binary requires EDSP instruction support */ +/* #undef OPUS_ARM_PRESUME_EDSP */ + +/* Define if binary requires ARMv6 media instruction support */ +/* #undef OPUS_ARM_PRESUME_MEDIA */ + +/* Define if binary requires NEON instruction support */ +/* #undef OPUS_ARM_PRESUME_NEON */ + +/* Define if binary requires NEON intrinsics support */ +/* #undef OPUS_ARM_PRESUME_NEON_INTR */ + +/* This is a build of OPUS */ +#define OPUS_BUILD /**/ + +/* Run bit-exactness checks between optimized and c implementations */ +/* #undef OPUS_CHECK_ASM */ + +/* Use run-time CPU capabilities detection */ +/* #undef OPUS_HAVE_RTCD */ + +/* Compiler supports X86 AVX Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_AVX */ + +/* Compiler supports X86 SSE Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_SSE */ + +/* Compiler supports X86 SSE2 Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_SSE2 */ + +/* Compiler supports X86 SSE4.1 Intrinsics */ +/* #undef OPUS_X86_MAY_HAVE_SSE4_1 */ + +/* Define if binary requires AVX intrinsics support */ +/* #undef OPUS_X86_PRESUME_AVX */ + +/* Define if binary requires SSE intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE */ + +/* Define if binary requires SSE2 intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE2 */ + +/* Define if binary requires SSE4.1 intrinsics support */ +/* #undef OPUS_X86_PRESUME_SSE4_1 */ + +/* Define to the address where bug reports for this package should be sent. */ +#define PACKAGE_BUGREPORT "opus@xiph.org" + +/* Define to the full name of this package. */ +#define PACKAGE_NAME "opus" + +/* Define to the full name and version of this package. */ +#define PACKAGE_STRING "opus 1.3.1" + +/* Define to the one symbol short name of this package. */ +#define PACKAGE_TARNAME "opus" + +/* Define to the home page for this package. */ +#define PACKAGE_URL "" + +/* Define to the version of this package. */ +#define PACKAGE_VERSION "1.3.1" + +/* Define to 1 if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +/* Make use of alloca */ +/* #undef USE_ALLOCA */ + +/* Use C99 variable-size arrays */ +#define VAR_ARRAYS 1 + +/* Define to empty if `const' does not conform to ANSI C. */ +/* #undef const */ + +/* Define to `__inline__' or `__inline' if that's what the C compiler + calls it, or to nothing if 'inline' is not supported under any name. */ +#ifndef __cplusplus +/* #undef inline */ +#endif + +/* Define to the equivalent of the C99 'restrict' keyword, or to + nothing if this is not supported. Do not define if restrict is + supported directly. */ +#define restrict __restrict +/* Work around a bug in Sun C++: it does not support _Restrict or + __restrict__, even though the corresponding Sun C compiler ends up with + "#define restrict _Restrict" or "#define restrict __restrict__" in the + previous line. Perhaps some future version of Sun C++ will work with + restrict; if so, hopefully it defines __RESTRICT like Sun C does. */ +#if defined __SUNPRO_CC && !defined __RESTRICT +#define _Restrict +#define __restrict__ +#endif diff --git a/components/opus/opus b/components/opus/opus new file mode 160000 index 0000000..a8e6a77 --- /dev/null +++ b/components/opus/opus @@ -0,0 +1 @@ +Subproject commit a8e6a77c5fe0c37aa6788f939f24f8cd22ae2652 From 01805ee8e3c5db929e240b273e9c554ebc6fa5b9 Mon Sep 17 00:00:00 2001 From: CarlosDerSeher Date: Thu, 18 Nov 2021 07:25:56 +0100 Subject: [PATCH 7/8] Update CMakeLists.txt - remove OGG entrys in flac's CmakeList - remove windwos sources from flac's CmakeList --- components/flac/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/components/flac/CMakeLists.txt b/components/flac/CMakeLists.txt index 27d4583..0e609d3 100644 --- a/components/flac/CMakeLists.txt +++ b/components/flac/CMakeLists.txt @@ -5,6 +5,8 @@ cmake_minimum_required(VERSION 3.5) file(GLOB srcs "flac/src/libFLAC/*.c") +list(FILTER srcs EXCLUDE REGEX ".*ogg.*\\.c$") +list(FILTER srcs EXCLUDE REGEX "windows_unicode_filenames\\.c$") #project(FLAC VERSION 1.3.3) # HOMEPAGE_URL "https://www.xiph.org/flac/") set(VERSION "1.3.3") @@ -12,8 +14,8 @@ set(PACKAGE_VERSION "1.3.3") idf_component_register(SRCS "${srcs}" INCLUDE_DIRS . - "flac/include" - PRIV_INCLUDE_DIRS "flac/src/libFLAC/include/" + "flac/include" + PRIV_INCLUDE_DIRS "flac/src/libFLAC/include/" ) #set_source_files_properties(opus/silk/quant_LTP_gains.c PROPERTIES COMPILE_FLAGS -Wno-maybe-uninitialized) From 37a1de504451734ddf286edd27bda00f87135d90 Mon Sep 17 00:00:00 2001 From: CarlosDerSeher Date: Thu, 3 Mar 2022 21:43:43 +0100 Subject: [PATCH 8/8] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1d8d51f..d7a5147 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ ### Synchronous Multiroom audio streaming client for [Snapcast](https://github.com/badaix/snapcast) ported to ESP32 +Note: master branch is currently broken, please switch to NETCONN. + ## Feature list - Opus, FLAC and PCM decoding currently supported - Wifi setup from menuconfig or through espressif Android App "SoftAP Prov"