Home > OS >  Android USB video output function for help! ~ ~
Android USB video output function for help! ~ ~

Time:09-25

Now in order to realize a USB Cam function to camera, real-time image data were collected after jpeg coding to PC through USB otg transmission end

Now imitate webcam (drivers/usb/gadget/webcam. C)
The Android usb (drivers/usb/gadget/Android. C) implements a UVC on Camera driver (added to the usb composite device array)

USB connected to the PC, the PC can be identified as uvc camera equipment,

USB output video applications, mainly refer to
http://git.ideasonboard.org/uvc-gadget.git/commit/9fbc003442056cdf59b87e94c1d0e3814575d4b3
And made some changes to

[for]
Data transmission is the basic process of the

Start data transfer
1. Apply to the drive for the four frame buffer (VIDIOC_REQBUFS)
2. Get the frame buffer information (VIDIOC_QUERYBUF), and will apply to the frame buffer is mapped to a user space
3. Fill 4 frame data, four frame buffer into drive queue (VIDIOC_QBUF)
4. Select monitor and wait for the device file "to write" state
5. Device files "to write", a queue in a frame buffer (VIDIOC_DQBUF)
6. To frame buffer fills a frame data
7. To the frame buffer into the queue (VIDIOC_QBUF)

Repeat step 5 to 7 consecutive data transmission


At present has been achieved, real-time acquisition of the camera image data in a row, after a USB in the PC display, (MJPEG)
PC software is AMCap

[the problem]
Now when the amount of data per frame keeping them in more than 500 KB, video can be continuous transmission, this is no problem,
But if the amount of data is lower than the more than 500 KB per frame, may transfer the 10 frames, after dozens of frames, stopped,
Timeout is found after the tracking code in the select side, both the select does not return "to write" state


Check this problem for a long time, always don't know what is reason,
Just contact USB the novice, please supervise your ace grant instruction! ~

CodePudding user response:

Select a timeout, get error code to try?

CodePudding user response:

reference 1st floor wenxy1 response:
select timeout, try get error code?


Select a timeout, errno is 22 (Invalid argument)

CodePudding user response:

Usb is using a synchronous transmission mode, select timeout occurs, the kernel output log "s are no more ISOC requests"

CodePudding user response:

LZ, could you tell me what do you use the board, I also in doing this

CodePudding user response:

1. The number of frames your camera may not be fixed, general USB camera frames is associated with light,
2. Modify the timeout can set themselves up, in the select
3. The cause of the timeout may be the reason for the hardware, such as insufficient power supply capacity (as speculation)
  • Related