Message ID | 20220715135007.53574-1-jacopo@jmondi.org |
---|---|
Headers | show |
Series |
|
Related | show |
On Fri 2022-07-15 15:50:00, Jacopo Mondi wrote: > This series addresses the requirement of mapping multiple V4L2 pixel formats > to a single libcamera format. Specifically, it allows to map V4L2_PIX_FMT_JPEG > and V4L2_PIX_FMT_MJPEG to libcamera::formats::MJPEG. > > The series starts by allowing to associate mulitple V4L2 FourCC in > PixelFormatInfo and re-introduces toV4L2PixelFormat() in V4L2VideoDevice in > order to select among from the list of V4L2 formats the first one supported > from the video device. > > Patch [7/8] adds a multiplanar flag to V4L2VideoDevice::toV4L2PixelFormat() to > allow selection of the contiguous or non-contiguous format versions. > > Finally, the last patch associates V4L2_PIX_FMT_JPEG to formats::MJPEG. > > Tested with a UVC camera. > > Pavel, could you please test on the pinephone please ? FWIW, Reviewed-by: Pavel Machek <pavel@ucw.cz> . And yes, I'll try to find time to test it. Best regards, Pavel
Hi! > This series addresses the requirement of mapping multiple V4L2 pixel formats > to a single libcamera format. Specifically, it allows to map V4L2_PIX_FMT_JPEG > and V4L2_PIX_FMT_MJPEG to libcamera::formats::MJPEG. > > The series starts by allowing to associate mulitple V4L2 FourCC in > PixelFormatInfo and re-introduces toV4L2PixelFormat() in V4L2VideoDevice in > order to select among from the list of V4L2 formats the first one supported > from the video device. > > Patch [7/8] adds a multiplanar flag to V4L2VideoDevice::toV4L2PixelFormat() to > allow selection of the contiguous or non-contiguous format versions. > > Finally, the last patch associates V4L2_PIX_FMT_JPEG to formats::MJPEG. > > Tested with a UVC camera. > > Pavel, could you please test on the pinephone please ? I tried to do quick testing, but it is not trivial as I have to patch libcamera to get it work on PinePhone at all. I could not get it to work so far. Best regards, Pavel
Hi Pavel, On Sat, Jul 16, 2022 at 12:15:20PM +0200, Pavel Machek wrote: > Hi! > > > This series addresses the requirement of mapping multiple V4L2 pixel formats > > to a single libcamera format. Specifically, it allows to map V4L2_PIX_FMT_JPEG > > and V4L2_PIX_FMT_MJPEG to libcamera::formats::MJPEG. > > > > The series starts by allowing to associate mulitple V4L2 FourCC in > > PixelFormatInfo and re-introduces toV4L2PixelFormat() in V4L2VideoDevice in > > order to select among from the list of V4L2 formats the first one supported > > from the video device. > > > > Patch [7/8] adds a multiplanar flag to V4L2VideoDevice::toV4L2PixelFormat() to > > allow selection of the contiguous or non-contiguous format versions. > > > > Finally, the last patch associates V4L2_PIX_FMT_JPEG to formats::MJPEG. > > > > Tested with a UVC camera. > > > > Pavel, could you please test on the pinephone please ? > > I tried to do quick testing, but it is not trivial as I have to patch > libcamera to get it work on PinePhone at all. I could not get it to > work so far. > Thanks for testing! Turns out I have a pinephone as well, and I spent the last days trying to set it up to test libcamera there. The result is that I have sent a v2 of this series with one additional patch on top and had to massage the video driver a bit to make it slightly more compliant with libcamera requirements. With these two branches: - postmarket os patches + ov5640 backport + sun6i-csi https://git.sr.ht/~jmondi_/linux/log/pinephone/orange-pi-5.17-20220429-1618/postmarketos - JPEG/MJPEG mapping https://git.sr.ht/~jmondi_/libcamera/log/jmondi/pinephone I'm able to capture from ov5640 in YUYV and JPEG formats in different resolutions: $ cam -c2 -C --stream pixelformat=YUYV,width=640,height=480 $ cam -c2 -C --stream pixelformat=MJPEG,width=1920,height=1080 -F I've been able to inspect the YUYV image and they're ok, the JPEG one can't be opened with my viewer and I've not investigated why. I recall I tested JPEG with the ov5640 driver in a CSI-2 setup and it worked. Not sure if the sun6i csi receiver plays a role here ? Anyway, I tried NV12 and it fails because of a wrong plane mapping. Haven't investigated yet but I presume it's because we map NV12 to the contiguous planar format version. The JPEG/MJPEG series would help mapping formats::NV12 to the right V4L2 format version, but I haven't done that it yet. Capturing in full resolution doesn't work. The sensor hangs and I presume it is because of the sensor driver. The long list of changes now upstreamed for the ov5640 sensor modes only apply to CSI-2 setups, as I haven't got a parallel setup to test with at the time. The series has been tested on a parallel setup by other media developers and no breakages were reported, but the fact the sensor hangs makes me think it's driver's fault. Hope this serves as a base for further investigations! Thanks j > Best regards, > Pavel > -- > People of Russia, stop Putin before his war on Ukraine escalates.
Hi! > Thanks for testing! > > Turns out I have a pinephone as well, and I spent the last days trying > to set it up to test libcamera there. Nice! > The result is that I have sent a v2 of this series with one additional > patch on top and had to massage the video driver a bit to make it > slightly more compliant with libcamera requirements. > > With these two branches: > > - postmarket os patches + ov5640 backport + sun6i-csi > https://git.sr.ht/~jmondi_/linux/log/pinephone/orange-pi-5.17-20220429-1618/postmarketos > - JPEG/MJPEG mapping > https://git.sr.ht/~jmondi_/libcamera/log/jmondi/pinephone > > I'm able to capture from ov5640 in YUYV and JPEG formats in different > resolutions: > $ cam -c2 -C --stream pixelformat=YUYV,width=640,height=480 > $ cam -c2 -C --stream pixelformat=MJPEG,width=1920,height=1080 -F > I've been able to inspect the YUYV image and they're ok, the JPEG one > can't be opened with my viewer and I've not investigated why. I recall > I tested JPEG with the ov5640 driver in a CSI-2 setup and it worked. JPEG works for me. At some resolution/fps setting I was getting corruption in YUYV (?), and there JPEG got corrupted, too. > Capturing in full resolution doesn't work. The sensor hangs and I > presume it is because of the sensor driver. The long list of changes > now upstreamed for the ov5640 sensor modes only apply to CSI-2 This worked for me: #build/src/cam/cam -c /base/i2c-csi/rear-camera@4c -spixelformat=JPEG,width=2592,height=1944 --sdl -C20 -F/tmp/delme.# frame_interval was 10 iirc. This, too: #build/src/qcam/qcam -r gles -spixelformat=SBGGR8,width=2592,height=1944 -c /base/i2c-csi/rear-camera@4c SBGGR8 works for me at high resolutions, while YUYV works at low resolutions. I have to adjust frame_interval for some stuff to work. Best regards, Pavel