mirror of
https://github.com/sle118/squeezelite-esp32.git
synced 2026-04-11 13:37:41 +03:00
chore: checkpoint current IDF 5.5 remediation state
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# for the forgetful, REQUIRES cannot use CONFIG_XXX due to parsing order
|
||||
if(IDF_TARGET STREQUAL "esp32")
|
||||
set(target_requires "driver_bt" "platform_config")
|
||||
if(IDF_VERSION_MAJOR EQUAL 4 AND IDF_VERSION_MINOR LESS 4)
|
||||
list(APPEND target_requires "_override")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
idf_component_register( SRC_DIRS . external ac101 tas57xx wm8978 cs4265
|
||||
@@ -16,11 +19,10 @@ idf_component_register( SRC_DIRS . external ac101 tas57xx wm8978 cs4265
|
||||
spotify
|
||||
raop
|
||||
display
|
||||
audio
|
||||
led_strip
|
||||
_override
|
||||
${target_requires}
|
||||
EMBED_FILES vu_s.data arrow.data
|
||||
audio
|
||||
led_strip
|
||||
${target_requires}
|
||||
EMBED_FILES vu_s.data arrow.data
|
||||
)
|
||||
|
||||
set_source_files_properties(mad.c pcm.c flac.c alac.c helix-aac.c vorbis.c opus.c
|
||||
|
||||
@@ -79,7 +79,7 @@ esp_err_t adac_write_byte(int i2c_addr,uint8_t reg, uint8_t val) {
|
||||
i2c_master_write_byte(cmd, val, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
@@ -106,7 +106,7 @@ uint8_t adac_read_byte(int i2c_addr, uint8_t reg) {
|
||||
i2c_master_read_byte(cmd, &data, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
@@ -133,7 +133,7 @@ uint16_t adac_read_word(int i2c_addr, uint8_t reg) {
|
||||
i2c_master_read(cmd, data, 2, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
@@ -156,7 +156,7 @@ esp_err_t adac_write_word(int i2c_addr, uint8_t reg, uint16_t val) {
|
||||
i2c_master_write(cmd, data, 4, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 100 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
@@ -178,7 +178,7 @@ esp_err_t adac_write(int i2c_addr, uint8_t reg, uint8_t *data, size_t count) {
|
||||
i2c_master_write(cmd, data, count, I2C_MASTER_NACK);
|
||||
|
||||
i2c_master_stop(cmd);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 200 / portTICK_RATE_MS);
|
||||
esp_err_t ret = i2c_master_cmd_begin(i2c_port, cmd, 200 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(cmd);
|
||||
|
||||
if (ret != ESP_OK) {
|
||||
|
||||
@@ -260,8 +260,10 @@ static int read_mp4_header(void) {
|
||||
}
|
||||
if (!memcmp(ptr + 4, "data", 4) && remain > 16 + 48) {
|
||||
// data is stored as hex strings: 0 start end samples
|
||||
u32_t b, c; u64_t d;
|
||||
if (sscanf((const char *)(ptr + 16), "%x %x %x " FMT_x64, &b, &b, &c, &d) == 4) {
|
||||
unsigned b_tmp, c_tmp;
|
||||
u64_t d;
|
||||
if (sscanf((const char *)(ptr + 16), "%x %x %x " FMT_x64, &b_tmp, &b_tmp, &c_tmp, &d) == 4) {
|
||||
u32_t b = b_tmp, c = c_tmp;
|
||||
LOG_DEBUG("iTunSMPB start: %u end: %u samples: " FMT_u64, b, c, d);
|
||||
if (l->sttssamples && l->sttssamples < b + c + d) {
|
||||
LOG_DEBUG("reducing samples as stts count is less");
|
||||
@@ -317,7 +319,8 @@ static decode_state alac_decode(void) {
|
||||
size_t bytes;
|
||||
bool endstream;
|
||||
u8_t *iptr;
|
||||
u32_t frames, block_size;
|
||||
unsigned frames;
|
||||
u32_t block_size;
|
||||
|
||||
LOCK_S;
|
||||
|
||||
|
||||
@@ -403,7 +403,7 @@ static bool init(sys_dac_config * config, i2s_config_t* i2s_config, bool* mck) {
|
||||
}
|
||||
|
||||
i2c_master_stop(i2c_cmd);
|
||||
esp_err_t res = i2c_master_cmd_begin(cs4265.port, i2c_cmd, 500 / portTICK_RATE_MS);
|
||||
esp_err_t res = i2c_master_cmd_begin(cs4265.port, i2c_cmd, 500 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(i2c_cmd);
|
||||
if (res != ESP_OK) {
|
||||
ESP_LOGE(TAG, "could not intialize cs4265 %d", res);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
|
||||
#include "squeezelite.h"
|
||||
|
||||
log_level loglevel;
|
||||
extern log_level loglevel;
|
||||
|
||||
extern struct buffer *streambuf;
|
||||
extern struct buffer *outputbuf;
|
||||
@@ -316,4 +316,3 @@ void codec_open(u8_t format, u8_t sample_size, u8_t sample_rate, u8_t channels,
|
||||
|
||||
LOG_ERROR("codec not found");
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ static bool bt_sink_cmd_handler(bt_sink_cmd_t cmd, va_list args) {
|
||||
* raop sink data handler
|
||||
*/
|
||||
#if CONFIG_AIRPLAY_SINK
|
||||
static void raop_sink_data_handler(const uint8_t* data, uint32_t len, u32_t playtime) {
|
||||
static void raop_sink_data_handler(const uint8_t* data, size_t len, u32_t playtime) {
|
||||
|
||||
raop_sync.playtime = playtime;
|
||||
raop_sync.len = len;
|
||||
@@ -363,7 +363,7 @@ static bool raop_sink_cmd_handler(raop_event_t event, va_list args) {
|
||||
* cspot sink data handler
|
||||
*/
|
||||
#if CONFIG_CSPOT_SINK
|
||||
static uint32_t cspot_sink_data_handler(const uint8_t* data, uint32_t len) {
|
||||
static uint32_t cspot_sink_data_handler(const uint8_t* data, size_t len) {
|
||||
return sink_data_handler(data, len, 0);
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "squeezelite.h"
|
||||
#include "pthread.h"
|
||||
#include "esp_pthread.h"
|
||||
#include "esp_mac.h"
|
||||
#include "esp_system.h"
|
||||
#include "esp_timer.h"
|
||||
#include "esp_wifi.h"
|
||||
|
||||
@@ -100,8 +100,8 @@ void output_visu_init(log_level level);
|
||||
void output_visu_close(void);
|
||||
|
||||
// optional, please chain if used
|
||||
bool (*slimp_handler)(u8_t *data, int len);
|
||||
void (*slimp_loop)(void);
|
||||
void (*server_notify)(in_addr_t ip, u16_t hport, u16_t cport);
|
||||
extern bool (*slimp_handler)(u8_t *data, int len);
|
||||
extern void (*slimp_loop)(void);
|
||||
extern void (*server_notify)(in_addr_t ip, u16_t hport, u16_t cport);
|
||||
|
||||
#endif // EMBEDDED_H
|
||||
|
||||
@@ -292,8 +292,10 @@ static int read_mp4_header(unsigned long *samplerate_p, unsigned char *channels_
|
||||
}
|
||||
if (!memcmp(ptr + 4, "data", 4) && remain > 16 + 48) {
|
||||
// data is stored as hex strings: 0 start end samples
|
||||
u32_t b, c; u64_t d;
|
||||
if (sscanf((const char *)(ptr + 16), "%x %x %x " FMT_x64, &b, &b, &c, &d) == 4) {
|
||||
unsigned b_tmp, c_tmp;
|
||||
u64_t d;
|
||||
if (sscanf((const char *)(ptr + 16), "%x %x %x " FMT_x64, &b_tmp, &b_tmp, &c_tmp, &d) == 4) {
|
||||
u32_t b = b_tmp, c = c_tmp;
|
||||
LOG_DEBUG("iTunSMPB start: %u end: %u samples: " FMT_u64, b, c, d);
|
||||
if (a->sttssamples && a->sttssamples < b + c + d) {
|
||||
LOG_DEBUG("reducing samples as stts count is less");
|
||||
|
||||
@@ -215,8 +215,8 @@ static decode_state mad_decode(void) {
|
||||
|
||||
while (true) {
|
||||
size_t frames;
|
||||
s32_t *iptrl;
|
||||
s32_t *iptrr;
|
||||
mad_fixed_t *iptrl;
|
||||
mad_fixed_t *iptrr;
|
||||
unsigned max_frames;
|
||||
|
||||
if (MAD(m, frame_decode, &m->frame, &m->stream) == -1) {
|
||||
@@ -417,4 +417,3 @@ struct codec *register_mad(void) {
|
||||
LOG_INFO("using mad to decode mp3");
|
||||
return &ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ sure that using rate_delay would fix that
|
||||
#include "driver/i2c.h"
|
||||
#include "driver/i2s.h"
|
||||
#include "equalizer.h"
|
||||
#include "esp_rom_gpio.h"
|
||||
#include "esp_pthread.h"
|
||||
#include "globdefs.h"
|
||||
#include "gpio_exp.h"
|
||||
@@ -367,7 +368,7 @@ void output_init_i2s() {
|
||||
res |= i2s_set_pin(CONFIG_I2S_NUM, &i2s_dac_pin);
|
||||
|
||||
if (res == ESP_OK && mute_control.gpio >= 0) {
|
||||
gpio_pad_select_gpio(mute_control.gpio);
|
||||
esp_rom_gpio_pad_select_gpio(mute_control.gpio);
|
||||
gpio_set_direction(mute_control.gpio, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(mute_control.gpio, mute_control.active);
|
||||
}
|
||||
@@ -384,7 +385,7 @@ void output_init_i2s() {
|
||||
|
||||
// turn off GPIO than is not used (SPDIF of DAC DO when shared)
|
||||
if (silent_do >= 0) {
|
||||
gpio_pad_select_gpio(silent_do);
|
||||
esp_rom_gpio_pad_select_gpio(silent_do);
|
||||
gpio_set_direction(silent_do, GPIO_MODE_OUTPUT);
|
||||
gpio_set_level(silent_do, 0);
|
||||
}
|
||||
|
||||
@@ -46,6 +46,9 @@ static in_addr_t slimproto_ip = 0;
|
||||
static u16_t slimproto_hport = 9000;
|
||||
static u16_t slimproto_cport = 9090;
|
||||
static u8_t player_id;
|
||||
bool (*slimp_handler)(u8_t *data, int len) = NULL;
|
||||
void (*slimp_loop)(void) = NULL;
|
||||
void (*server_notify)(in_addr_t ip, u16_t hport, u16_t cport) = NULL;
|
||||
|
||||
extern struct buffer *streambuf;
|
||||
extern struct buffer *outputbuf;
|
||||
|
||||
@@ -93,7 +93,7 @@ static bool init(sys_dac_config *config, i2s_config_t *i2s_config, bool *mck) {
|
||||
}
|
||||
|
||||
i2c_master_stop(i2c_cmd);
|
||||
esp_err_t res = i2c_master_cmd_begin(config->i2c.port-sys_i2c_port_PORT0, i2c_cmd, 500 / portTICK_RATE_MS);
|
||||
esp_err_t res = i2c_master_cmd_begin(config->i2c.port-sys_i2c_port_PORT0, i2c_cmd, 500 / portTICK_PERIOD_MS);
|
||||
i2c_cmd_link_delete(i2c_cmd);
|
||||
|
||||
if (res != ESP_OK) {
|
||||
|
||||
Reference in New Issue
Block a user