Skip to content

how to set xfer mode #6

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

Open
fatpunkybearass opened this issue Mar 3, 2025 · 6 comments
Open

how to set xfer mode #6

fatpunkybearass opened this issue Mar 3, 2025 · 6 comments

Comments

@fatpunkybearass
Copy link

In the example file get start uvc there is this uvc configuration line:
usb->uvcConfiguration(240, 320, FPS2INTERVAL(30), 85 * 1024, _xferBufferA, _xferBufferB, 85 * 1024, _frameBuffer); (parameters set by myself)

How can I set up the xfer mode, i.e. uvc_xfer_bulk or uvc_xfer_isoc? I want to test these modes.

Thank you very much

@lijunru-hub
Copy link
Collaborator

You don't need to set the transfer mode; everything is handled automatically.

@fatpunkybearass
Copy link
Author

fatpunkybearass commented Mar 3, 2025

You don't need to set the transfer mode; everything is handled automatically.

I use ESP32S3 with OTG port to receive data from a thermal camera. I basically tested every parameter that I can change, the framerate, width, height are all correct. Just the data_bytes is constantly 1022. And the data displayed on an LCD is also partially correct, but just 10% of the correct full image. I saw somewhere that the data transfer mode (ISOC or BULK ) might be the reason, which means the esp32s3 gets part of the whole frame and neglects the rest. So I just want to give it a test.

Or do you have any idea what could cause the data_byte always be 1022?

Thank you very much!

@fatpunkybearass
Copy link
Author

@lijunru-hub hi我估计您大概是乐鑫的开发人员,我直接用中文沟通可以吗?请问你们之后计划继续升级完善这个usb stream库的计划吗?目前我看到很多人都说使用这个库只对于特定的摄像头才有用,所以如果你们目前没有修改xfer mode的方法的话,我可以等你们之后更新升级。

@lijunru-hub
Copy link
Collaborator

@fatpunkybearass 应该是摄像头的批量包里给了错误的头,你可以手动的在源码中设置宏 UVC_CHECK_HEADER_EOF 为 false 试一试。这个库只支持 full speed 摄像头,市面上这类摄像头比较少。传输模式不是 esp32 这端决定的。是摄像头本身的行为。这个库的首要维护是在 esp-idf sdk 环境下,目前 arduino 更新维护的频次会低一些。目前这个 usb_stream 两端的代码应该是差不多的。你也可以自行的去 esp-iot-solution 里面拿到源码自行更新。

@fatpunkybearass
Copy link
Author

@lijunru-hub hi,谢谢你的回答。我有个问题,我不是很熟悉硬件相关的c语言,尽管我已经学习挺久了。我只熟悉matlab和python(抱歉我是学物理的),我很尽力在尝试找,但是确实找不到你说的这个UVC_CHECK_HEADER_EOF变量在哪个文件。你说的这个变量是在arduino的libraries->esp32_usb_stream里的文件吗(我在arduino ide里安装了esp32_usb_stream的库)。还是说这个变量在c盘的某个esp32的源码文件夹?如果你可以告知位置我不胜感激,我可以自己找相应文件在我电脑里的位置。

目前我只在C:\Users\xx\Documents\Arduino\libraries\ESP32_USB_STREAM\src\original\include里的‘arduino_config.h’里找到了一个‘#define CONFIG_UVC_CHECK_BULK_JPEG_HEADER’的变量,看起来最接近,但不是你说的UVC_CHECK_HEADER_EOF。

@lijunru-hub
Copy link
Collaborator

就是这个,把这个宏定义改成 false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants