Hello Community,
I would like to stream IMX sensor on maximal ISP rate (using functions like auto exposure, auto white balance etc)
In the i.MX 8M Plus Applications Processor Reference Manual (section 13.1.5 in the attachment) it is stated that the maximum frame rate is 120fps at 1080p.
However, using gstreamer we have only been able to achieve 60fps via:
gst-launch-1.0 -v v4l2src device=/dev/video2 ! "video/x-raw,format=YUY2,width=1920,height=1080,framerate=60/1" ! queue ! waylandsink
although the maximal frame rate for this sensor is 90fps.
This restriction seems to be due to v42lsrc plugin restriction on framerate.
Thanks for any suggestions!
Solved! Go to Solution.
Streaming
Using the v4l2-ctl one can stream at maximal rate using ISP (lSP logs can be seen via journalctl -u imx8-isp.service, isp-imx should be build in debug mode)
v4l2-ctl -d2 --set-fmt-video=width=1920,height=1080,pixelformat=YUY2 --stream-mmap
Here I was able to get 90fps. Sensor is set to output RG10 format, so if one sets pixelformat=RG10, one can achieve maximal rate but the ISP functions will not be activated. Note that .max_fps field in isp-vvcam repo driver implementation must be set to 60fps.
Visualization
The visualization seems to be bounded by wayland, if i set imxvideoconvert_g2d plugin for example with
gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=70/1 ! queue ! imxvideoconvert_g2d ! queue ! video/x-raw,format=RGB16,width=320,height=180 ! queue ! waylandsink window-width=320 window-height=180 --no-position
the image has artifacts and it is not clear whether it is streaming at max rate.
Even the
gst-launch-1.0 -v videotestsrc ! video/x-raw,format=YUY2,framerate=70/1,width=320,height=180 ! queue ! fpsdisplaysink sync=false video-sink="waylandsink window-width=320 window-height=180 --no-position" signal-fps-measurements=true text-overlay=false fps-update-interval=10000
achieves only 60fps so it seems that this limit is related to wayland.
which ISP do you use? ISP0 or ISP1? they are not the same performance,
I used CSI1 port so it should be ISP0
refer to the AN 13736, Note: i.MX8MPlus can only support up to 3840 x 2160 at 30 fps.
I am working with 1080p which should have 120fps in the application note that you have shared.
yes, I tested os08a20 with imx8mp, can reach 4k@30, which means you can get higher frame rate than 60 with 1080p resolution, this is my test result
Thanks for the effort. Can you tell me how did you test this?
I can reach 90fps (restriction on sensor)when using
v4l2-ctl -d2 --set-fmt-video=width=1920,height=1080,pixelformat=RG10 --stream-mmap
however, i can see in the logs (journalctl -u imx8-isp.service) that auto exposure and other ISP functions are not called.
However, when using gstreamer I can only get 60 fps.
I thought that this restrictions are from gstreamer or some restrictions on NXP driver on frame rate while using ISP functions
sorry for my late, I was handle urgent cases before, gstreamer doesn't show the real frame rate the ISP can reach, we have verified ISP0 can reach 4k@30 , dual ISP can up to 1080p@60
I replied to you in your another post about g2d converter, you can test again,
Streaming
Using the v4l2-ctl one can stream at maximal rate using ISP (lSP logs can be seen via journalctl -u imx8-isp.service, isp-imx should be build in debug mode)
v4l2-ctl -d2 --set-fmt-video=width=1920,height=1080,pixelformat=YUY2 --stream-mmap
Here I was able to get 90fps. Sensor is set to output RG10 format, so if one sets pixelformat=RG10, one can achieve maximal rate but the ISP functions will not be activated. Note that .max_fps field in isp-vvcam repo driver implementation must be set to 60fps.
Visualization
The visualization seems to be bounded by wayland, if i set imxvideoconvert_g2d plugin for example with
gst-launch-1.0 v4l2src device=/dev/video2 ! video/x-raw,format=YUY2,width=1920,height=1080,framerate=70/1 ! queue ! imxvideoconvert_g2d ! queue ! video/x-raw,format=RGB16,width=320,height=180 ! queue ! waylandsink window-width=320 window-height=180 --no-position
the image has artifacts and it is not clear whether it is streaming at max rate.
Even the
gst-launch-1.0 -v videotestsrc ! video/x-raw,format=YUY2,framerate=70/1,width=320,height=180 ! queue ! fpsdisplaysink sync=false video-sink="waylandsink window-width=320 window-height=180 --no-position" signal-fps-measurements=true text-overlay=false fps-update-interval=10000
achieves only 60fps so it seems that this limit is related to wayland.
how about trying "fpsdisplaysink text-overlay=false signal-fps-measurements=true sync=false videosink="waylandsink sync=false "?
Adding this part (videosink="waylandsink sync=false ") did not help with frame rate.
Some further notes:
gst-launch-1.0 -v v4l2src device=/dev/video2 ! "video/x-raw,format=YUY2,width=1280,height=720,framerate=90/1" ! queue ! fpsdisplaysink sync=false video-sink=fakesink signal-fps-measurements=true text-overlay=false fps-update-interval=10000
v4l2-ctl -d2 --set-fmt-video=width=1280,height=720,pixelformat=RG10 --stream-mmap
gst-launch-1.0 -v videotestsrc ! video/x-raw,format=YUY2,framerate=120/1,width=1280,height=720 ! queue ! fpsdisplaysink sync=false video-sink=fakesink signal-fps-measurements=true text-overlay=false fps-update-interval=10000
So it might be that converting sensor format from RAW10 to YUY2 is where some time is lost so any idea how to optimize this would be great.
This could be a wayland problem since
gst-launch-1.0 -v videotestsrc ! video/x-raw,format=YUY2,framerate=70/1,width=1280,height=720 ! queue ! fpsdisplaysink sync=false video-sink=waylandsink signal-fps-measurements=true text-overlay=false fps-update-interval=10000
also streams at 60fps. Any recommendation on this two problems would be most welcome.
Here is the missing attachment from the previous message