From 0286ca093dc68052f65872e2070bc3fb71be24e5 Mon Sep 17 00:00:00 2001 From: Ed Date: Tue, 1 Sep 2020 17:53:03 +0100 Subject: [PATCH] Better fix to avoid zero length packets being added to input buffer before SoF case starts working --- lib_xua/src/core/buffer/ep/ep_buffer.xc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib_xua/src/core/buffer/ep/ep_buffer.xc b/lib_xua/src/core/buffer/ep/ep_buffer.xc index 2c4698c0..27308aa1 100644 --- a/lib_xua/src/core/buffer/ep/ep_buffer.xc +++ b/lib_xua/src/core/buffer/ep/ep_buffer.xc @@ -38,8 +38,9 @@ extern unsigned int g_curSamFreqMultiplier; #endif -/* Global var for speed. Related to feedback. Used by input stream to determine IN packet size */ -unsigned g_speed; +/* Initialise so we get a sensible packet size until we start properly calculating feedback in the SoF case */ +/* Without this, zero size packets fill the input FIFO and take time to clear out when feedback starts */ +unsigned g_speed = (AUDIO_CLASS == 2) ? (DEFAULT_FREQ/8000) << 16 : (DEFAULT_FREQ/1000) << 16; unsigned g_freqChange = 0; unsigned feedbackValid = 0;