Skip to content

Commit 05d11f8

Browse files
authored
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.
1 parent 130fdc7 commit 05d11f8

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

examples/peripherals/i2s/i2s_advance/i2s_usb/main/i2s_usb_example_main.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,11 @@ static esp_err_t usb_uac_device_input_cb(uint8_t *buf, size_t len, size_t *bytes
236236
return ESP_FAIL;
237237
}
238238

239+
/* Report full-length data for UAC */
240+
if (bytes_read) {
241+
*bytes_read = len;
242+
}
243+
239244
return ESP_OK;
240245
}
241246

0 commit comments

Comments
 (0)