From 05d11f8bd73a44d5dd5b718ae86790daca2fdfa5 Mon Sep 17 00:00:00 2001 From: kinho <109323159+KinhoLeung@users.noreply.github.com> Date: Mon, 24 Nov 2025 23:19:49 +0800 Subject: [PATCH] fix:Report the full buffer length to the UAC stack by setting bytes_read in usb_uac_device_input_cb(), so the host correctly detects received audio data instead of seeing zero bytes. --- .../i2s/i2s_advance/i2s_usb/main/i2s_usb_example_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/peripherals/i2s/i2s_advance/i2s_usb/main/i2s_usb_example_main.c b/examples/peripherals/i2s/i2s_advance/i2s_usb/main/i2s_usb_example_main.c index bf66f0d52b4a..2f1e8c290974 100644 --- a/examples/peripherals/i2s/i2s_advance/i2s_usb/main/i2s_usb_example_main.c +++ b/examples/peripherals/i2s/i2s_advance/i2s_usb/main/i2s_usb_example_main.c @@ -236,6 +236,11 @@ static esp_err_t usb_uac_device_input_cb(uint8_t *buf, size_t len, size_t *bytes return ESP_FAIL; } + /* Report full-length data for UAC */ + if (bytes_read) { + *bytes_read = len; + } + return ESP_OK; }