Skip to content

Commit 0ddb4c2

Browse files
committed
[nrf fromtree] samples: usb: uac2: implicit: Stop processing micophone data
Stop processing microphone data on error or when streaming ends. This avoids I2S read timeouts due to audio data not being available while streaming. Signed-off-by: Tomasz Moń <[email protected]> (cherry picked from commit 943fc6f)
1 parent 99cbbba commit 0ddb4c2

File tree

1 file changed

+2
-0
lines changed
  • samples/subsys/usb/uac2_implicit_feedback/src

1 file changed

+2
-0
lines changed

samples/subsys/usb/uac2_implicit_feedback/src/main.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ static void uac2_terminal_update_cb(const struct device *dev, uint8_t terminal,
9393
!ctx->microphone_enabled) {
9494
i2s_trigger(ctx->i2s_dev, I2S_DIR_BOTH, I2S_TRIGGER_DROP);
9595
ctx->i2s_started = false;
96+
ctx->rx_started = false;
9697
ctx->i2s_counter = 0;
9798
ctx->plus_ones = ctx->minus_ones = 0;
9899
if (ctx->pending_mic_samples) {
@@ -172,6 +173,7 @@ static void uac2_data_recv_cb(const struct device *dev, uint8_t terminal,
172173
ret = i2s_write(ctx->i2s_dev, buf, size);
173174
if (ret < 0) {
174175
ctx->i2s_started = false;
176+
ctx->rx_started = false;
175177
ctx->i2s_counter = 0;
176178
ctx->plus_ones = ctx->minus_ones = 0;
177179
if (ctx->pending_mic_samples) {

0 commit comments

Comments
 (0)