I am trying to modify the See3CAM_CX3RDK_ e-CAM59CX3 example found here: http://www.cypress.com/cx3/ and add another usb streaming endpoint. The mipi device that I have attached to is actually sending frames from multiple different cameras. These frames have a header in the first line of the frame which allows me to tell which camera they came from.
I have successfully modified the USB descriptor so that linux sees two separate UVC cameras (/dev/video0 and /dev/video1) Originally the application uses this socket for video:
dmaCfg.consSckId = CY_U3P_UIB_SOCKET_CONS_3;
If I change this to CY_U3P_UIB_SOCKET_CONS_5 I am able to switch the video stream to /dev/video1. I am not able to stream to both video enpoionts at once however.
Reading in cyu3dma.h I can see that there is no CyU3PDmaMultiType_t that is many to many which is what I think I want. The existing application uses CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE.
Is it possible to have the DMA switch endpoints during it's callback? I would like to change the consSckId on the fly so that I can stream frames to either video endpoint at will.
Does CyU3PUsbMapStream or CyU3PUsbChangeMapping help me accomplish this? I cannot find an example of either of these functions ANYWHERE on the web. I've read the documentation but I don't understand exactly how I should use them.
Attached is the unmodified example project. The only changes I've made are duplicating the bytes in the esUVCUSBSSConfigDscr struct. The rest of the application and dma setup I haven't touched.
Thanks for any tips in advance.
Are you trying to do simultaneous transfer data from two cameras on two the endpoints simulanoeoulsy?
If so that is not possible?
But you can receive data on both endpoints in a time division multiplexed manner. You can have a single DMA Socket and the use CyU3PUsbMapStream to change the endpoint mapped with the socket.