Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.5.1, 5.7.1, 5.8.0
-
None
Description
When using a QCamera on the i.MX6 platform with the QtMultimedia framework, we can observe a corruption of the frame rendered into the texture. This happens only with USB camera (UVC), I wasn't able to test it with the MIPI Camera but I strongly believe it won't have the same problem. I attached a picture of the corruption that could be observed during the video streaming.
After some debugging, I think to have found out the source of the issue, It looks to be generated by a DMA issue, the rendering of each video frame can be generated by 2 different paths for hardware acceleration (uploading YUV textures directly):
glTexDirectVIVMap_LOCAL: uploading the YUV texture to the GPU through DMA transfer
or
glTexDirectVIV_LOCAL: uploading the YUV texture via memcpy()
We are always in the first case and the memory allocation of the video frame depends on the video driver subsystem:
imxv4l2videosrc: video capture driver specific to Freescale/NXP, everything is always allocated by dma_alloc_coherent so the memory is physically contiguous, no problem to use DMA.
v4l2src: it depends ... but in the case of UVC camera, this is generally allocated by vmalloc where only the virtual memory is contiguous but not necessary physically.
So the problem is in the case of UVC camera with Qt on i.MX6, we are giving a virtual address where the data is not physically contiguously allocated and triggering a DMA transfer from it ... We need to make sure that the memory has been allocated for DMA transfer when using glTexDirectVIVMap_LOCAL.
At the moment, I'm forcing the path to use glTexDirectVIV_LOCAL and the streaming is working perfectly. Not sure what would be the best solution here to support both imxv4l2videosrc and v4l2src.
Attachments
Issue Links
- duplicates
-
QTBUG-76270 Dynamic camera artifacts in using the QML code
- Closed