add OggFlac & disable AMPDU

This commit is contained in:
Philippe G
2020-05-21 16:57:36 -07:00
parent 4467081169
commit 899ea8b9e8
13 changed files with 61 additions and 38 deletions

View File

@@ -322,11 +322,11 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=n
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=n
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=16
CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set

View File

@@ -325,11 +325,11 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=n
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=n
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=16
CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set

View File

@@ -336,11 +336,11 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=n
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=n
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=16
CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set

View File

@@ -343,11 +343,10 @@ CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=40
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0 CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12 CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=12
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=n
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=n
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=16
CONFIG_ESP32_WIFI_NVS_ENABLED=y CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_0=y
# CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set # CONFIG_ESP32_WIFI_TASK_PINNED_TO_CORE_1 is not set

View File

@@ -1,10 +1,10 @@
idf_component_register(SRC_DIRS . idf_component_register(SRC_DIRS .
INCLUDE_DIRS . ./inc inc/alac inc/faad2 inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis INCLUDE_DIRS . ./inc inc/alac inc/FLAC inc/helix-aac inc/mad inc/ogg inc/opus inc/opusfile inc/resample16 inc/soxr inc/vorbis
PRIV_REQUIRES newlib PRIV_REQUIRES newlib
) )
add_prebuilt_library(libmad lib/libmad.a) add_prebuilt_library(libmad lib/libmad.a)
add_prebuilt_library(libesp-flac lib/libesp-flac.a ) add_prebuilt_library(libFLAC lib/libFLAC.a )
add_prebuilt_library(libhelix-aac lib/libhelix-aac.a ) add_prebuilt_library(libhelix-aac lib/libhelix-aac.a )
add_prebuilt_library(libvorbisidec lib/libvorbisidec.a ) add_prebuilt_library(libvorbisidec lib/libvorbisidec.a )
add_prebuilt_library(libogg lib/libogg.a ) add_prebuilt_library(libogg lib/libogg.a )
@@ -14,7 +14,7 @@ add_prebuilt_library(libsoxr lib/libsoxr.a )
add_prebuilt_library(libopusfile lib/libopusfile.a ) add_prebuilt_library(libopusfile lib/libopusfile.a )
add_prebuilt_library(libopus lib/libopus.a ) add_prebuilt_library(libopus lib/libopus.a )
target_link_libraries(${COMPONENT_LIB} PRIVATE libmad) target_link_libraries(${COMPONENT_LIB} PRIVATE libmad)
target_link_libraries(${COMPONENT_LIB} PRIVATE libesp-flac) target_link_libraries(${COMPONENT_LIB} PRIVATE libFLAC)
target_link_libraries(${COMPONENT_LIB} PRIVATE libhelix-aac) target_link_libraries(${COMPONENT_LIB} PRIVATE libhelix-aac)
target_link_libraries(${COMPONENT_LIB} PRIVATE libvorbisidec) target_link_libraries(${COMPONENT_LIB} PRIVATE libvorbisidec)

View File

@@ -4,23 +4,21 @@
# (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.)
COMPONENT_ADD_LDFLAGS=-l$(COMPONENT_NAME) \ COMPONENT_ADD_LDFLAGS=-l$(COMPONENT_NAME) \
$(COMPONENT_PATH)/lib/libmad.a \ $(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/libhelix-aac.a \
$(COMPONENT_PATH)/lib/libvorbisidec.a \ $(COMPONENT_PATH)/lib/libvorbisidec.a \
$(COMPONENT_PATH)/lib/libogg.a \ $(COMPONENT_PATH)/lib/libogg.a \
$(COMPONENT_PATH)/lib/libalac.a \ $(COMPONENT_PATH)/lib/libalac.a \
$(COMPONENT_PATH)/lib/libresample16.a \ $(COMPONENT_PATH)/lib/libresample16.a \
$(COMPONENT_PATH)/lib/libsoxr.a \
$(COMPONENT_PATH)/lib/libopusfile.a \ $(COMPONENT_PATH)/lib/libopusfile.a \
$(COMPONENT_PATH)/lib/libopus.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/libfaad.a
#$(COMPONENT_PATH)/lib/libvorbisidec.a #$(COMPONENT_PATH)/lib/libvorbisidec.a
#$(COMPONENT_PATH)/lib/libesp-opus.a #$(COMPONENT_PATH)/lib/libesp-opus.a
#$(COMPONENT_PATH)/lib/libogg.a #$(COMPONENT_PATH)/lib/libogg.a
#$(COMPONENT_PATH)/lib/libesp-tremor.a #$(COMPONENT_PATH)/lib/libesp-tremor.a
#$(COMPONENT_PATH)/lib/libesp-ogg-container.a #$(COMPONENT_PATH)/lib/libesp-ogg-container.a
COMPONENT_ADD_INCLUDEDIRS := /inc

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -36,6 +36,7 @@
struct flac { struct flac {
FLAC__StreamDecoder *decoder; FLAC__StreamDecoder *decoder;
u8_t container;
#if !LINKALL #if !LINKALL
// FLAC symbols to be dynamically loaded // FLAC symbols to be dynamically loaded
const char **FLAC__StreamDecoderErrorStatusString; const char **FLAC__StreamDecoderErrorStatusString;
@@ -55,6 +56,18 @@ struct flac {
FLAC__StreamDecoderErrorCallback error_callback, FLAC__StreamDecoderErrorCallback error_callback,
void *client_data 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__bool (* FLAC__stream_decoder_process_single)(FLAC__StreamDecoder *decoder);
FLAC__StreamDecoderState (* FLAC__stream_decoder_get_state)(const FLAC__StreamDecoder *decoder); FLAC__StreamDecoderState (* FLAC__stream_decoder_get_state)(const FLAC__StreamDecoder *decoder);
#endif #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]); 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) { 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) { if (f->decoder) {
FLAC(f, stream_decoder_reset, f->decoder); FLAC(f, stream_decoder_reset, f->decoder);
} else { } else {
f->decoder = FLAC(f, stream_decoder_new); 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);
} if ( f->container == 'o' ) {
LOG_DEBUG("ogg/flac container - using init_ogg_stream");
static void flac_close(void) { FLAC(f, stream_decoder_init_ogg_stream, f->decoder, &read_cb, NULL, NULL, NULL, NULL, &write_cb, NULL, &error_cb, NULL);
FLAC(f, stream_decoder_delete, f->decoder); } else {
f->decoder = NULL; 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) { 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_reset = dlsym(handle, "FLAC__stream_decoder_reset");
f->FLAC__stream_decoder_delete = dlsym(handle, "FLAC__stream_decoder_delete"); 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_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_process_single = dlsym(handle, "FLAC__stream_decoder_process_single");
f->FLAC__stream_decoder_get_state = dlsym(handle, "FLAC__stream_decoder_get_state"); 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) { struct codec *register_flac(void) {
static struct codec ret = { static struct codec ret = {
'f', // id 'f', // id
"flc", // types "ogf,flc", // types
16384, // min read 16384, // min read
204800, // min space 204800, // min space
flac_open, // open flac_open, // open
@@ -303,6 +329,6 @@ struct codec *register_flac(void) {
return NULL; return NULL;
} }
LOG_INFO("using flac to decode flc"); LOG_INFO("using flac to decode ogf,flc");
return &ret; return &ret;
} }