-
Notifications
You must be signed in to change notification settings - Fork 35
fix(uvc): improve uac compatibility and add checks for uvc #308
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
fix(uvc): improve uac compatibility and add checks for uvc #308
Conversation
ae92d53 to
efa0fe5
Compare
016831a to
4ef3e94
Compare
fae33ed to
389afe6
Compare
389afe6 to
fd1c730
Compare
tore-espressif
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TDA-2030 UAC changes look OK. Could you please provide more information about the bInterval!=1 issue? Maybe there is a better way to fix it.
I have more comments for the UVC part, so if you want to speed up the release, please split this PR into 2. One for UAC and one for UVC, thanks!
| @@ -0,0 +1,12 @@ | |||
| | Supported Targets | ESP32-S2 | ESP32-S3 | ESP32-P4 | | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should work also on H4
| | Supported Targets | ESP32-S2 | ESP32-S3 | ESP32-P4 | | ||
| | ----------------- | -------- | -------- | -------- | | ||
|
|
||
| # UVC driver example: Video stream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Outdated description.
It would be nice to provide a simple 'how-to' use this example
| if (is_full_speed && ep_desc->bInterval != 1) { | ||
| // Full-Speed isochronous endpoints must have bInterval = 1 | ||
| uint8_t *_bInterval = (uint8_t *) & (ep_desc->bInterval); | ||
| // Check if we can modify the bInterval value | ||
| if (esp_ptr_in_dram(_bInterval) || esp_ptr_in_diram_dram(_bInterval) | ||
| #if CONFIG_SPIRAM | ||
| || esp_ptr_in_psram(_bInterval) | ||
| #endif | ||
| ) { | ||
| ESP_LOGW(TAG, "UAC Full-Speed device, Endpoint %d, bInterval %d, set to 1", USB_EP_DESC_GET_EP_NUM(ep_desc), ep_desc->bInterval); | ||
| *_bInterval = 1; | ||
| } else { | ||
| ESP_LOGW(TAG, "UAC Full-Speed device, Endpoint %d, bInterval %d, can't set to 1", USB_EP_DESC_GET_EP_NUM(ep_desc), ep_desc->bInterval); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very risky, non-standard way that deserves explanation comment.
BTW, have you found the underlaying problem? If the device needs bInterval=2 why doesn't it work correctly with 2ms polling?
Description
UAC
UVC
usb_types_uvc.htoprivate_includedirectoryRelated
Testing
Checklist
Before submitting a Pull Request, please ensure the following:
Note
Fix UAC FS isochronous interval handling and harden UVC streaming with header/SOI validation; add an audio player example; bump UAC to 1.3.3 and UVC to 2.3.2.
UAC (usb_host_uac)
bInterval = 1on Full-Speed isoch endpoints during descriptor parse to prevent playback stutter; reject Low-Speed.USB_EP_DESC_GET_EP_NUM; direction asserts use USB masks.examples/audio_player(embedded WAV playback, optional MIC loopback) with build files, Kconfig, and configs.1.3.3; updateCHANGELOG.md.UVC (usb_host_uvc)
uvc_frame_payload_header_validate()and MJPEG SOI checks; improve BULK EoF handling; validate headers in ISOC; skip tiny/invalid frames; warn on missed EoF.usb_types_uvc.htoprivate_include; update includes across sources and tests.2.3.2; updateCHANGELOG.md.Written by Cursor Bugbot for commit fd1c730. This will update automatically on new commits. Configure here.