- remove bug in i2s driver resulting in overwriting DMA descriptor while initialization leading to wrong initial sync
- change some function return values from int8_t to int32_t - improve syncing o try to mimic original algorithm used by badaix - latency_buffer_full() call in player sporadically returns negative value which led to a unnecessary vTaskDelay --> resolved - use esp_timer_get_time() instead of gettimeofday() for timestamping - enable IRAM optimazations for WIFI - decrease WIFI RX buffers Signed-off-by: Karl Osterseher <karli_o@gmx.at>
This commit is contained in:
@@ -338,37 +338,35 @@ esp_err_t i2s_custom_init_dma_tx_queues(i2s_port_t i2s_num, uint8_t *data,
|
||||
memcpy(buf, &data[offset], maxDmaBufBytes);
|
||||
offset += maxDmaBufBytes;
|
||||
|
||||
// ESP_LOGW(I2S_TAG, "wrote %d",
|
||||
// maxDmaBufBytes);
|
||||
// ESP_LOGW(I2S_TAG, "wrote %d to desc[%d]", maxDmaBufBytes, i);
|
||||
|
||||
tmpSize -= maxDmaBufBytes;
|
||||
} else {
|
||||
memcpy(buf, &data[offset], tmpSize);
|
||||
offset += tmpSize;
|
||||
|
||||
// ESP_LOGW(I2S_TAG, "wrote %d",
|
||||
// tmpSize);
|
||||
// ESP_LOGW(I2S_TAG, "wrote %d to desc[%d]", tmpSize, i);
|
||||
|
||||
tmpSize = 0;
|
||||
}
|
||||
|
||||
if (tmpSize == 0) {
|
||||
if (currentDescriptor) {
|
||||
*currentDescriptor = i;
|
||||
}
|
||||
|
||||
if (currentDescriptorOffset) {
|
||||
if (offset == size) {
|
||||
*currentDescriptorOffset = 0;
|
||||
} else {
|
||||
*currentDescriptorOffset = offset;
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (currentDescriptor) {
|
||||
*currentDescriptor = i + 1;
|
||||
}
|
||||
|
||||
if (currentDescriptorOffset) {
|
||||
if (offset == size) {
|
||||
*currentDescriptorOffset = 0;
|
||||
} else {
|
||||
*currentDescriptorOffset = offset;
|
||||
}
|
||||
}
|
||||
|
||||
*written = offset;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,8 +61,8 @@ int64_t MEDIANFILTER_Insert(sMedianFilter_t *medianFilter, int64_t sample) {
|
||||
}
|
||||
|
||||
if ((medianFilter->ageHead == medianFilter->medianHead) ||
|
||||
(medianFilter->ageHead->value >
|
||||
medianFilter->medianHead->value)) { // prepare for median correction
|
||||
(medianFilter->ageHead->value > medianFilter->medianHead->value)) {
|
||||
// prepare for median correction
|
||||
medianFilter->medianHead = medianFilter->medianHead->prevValue;
|
||||
}
|
||||
|
||||
@@ -111,10 +111,10 @@ int64_t MEDIANFILTER_Insert(sMedianFilter_t *medianFilter, int64_t sample) {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
uint8_t MEDIANFILTER_isFull(sMedianFilter_t *medianFilter) {
|
||||
if (medianFilter->bufferCnt < medianFilter->numNodes) {
|
||||
return 0;
|
||||
} else {
|
||||
uint32_t MEDIANFILTER_isFull(sMedianFilter_t *medianFilter) {
|
||||
if (medianFilter->bufferCnt >= medianFilter->numNodes) {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ typedef struct {
|
||||
|
||||
int MEDIANFILTER_Init(sMedianFilter_t *medianFilter);
|
||||
int64_t MEDIANFILTER_Insert(sMedianFilter_t *medianFilter, int64_t sample);
|
||||
uint8_t MEDIANFILTER_isFull(sMedianFilter_t *medianFilter);
|
||||
uint32_t MEDIANFILTER_isFull(sMedianFilter_t *medianFilter);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -9,13 +9,14 @@
|
||||
|
||||
#define I2S_PORT I2S_NUM_0
|
||||
|
||||
#define CHNK_CTRL_CNT \
|
||||
3 // TODO: maybe calculate this dynamically based on chunk duration and
|
||||
// buffer size?!
|
||||
// TODO: maybe calculate this dynamically based on chunk duration and buffer
|
||||
// size?!
|
||||
#define CHNK_CTRL_CNT 2
|
||||
|
||||
#define LATENCY_MEDIAN_FILTER_LEN 199 // 29 // 99
|
||||
#define LATENCY_MEDIAN_FILTER_LEN 199 // 199 // 29 // 99
|
||||
|
||||
#define SHORT_BUFFER_LEN 9
|
||||
#define SHORT_BUFFER_LEN 99
|
||||
#define MINI_BUFFER_LEN 19
|
||||
|
||||
typedef struct pcm_chunk_fragment pcm_chunk_fragment_t;
|
||||
struct pcm_chunk_fragment {
|
||||
@@ -52,18 +53,18 @@ typedef struct snapcastSetting_s {
|
||||
int init_player(void);
|
||||
int deinit_player(void);
|
||||
|
||||
int8_t allocate_pcm_chunk_memory(pcm_chunk_message_t **pcmChunk, size_t bytes);
|
||||
int8_t insert_pcm_chunk(pcm_chunk_message_t *pcmChunk);
|
||||
int32_t allocate_pcm_chunk_memory(pcm_chunk_message_t **pcmChunk, size_t bytes);
|
||||
int32_t insert_pcm_chunk(pcm_chunk_message_t *pcmChunk);
|
||||
|
||||
// int8_t insert_pcm_chunk (wire_chunk_message_t *decodedWireChunk);
|
||||
int8_t free_pcm_chunk(pcm_chunk_message_t *pcmChunk);
|
||||
|
||||
int8_t player_latency_insert(int64_t newValue);
|
||||
int8_t player_send_snapcast_setting(snapcastSetting_t *setting);
|
||||
int32_t player_latency_insert(int64_t newValue);
|
||||
int32_t player_send_snapcast_setting(snapcastSetting_t *setting);
|
||||
|
||||
int8_t reset_latency_buffer(void);
|
||||
int8_t latency_buffer_full(void);
|
||||
int8_t get_diff_to_server(int64_t *tDiff);
|
||||
int8_t server_now(int64_t *sNow);
|
||||
int32_t reset_latency_buffer(void);
|
||||
int32_t latency_buffer_full(bool *is_full, TickType_t wait);
|
||||
int32_t get_diff_to_server(int64_t *tDiff);
|
||||
int32_t server_now(int64_t *sNow, int64_t *diff2Server);
|
||||
|
||||
#endif // __PLAYER_H__
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
229
main/main.c
229
main/main.c
@@ -140,7 +140,8 @@ static int id_counter = 0;
|
||||
*/
|
||||
void time_sync_msg_cb(void *args) {
|
||||
base_message_t base_message_tx;
|
||||
struct timeval now;
|
||||
// struct timeval now;
|
||||
int64_t now;
|
||||
int result;
|
||||
time_message_t time_message_tx = {{0, 0}};
|
||||
int rc1 = ERR_OK;
|
||||
@@ -149,22 +150,25 @@ void time_sync_msg_cb(void *args) {
|
||||
// Isn't it called from timer task instead of ISR?
|
||||
// xSemaphoreGive(timeSyncSemaphoreHandle);
|
||||
|
||||
result = gettimeofday(&now, NULL);
|
||||
// ESP_LOGI(TAG, "time of day: %ld %ld", now.tv_sec,
|
||||
// now.tv_usec);
|
||||
if (result) {
|
||||
ESP_LOGI(TAG, "Failed to gettimeofday");
|
||||
|
||||
return;
|
||||
}
|
||||
// result = gettimeofday(&now, NULL);
|
||||
//// ESP_LOGI(TAG, "time of day: %d", (int32_t)now.tv_sec +
|
||||
///(int32_t)now.tv_usec);
|
||||
// if (result) {
|
||||
// ESP_LOGI(TAG, "Failed to gettimeofday");
|
||||
//
|
||||
// return;
|
||||
// }
|
||||
now = esp_timer_get_time();
|
||||
|
||||
base_message_tx.type = SNAPCAST_MESSAGE_TIME;
|
||||
base_message_tx.id = id_counter++;
|
||||
base_message_tx.refersTo = 0;
|
||||
base_message_tx.received.sec = 0;
|
||||
base_message_tx.received.usec = 0;
|
||||
base_message_tx.sent.sec = now.tv_sec;
|
||||
base_message_tx.sent.usec = now.tv_usec;
|
||||
// base_message_tx.sent.sec = now.tv_sec;
|
||||
// base_message_tx.sent.usec = now.tv_usec;
|
||||
base_message_tx.sent.sec = now / 1000000;
|
||||
base_message_tx.sent.usec = now - base_message_tx.sent.sec * 1000000;
|
||||
base_message_tx.size = TIME_MESSAGE_SIZE;
|
||||
|
||||
result = base_message_serialize(&base_message_tx, base_message_serialized,
|
||||
@@ -379,7 +383,7 @@ void error_callback(const FLAC__StreamDecoder *decoder,
|
||||
}
|
||||
|
||||
static void flac_decoder_task(void *pvParameters) {
|
||||
FLAC__bool ok = true;
|
||||
// FLAC__bool ok = true;
|
||||
FLAC__StreamDecoderInitStatus init_status;
|
||||
snapcastSetting_t *scSet = (snapcastSetting_t *)pvParameters;
|
||||
|
||||
@@ -424,7 +428,8 @@ static void flac_decoder_task(void *pvParameters) {
|
||||
ESP_LOGE(TAG, "ERROR: initializing decoder: %s\n",
|
||||
FLAC__StreamDecoderInitStatusString[init_status]);
|
||||
|
||||
ok = false;
|
||||
// ok = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -532,11 +537,14 @@ static void http_get_task(void *pvParameters) {
|
||||
wire_chunk_message_t wire_chnk = {{0, 0}, 0, NULL};
|
||||
char *hello_message_serialized = NULL;
|
||||
int result, size; //, id_counter;
|
||||
struct timeval now, trx, tdif, ttx;
|
||||
// struct timeval now, trx, tdif, ttx;
|
||||
int64_t now, trx, tdif, ttx;
|
||||
time_message_t time_message_rx = {{0, 0}};
|
||||
time_message_t time_message_tx = {{0, 0}};
|
||||
struct timeval tmpDiffToServer;
|
||||
struct timeval lastTimeSync = {0, 0};
|
||||
// struct timeval tmpDiffToServer;
|
||||
// struct timeval lastTimeSync = {0, 0};
|
||||
int64_t tmpDiffToServer;
|
||||
int64_t lastTimeSync = 0;
|
||||
esp_timer_handle_t timeSyncMessageTimer = NULL;
|
||||
int16_t frameSize = 960; // 960*2: 20ms, 960*1: 10ms
|
||||
int16_t *audio = NULL;
|
||||
@@ -594,7 +602,9 @@ static void http_get_task(void *pvParameters) {
|
||||
esp_timer_start_periodic(timeSyncMessageTimer, timeout);
|
||||
}
|
||||
|
||||
if ((latency_buffer_full() > 0) && (timeout < NORMAL_SYNC_LATENCY_BUF)) {
|
||||
bool is_full = false;
|
||||
latency_buffer_full(&is_full, portMAX_DELAY);
|
||||
if ((is_full == true) && (timeout < NORMAL_SYNC_LATENCY_BUF)) {
|
||||
if (esp_timer_is_active(timeSyncMessageTimer)) {
|
||||
esp_timer_stop(timeSyncMessageTimer);
|
||||
}
|
||||
@@ -729,18 +739,20 @@ static void http_get_task(void *pvParameters) {
|
||||
|
||||
ESP_LOGI(TAG, "netconn connected");
|
||||
|
||||
result = gettimeofday(&now, NULL);
|
||||
if (result) {
|
||||
ESP_LOGE(TAG, "Failed to gettimeofday\r\n");
|
||||
return;
|
||||
}
|
||||
// result = gettimeofday(&now, NULL);
|
||||
// if (result) {
|
||||
// ESP_LOGE(TAG, "Failed to gettimeofday\r\n");
|
||||
// return;
|
||||
// }
|
||||
|
||||
now = esp_timer_get_time();
|
||||
|
||||
// init base message
|
||||
base_message_rx.type = SNAPCAST_MESSAGE_HELLO;
|
||||
base_message_rx.id = 0x0000;
|
||||
base_message_rx.refersTo = 0x0000;
|
||||
base_message_rx.sent.sec = now.tv_sec;
|
||||
base_message_rx.sent.usec = now.tv_usec;
|
||||
base_message_rx.sent.sec = now / 1000000;
|
||||
base_message_rx.sent.usec = now - base_message_rx.sent.sec * 1000000;
|
||||
base_message_rx.received.sec = 0;
|
||||
base_message_rx.received.usec = 0;
|
||||
base_message_rx.size = 0x00000000;
|
||||
@@ -1004,13 +1016,15 @@ static void http_get_task(void *pvParameters) {
|
||||
base_message_rx.size |= (*start & 0xFF) << 24;
|
||||
internalState = 0;
|
||||
|
||||
result = gettimeofday(&now, NULL);
|
||||
if (result) {
|
||||
ESP_LOGW(TAG, "Failed to gettimeofday");
|
||||
}
|
||||
// result = gettimeofday(&now, NULL);
|
||||
// if (result) {
|
||||
// ESP_LOGW(TAG, "Failed to gettimeofday");
|
||||
// }
|
||||
now = esp_timer_get_time();
|
||||
|
||||
base_message_rx.received.sec = now.tv_sec;
|
||||
base_message_rx.received.usec = now.tv_usec;
|
||||
base_message_rx.received.sec = now / 1000000;
|
||||
base_message_rx.received.usec =
|
||||
now - base_message_rx.received.sec * 1000000;
|
||||
|
||||
typedMsgCurrentPos = 0;
|
||||
|
||||
@@ -1243,10 +1257,6 @@ static void http_get_task(void *pvParameters) {
|
||||
xQueueSend(flacTaskQHdl, &pFlacData, portMAX_DELAY);
|
||||
// ESP_LOGI(TAG, "done");
|
||||
#else
|
||||
|
||||
// startTime =
|
||||
// esp_timer_get_time();
|
||||
|
||||
flacData.bytes = tmp;
|
||||
flacData.timestamp =
|
||||
wire_chnk.timestamp; // store timestamp for
|
||||
@@ -1465,16 +1475,6 @@ static void http_get_task(void *pvParameters) {
|
||||
|
||||
insert_pcm_chunk(pcmData);
|
||||
pcmData = NULL;
|
||||
|
||||
// endTime =
|
||||
// esp_timer_get_time();
|
||||
|
||||
// ESP_LOGW(TAG,
|
||||
// "flac
|
||||
// duration:
|
||||
// %lldus",
|
||||
// endTime -
|
||||
// startTime);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1869,19 +1869,25 @@ static void http_get_task(void *pvParameters) {
|
||||
free(tmp);
|
||||
tmp = NULL;
|
||||
|
||||
// ESP_LOGI(TAG,
|
||||
// ESP_LOGI(TAG,
|
||||
//"done codec header msg");
|
||||
|
||||
trx.tv_sec = base_message_rx.sent.sec;
|
||||
trx.tv_usec = base_message_rx.sent.usec;
|
||||
// we do this, so uint32_t timvals
|
||||
// won't overflow if e.g. raspberry
|
||||
// server is off to far
|
||||
settimeofday(&trx, NULL);
|
||||
ESP_LOGI(TAG,
|
||||
"syncing clock to server "
|
||||
"%ld.%06ld",
|
||||
trx.tv_sec, trx.tv_usec);
|
||||
// trx.tv_sec =
|
||||
// base_message_rx.sent.sec;
|
||||
// trx.tv_usec =
|
||||
// base_message_rx.sent.usec;
|
||||
// // we do this, so uint32_t
|
||||
// timvals
|
||||
// // won't overflow if e.g.
|
||||
// raspberry
|
||||
// // server is off to far
|
||||
// settimeofday(&trx, NULL);
|
||||
// ESP_LOGI(TAG,
|
||||
// "syncing clock to
|
||||
// server "
|
||||
// "%ld.%06ld",
|
||||
// trx.tv_sec,
|
||||
// trx.tv_usec);
|
||||
|
||||
state = BASE_MESSAGE_STATE;
|
||||
internalState = 0;
|
||||
@@ -1893,7 +1899,9 @@ static void http_get_task(void *pvParameters) {
|
||||
timeout);
|
||||
}
|
||||
|
||||
if ((latency_buffer_full() > 0) &&
|
||||
bool is_full = false;
|
||||
latency_buffer_full(&is_full, portMAX_DELAY);
|
||||
if ((is_full == true) &&
|
||||
(timeout < NORMAL_SYNC_LATENCY_BUF)) {
|
||||
if (esp_timer_is_active(timeSyncMessageTimer)) {
|
||||
esp_timer_stop(timeSyncMessageTimer);
|
||||
@@ -2304,14 +2312,21 @@ static void http_get_task(void *pvParameters) {
|
||||
// simple conversion means I should
|
||||
// probably use the timeval struct
|
||||
// instead of my own
|
||||
trx.tv_sec = base_message_rx.received.sec;
|
||||
trx.tv_usec = base_message_rx.received.usec;
|
||||
ttx.tv_sec = base_message_rx.sent.sec;
|
||||
ttx.tv_usec = base_message_rx.sent.usec;
|
||||
timersub(&trx, &ttx, &tdif);
|
||||
|
||||
trx.tv_sec = time_message_rx.latency.sec;
|
||||
trx.tv_usec = time_message_rx.latency.usec;
|
||||
// trx.tv_sec =
|
||||
// base_message_rx.received.sec;
|
||||
// trx.tv_usec =
|
||||
// base_message_rx.received.usec;
|
||||
// ttx.tv_sec =
|
||||
// base_message_rx.sent.sec;
|
||||
// ttx.tv_usec =
|
||||
// base_message_rx.sent.usec;
|
||||
// timersub(&trx, &ttx, &tdif);
|
||||
//
|
||||
// trx.tv_sec =
|
||||
// time_message_rx.latency.sec;
|
||||
// trx.tv_usec =
|
||||
// time_message_rx.latency.usec;
|
||||
|
||||
// trx == c2s: client to server
|
||||
// tdif == s2c: server to client
|
||||
@@ -2324,23 +2339,43 @@ static void http_get_task(void *pvParameters) {
|
||||
// tdif.tv_sec,
|
||||
// tdif.tv_usec);
|
||||
|
||||
timersub(&trx, &tdif, &tmpDiffToServer);
|
||||
if ((tmpDiffToServer.tv_sec / 2) == 0) {
|
||||
tmpDiffToServer.tv_sec = 0;
|
||||
tmpDiffToServer.tv_usec =
|
||||
(suseconds_t)((int64_t)tmpDiffToServer.tv_sec *
|
||||
1000000LL / 2) +
|
||||
(int64_t)tmpDiffToServer.tv_usec / 2;
|
||||
} else {
|
||||
tmpDiffToServer.tv_sec /= 2;
|
||||
tmpDiffToServer.tv_usec /= 2;
|
||||
}
|
||||
// timersub(&trx, &tdif,
|
||||
// &tmpDiffToServer); if
|
||||
// ((tmpDiffToServer.tv_sec / 2)
|
||||
// == 0) {
|
||||
// tmpDiffToServer.tv_sec = 0;
|
||||
// tmpDiffToServer.tv_usec =
|
||||
// (suseconds_t)((int32_t)tmpDiffToServer.tv_sec
|
||||
// *
|
||||
// 1000000 /
|
||||
// 2) +
|
||||
// (int32_t)tmpDiffToServer.tv_usec
|
||||
// / 2;
|
||||
// } else {
|
||||
// tmpDiffToServer.tv_sec /= 2;
|
||||
// tmpDiffToServer.tv_usec /=
|
||||
// 2;
|
||||
// }
|
||||
|
||||
// ESP_LOGI(TAG,
|
||||
// "Current
|
||||
// latency: %ld.%06ld",
|
||||
// tmpDiffToServer.tv_sec,
|
||||
// tmpDiffToServer.tv_usec);
|
||||
trx =
|
||||
(int64_t)base_message_rx.received.sec * 1000000LL +
|
||||
(int64_t)base_message_rx.received.usec;
|
||||
ttx = (int64_t)base_message_rx.sent.sec * 1000000LL +
|
||||
(int64_t)base_message_rx.sent.usec;
|
||||
tdif = trx - ttx;
|
||||
trx = (int64_t)time_message_rx.latency.sec * 1000000LL +
|
||||
(int64_t)time_message_rx.latency.usec;
|
||||
tmpDiffToServer = (trx - tdif) / 2;
|
||||
|
||||
// ESP_LOGI(TAG, "Current latency: %ld.%06ld, runtime
|
||||
// %lld", tmpDiffToServer.tv_sec,
|
||||
// tmpDiffToServer.tv_usec, endTime - startTime);
|
||||
// ESP_LOGI(TAG, "Current
|
||||
// latency: %lld.%06lld, runtime
|
||||
// %lld", tmpDiffToServer /
|
||||
// 1000000LL, tmpDiffToServer -
|
||||
// tmpDiffToServer / 1000000LL,
|
||||
// endTime - startTime);
|
||||
|
||||
// TODO: Move the time message sending
|
||||
// to an own thread maybe following
|
||||
@@ -2350,14 +2385,18 @@ static void http_get_task(void *pvParameters) {
|
||||
// apply a median filter. Based on
|
||||
// these we can get server now
|
||||
{
|
||||
struct timeval diff;
|
||||
// struct timeval diff;
|
||||
int64_t diff;
|
||||
int64_t newValue;
|
||||
|
||||
// clear diffBuffer if last update is
|
||||
// older than a minute
|
||||
timersub(&now, &lastTimeSync, &diff);
|
||||
// timersub(&now,
|
||||
// &lastTimeSync, &diff);
|
||||
diff = now - lastTimeSync;
|
||||
|
||||
if (diff.tv_sec > 60) {
|
||||
// if (diff.tv_sec > 60) {
|
||||
if (diff > 60000000LL) {
|
||||
ESP_LOGW(TAG,
|
||||
"Last time sync older "
|
||||
"than a minute. "
|
||||
@@ -2374,7 +2413,9 @@ static void http_get_task(void *pvParameters) {
|
||||
timeout);
|
||||
}
|
||||
|
||||
if ((latency_buffer_full() > 0) &&
|
||||
bool is_full = false;
|
||||
latency_buffer_full(&is_full, portMAX_DELAY);
|
||||
if ((is_full == true) &&
|
||||
(timeout < NORMAL_SYNC_LATENCY_BUF)) {
|
||||
if (esp_timer_is_active(timeSyncMessageTimer)) {
|
||||
esp_timer_stop(timeSyncMessageTimer);
|
||||
@@ -2386,17 +2427,23 @@ static void http_get_task(void *pvParameters) {
|
||||
}
|
||||
}
|
||||
|
||||
newValue =
|
||||
((int64_t)tmpDiffToServer.tv_sec * 1000000LL +
|
||||
(int64_t)tmpDiffToServer.tv_usec);
|
||||
// newValue =
|
||||
// ((int32_t)tmpDiffToServer.tv_sec
|
||||
// * 1000000 +
|
||||
// (int32_t)tmpDiffToServer.tv_usec);
|
||||
newValue = tmpDiffToServer;
|
||||
|
||||
player_latency_insert(newValue);
|
||||
|
||||
// ESP_LOGE(TAG, "latency
|
||||
// %lld", newValue);
|
||||
// %ld", newValue);
|
||||
|
||||
// store current time
|
||||
lastTimeSync.tv_sec = now.tv_sec;
|
||||
lastTimeSync.tv_usec = now.tv_usec;
|
||||
// lastTimeSync.tv_sec =
|
||||
// now.tv_sec;
|
||||
// lastTimeSync.tv_usec =
|
||||
// now.tv_usec;
|
||||
lastTimeSync = now;
|
||||
|
||||
// if
|
||||
// (xSemaphoreTake(timeSyncSemaphoreHandle,
|
||||
@@ -2442,7 +2489,9 @@ static void http_get_task(void *pvParameters) {
|
||||
timeout);
|
||||
}
|
||||
|
||||
if ((latency_buffer_full() > 0) &&
|
||||
bool is_full = false;
|
||||
latency_buffer_full(&is_full, portMAX_DELAY);
|
||||
if ((is_full == true) &&
|
||||
(timeout < NORMAL_SYNC_LATENCY_BUF)) {
|
||||
timeout = NORMAL_SYNC_LATENCY_BUF;
|
||||
|
||||
|
||||
10
sdkconfig
10
sdkconfig
@@ -529,8 +529,8 @@ CONFIG_ESP_TIMER_IMPL_TG0_LAC=y
|
||||
#
|
||||
# Wi-Fi
|
||||
#
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16
|
||||
# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y
|
||||
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1
|
||||
@@ -551,7 +551,7 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
|
||||
CONFIG_WIFI_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# CONFIG_WIFI_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||
# CONFIG_WIFI_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
# CONFIG_ESP32_WIFI_IRAM_OPT is not set
|
||||
CONFIG_ESP32_WIFI_IRAM_OPT=y
|
||||
CONFIG_ESP32_WIFI_RX_IRAM_OPT=y
|
||||
CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y
|
||||
# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set
|
||||
@@ -711,8 +711,8 @@ CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||
CONFIG_LOG_COLORS=y
|
||||
# CONFIG_LOG_TIMESTAMP_SOURCE_RTOS is not set
|
||||
CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM=y
|
||||
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
|
||||
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
|
||||
# end of Log output
|
||||
|
||||
#
|
||||
|
||||
@@ -337,10 +337,10 @@ CONFIG_ESP32_REV_MIN_0=y
|
||||
# CONFIG_ESP32_REV_MIN_3 is not set
|
||||
CONFIG_ESP32_REV_MIN=0
|
||||
CONFIG_ESP32_DPORT_WORKAROUND=y
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_80 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_80=y
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_160 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=y
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=240
|
||||
# CONFIG_ESP32_DEFAULT_CPU_FREQ_240 is not set
|
||||
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=80
|
||||
# CONFIG_ESP32_SPIRAM_SUPPORT is not set
|
||||
# CONFIG_ESP32_TRAX is not set
|
||||
CONFIG_ESP32_TRACEMEM_RESERVE_DRAM=0x0
|
||||
@@ -529,15 +529,15 @@ CONFIG_ESP_TIMER_IMPL_TG0_LAC=y
|
||||
#
|
||||
# Wi-Fi
|
||||
#
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=16
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=128
|
||||
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=y
|
||||
# CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER is not set
|
||||
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=0
|
||||
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER_NUM=10
|
||||
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=8
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=16
|
||||
# CONFIG_ESP32_WIFI_STATIC_TX_BUFFER is not set
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y
|
||||
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1
|
||||
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=8
|
||||
# CONFIG_ESP32_WIFI_CSI_ENABLED is not set
|
||||
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_TX_BA_WIN=10
|
||||
CONFIG_ESP32_WIFI_TX_BA_WIN=8
|
||||
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
|
||||
CONFIG_ESP32_WIFI_RX_BA_WIN=16
|
||||
CONFIG_ESP32_WIFI_NVS_ENABLED=y
|
||||
@@ -551,7 +551,7 @@ CONFIG_ESP32_WIFI_MGMT_SBUF_NUM=32
|
||||
CONFIG_WIFI_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# CONFIG_WIFI_LOG_DEFAULT_LEVEL_DEBUG is not set
|
||||
# CONFIG_WIFI_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
# CONFIG_ESP32_WIFI_IRAM_OPT is not set
|
||||
CONFIG_ESP32_WIFI_IRAM_OPT=y
|
||||
CONFIG_ESP32_WIFI_RX_IRAM_OPT=y
|
||||
CONFIG_ESP32_WIFI_ENABLE_WPA3_SAE=y
|
||||
# CONFIG_ESP_WIFI_SLP_IRAM_OPT is not set
|
||||
@@ -711,8 +711,8 @@ CONFIG_LOG_DEFAULT_LEVEL_INFO=y
|
||||
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
|
||||
CONFIG_LOG_DEFAULT_LEVEL=3
|
||||
CONFIG_LOG_COLORS=y
|
||||
# CONFIG_LOG_TIMESTAMP_SOURCE_RTOS is not set
|
||||
CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM=y
|
||||
CONFIG_LOG_TIMESTAMP_SOURCE_RTOS=y
|
||||
# CONFIG_LOG_TIMESTAMP_SOURCE_SYSTEM is not set
|
||||
# end of Log output
|
||||
|
||||
#
|
||||
|
||||
Reference in New Issue
Block a user