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

View File

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

View File

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

View File

@@ -8,7 +8,13 @@
*/
#include <stdio.h>
#include <string.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_event.h"
#include "esp_log.h"
@@ -16,10 +22,7 @@
#include "freertos/FreeRTOS.h"
#include "freertos/event_groups.h"
#include "freertos/task.h"
#include "sdkconfig.h"
#if CONFIG_ETH_USE_SPI_ETHERNET
#include "driver/spi_master.h"
#endif // CONFIG_ETH_USE_SPI_ETHERNET
// #include "sdkconfig.h"
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,
snapcastSetting_t *setting) {
#if USE_SAMPLE_INSERTION
const int __dmaBufMaxLen = 1023;
i2sDmaBufCnt = 22;
i2sDmaBufMaxLen =
100; // OPUS has a minimum frame size of 120
// with DMA buffer set to this value sync algorithm
// works for all decoders. We set it to 100 so
// there will be free space for sample stuffing in each round
// OPUS has a minimum frame size of 120
// with DMA buffer set to this value sync algorithm
// works for all decoders. We set it to 100 so
// there will be free space for sample stuffing in each round
i2sDmaBufMaxLen = 100;
#else
int fi2s_clk;
@@ -232,13 +230,13 @@ static esp_err_t player_setup_i2s(i2s_port_t i2sNum,
}
i2s_std_clk_config_t i2s_clkcfg = {
.sample_rate_hz = sr,
.sample_rate_hz = sr,
#if CONFIG_USE_SAMPLE_INSERTION
.clk_src = I2S_CLK_SRC_DEFAULT,
.clk_src = I2S_CLK_SRC_DEFAULT,
#else
.clk_src = I2S_CLK_SRC_APLL,
.clk_src = I2S_CLK_SRC_APLL,
#endif
.mclk_multiple = I2S_MCLK_MULTIPLE_256,
.mclk_multiple = I2S_MCLK_MULTIPLE_256,
};
i2s_std_config_t tx_std_cfg = {
.clk_cfg = i2s_clkcfg,