Hello all:
I am currently working on DM368 for 1280x720 video encoding with linux-2.6.32.17. The image pattern continuously comes from a FPGA board without a physical image sensor. I have modified mt9p031 by bypassing all the i2c-related operations between sensors. So far the modified driver works successfully on all the ioctl calls except for the DQBUF. The program blocks at this call. If non-blocking is used, the program behaves of infinitely returning EAGAIN.
I've checked previous related discussion and got to know that this hang results from the reason that the driver waits for an empty and available dequeued buffer. In my application, the operations of REQBUF, QBUF and STREAMON have been sequentially called before calling the first DQBUF. In addition, By calling QUERYBUF, I've got that the flags
field of v4l2_buffer has been set to 0x03 before calling DQBUF. The program hangs and the flags
field is never set to 0x04 (V4L2_BUF_FLAG_DONE
).
One strange outcome I have detected is that the bytesused
field of v4l2_buffer is set to a number that is equal to that in the length
field, after the QBUF is called. Does it mean that the driver considers that the buffers are not empty when start processing DQBUF? However, the buffer contains all zeros although the bytesused
field is set by the driver. Since the image pattern is continuously coming from the FPGA board, is it possible that the bytesused
field is always set upon the QBUF is called? Is that reason that the DQBUF is then blocked?
Another thing I have detected is that the VDINT0 isr is never generated even though the VDINT0 is manually set to a super small number, say one (originally set to 719 by the driver, it should work in my application). That means no data is received from the FPGA.
Please let me know possible reasons. Many thanks.
Jerry