Skip to content
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

Support for USB BULK-cameras #39

Open
lninio opened this issue Feb 27, 2025 · 2 comments
Open

Support for USB BULK-cameras #39

lninio opened this issue Feb 27, 2025 · 2 comments

Comments

@lninio
Copy link

lninio commented Feb 27, 2025

Hello, RSTA2!
I'm trying to add support for USB cameras to your code that use BULK transfer to transfer images. To do this, I added a new supported interface ("inte-2-0" - videostreaming interface) to the USBDeviceFactory.c file. In its configuration function, I first read the frame descriptors, which contain the height and width of the frame (descriptor class - 0x24, descriptor subclass (next byte) - 0x05 (uncompressed frame)), then I set the camera settings using the standard request to the camera.
First, I use the following pseudocode for negotiations:
DWHCIDeviceControlMessage (arg0, arg1 (endpoint0), 0x21, 1 (set_cur request), 0x100 (probe_control), 1, &buffer_with_parameters (table 4-47 in USB Video Class specification v.1.1), 34 (length_of_buffer));
DWHCIDeviceControlMessage (arg0, arg1 (endpoint0), 0xA1, 0x81 (get_cur request), 0x100 (probe_control), 1, &buffer_with_parameters (table 4-47 in USB Video Class specification v.1.1), 34 (length_of_buffer));
DWHCIDeviceControlMessage (arg0, arg1 (endpoint0), 0x21, 1 (set_cur request), 0x200 (commit_control), 1, &buffer_with_parameters (table 4-47 in USB Video Class specification v.1.1), 34 (length_of_buffer));
And then the problem arises, which is that I do not know how to start a BULK broadcast from the camera.
Can you tell me how to start broadcasting the image? I would appreciate your help.

Best regards
Lninio

@rsta2
Copy link
Owner

rsta2 commented Feb 28, 2025 via email

@lninio
Copy link
Author

lninio commented Feb 28, 2025

Thanks for the reply. I found a way to solve the problem. I used a USB bus sniffer from Linux called usbmon in order to analyze the correct initialization and exchange with the camera. Using the data from Linux as a hint, I managed to organize the data transfer from the camera.

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