fix bug in http_task which results in a reboot if flac can't allocate out memory

Signed-off-by: Karl Osterseher <karli_o@gmx.at>
This commit is contained in:
Karl Osterseher
2025-01-18 09:30:46 +01:00
Unverified
parent 4e73d36037
commit d9afc3038b
10 changed files with 54 additions and 4041 deletions

9
.clang-format Normal file
View File

@@ -0,0 +1,9 @@
# We'll use defaults from the LLVM style, but with some modifications so that it's close to the CDT K&R style.
BasedOnStyle: LLVM
UseTab: Always
IndentWidth: 4
TabWidth: 4
PackConstructorInitializers: NextLineOnly
BreakConstructorInitializers: AfterColon
IndentAccessModifiers: false
AccessModifierOffset: -4

3
.clangd Normal file
View File

@@ -0,0 +1,3 @@
CompileFlags:
CompilationDatabase: build
Remove: [-m*, -f*]

4007
.project

File diff suppressed because it is too large Load Diff

View File

@@ -1,11 +1,7 @@
if(CONFIG_SNAPCLIENT_ENABLE_ETHERNET) if(CONFIG_SNAPCLIENT_ENABLE_ETHERNET)
idf_component_register(SRCS "eth_interface.c" idf_component_register(SRCS "eth_interface.c"
INCLUDE_DIRS "include") INCLUDE_DIRS "include"
PRIV_REQUIRES driver esp_eth esp_netif)
else() else()
idf_component_register() idf_component_register()
endif() endif()

View File

@@ -1 +0,0 @@
COMPONENT_SRCDIRS := .

View File

@@ -8,7 +8,13 @@
*/ */
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include "driver/gpio.h" #include "driver/gpio.h"
#if CONFIG_ETH_USE_SPI_ETHERNET
#include "driver/spi_master.h"
#endif // CONFIG_ETH_USE_SPI_ETHERNET
#include "esp_eth.h" #include "esp_eth.h"
#include "esp_event.h" #include "esp_event.h"
#include "esp_log.h" #include "esp_log.h"
@@ -16,10 +22,7 @@
#include "freertos/FreeRTOS.h" #include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h" #include "freertos/event_groups.h"
#include "freertos/task.h" #include "freertos/task.h"
#include "sdkconfig.h" // #include "sdkconfig.h"
#if CONFIG_ETH_USE_SPI_ETHERNET
#include "driver/spi_master.h"
#endif // CONFIG_ETH_USE_SPI_ETHERNET
static const char *TAG = "ETH"; static const char *TAG = "ETH";

View File

@@ -136,14 +136,12 @@ esp_err_t my_i2s_channel_enable(i2s_chan_handle_t handle) {
static esp_err_t player_setup_i2s(i2s_port_t i2sNum, static esp_err_t player_setup_i2s(i2s_port_t i2sNum,
snapcastSetting_t *setting) { snapcastSetting_t *setting) {
#if USE_SAMPLE_INSERTION #if USE_SAMPLE_INSERTION
const int __dmaBufMaxLen = 1023;
i2sDmaBufCnt = 22; i2sDmaBufCnt = 22;
i2sDmaBufMaxLen = // OPUS has a minimum frame size of 120
100; // OPUS has a minimum frame size of 120
// with DMA buffer set to this value sync algorithm // with DMA buffer set to this value sync algorithm
// works for all decoders. We set it to 100 so // works for all decoders. We set it to 100 so
// there will be free space for sample stuffing in each round // there will be free space for sample stuffing in each round
i2sDmaBufMaxLen = 100;
#else #else
int fi2s_clk; int fi2s_clk;

View File

@@ -1,21 +1,32 @@
dependencies: dependencies:
espressif/esp-dsp: espressif/esp-dsp:
component_hash: 3e7bbd487f1357a1d4944d0c85966d049501ea281b8a4c7f93f7cfedd5b7f23d component_hash: fa7fe74305df6da25867437ebcd4213e047cbfc0556cf92067ab657fce537c6e
dependencies:
- name: idf
require: private
version: '>=4.2'
source: source:
service_url: https://api.components.espressif.com/ registry_url: https://components.espressif.com/
type: service type: service
version: 1.4.12 version: 1.5.2
espressif/mdns: espressif/mdns:
component_hash: ed10ef031bce505e423c5dbf0fdf2ce7a02df5f9ebffb18df2d6b9852e48817d component_hash: d36b265164be5139f92de993f08f5ecaa0de0c0acbf84deee1f10bb5902d04ff
dependencies:
- name: idf
require: private
version: '>=5.0'
source: source:
service_url: https://api.components.espressif.com/ registry_url: https://components.espressif.com/
type: service type: service
version: 1.3.1 version: 1.4.3
idf: idf:
component_hash: null
source: source:
type: idf type: idf
version: 5.1.1 version: 5.1.5
manifest_hash: d6b434b4ae9e215619e0dfb1b731739d5799f7570a1fdee428100c9146c752e2 direct_dependencies:
- espressif/esp-dsp
- espressif/mdns
- idf
manifest_hash: 01df6f188570b9e5362f7a00a294b1d3403de1f5ce8cbd848004d3bc88aa09a8
target: esp32 target: esp32
version: 1.0.0 version: 2.0.0

View File

@@ -1,5 +1,5 @@
idf_component_register(SRCS "main.c" idf_component_register(SRCS "main.c"
INCLUDE_DIRS "." INCLUDE_DIRS "."
PRIV_REQUIRES esp_timer esp_wifi nvs_flash wifi_interface audio_board audio_hal audio_sal net_functions opus flac ota_server PRIV_REQUIRES esp_timer esp_wifi nvs_flash wifi_interface audio_board audio_hal audio_sal net_functions opus flac ota_server
ui_http_server ui_http_server eth_interface
) )

View File

@@ -1333,7 +1333,8 @@ static void http_get_task(void *pvParameters) {
"failed", "failed",
__func__); __func__);
return; // TODO: should insert some abort condition?
vTaskDelay(pdMS_TO_TICKS(10));
} }
} }