-
Notifications
You must be signed in to change notification settings - Fork 806
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
[usb_stream] Bad UVC frame (AEGHB-659) #360
Comments
@lijunru-hub @leeebo 感谢~ |
It seems to be caused by: esp-iot-solution/components/usb/usb_stream/usb_stream.c Lines 2041 to 2043 in f2a2669
which is setting data_len incorrectly. I'm getting mostly correct frames after changing this part to: } else if (strmh->reassembling) {
header_len = payload[0];
data_len = payload_len - header_len;
/* checking the end-of-header */
variable_offset = 2;
header_info = payload[1];
ESP_LOGV(TAG, "reassembling %u + %u", strmh->got_bytes, data_len);
} else { But I'm still getting invalid frames constantly (around every 150 frames), I guess this function still needs more fixes. |
Thanks for the clue! Are you planning to support this? |
fix espressif#360 Signed-off-by: zry98 <[email protected]>
Unfortunately, it still requires the changes in #360 (comment) to work. Can you test if zry98@d3fa962 is OK for cameras of single transfer per sample mode? (I don't have one to test against) Btw, I noticed that with the changes applied, it randomly panics after some time as below:
|
@zry98 zry98@d3fa962 does not work in our test cameras According to the UVC1.5 protocol, One payload only contains one header. So we can't subtract the length of the header from each packet. If your camera only works this, it may be a custom protocol, can you provide a link to buy the camera? for the random panics, it could has no direct connection with the patch. Would you please run the example under this repository to test your camera, and please config your log level to verbose to get more details |
@leeebo Sorry I didn't pay much attention to the header, thought a simple So we still need to find a way to know if it's in single or multi transfer mode, maybe checking the first several transfers to determine? then process the later ones accordingly.
It's the Hikvision DS-2TM01-3XF (or TB-4117-3/S for OEM, more popular on the market) thermal camera. (在淘宝和闲鱼能找到很多) PotPlayer, webcamtests.com on Windows and USB Camera on Android all work flawlessly with it. For your reference, I've captured some packets with Wireshark: hik4117.zip |
@zry98 thanks for the information. we will buy one for better support |
Hi @zry98 would you please send us the camera for better support? After the fix, we will send it back to you. |
Answers checklist.
General issue report
I have successfully connected ESP32-S3 (N16R8) to a UVC camera using the example usb_camera_mic_spk, but the obtained frame looks very bad as below:
Related logs
Since the camera is the same as the one in #325, I have set
CONFIG_NUM_BULK_BYTES_PER_URB=1024
to make it work.The text was updated successfully, but these errors were encountered: