Hi,
Hi,
We have identified that RAW data is not being displayed correctly on the NXP Android UI. Based on the patches provided in the following link, modifications were made at the HAL layer, enabling RAW data streaming on the display.
Services like Surfaceflinger and zygote crashed because of camera provided the low frame (ie 1fps) and the timeout is happening in the HAL layer. Increase the timeout and getting without crash and the camera continuously providing the frames at 1fps.
Path: vendor/nxp-opensource/imx/camera/VideoStream.cpp
#define MAX_RECOVER_COUNT 1 /* Increased to 8 */
#define SELECT_TIMEOUT_SECONDS 3 /* Increased to 30 */
When running both commands, we are only achieving 1 FPS:
gst-launch-1.0 -v v4l2src device=/dev/video0 ! bayer2rgb ! videoconvert ! fpsdisplaysink video-sink=autovideosink text-overlay=true
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
[ 530.044980] Zumi mipi_csis_enum_frameintervals
[ 530.052416] Zumi Frame Interval: 1/120 sec
/GstPipeline:pipeline0/GstFPSDisp[ 530.057797] Zumi mipi_csis_enum_frameintervals
laySink:fpsdisplaysink0/GstAutoVideoSink:autovideosink0/GstWaylandSink:autovideosink0-actual-sink-wayland: sync = true
Settin[ 530.073698] set to pixelformat 'RAWRGB'
[ 530.080032] type 1
g pipeline to PLAYING ...
New cl[ 530.082043] width 480
ock: GstSystemClock
/GstPipeline[ 530.087200] height 320
:pipeline0/GstV4l2Src:v4l2src0.Gs[ 530.092420] Zumi In function: mx6s_configure_csi - pixelformat 0x30314752 width = 480
tPad:src: caps = video/x-bayer, width=(int)480, height=(int)320, framerate=(fraction)120/1, format=(string)rggb, pixel-aspect-ratio=(fraction)1/1, colore
/GstPipeline:pipeline0/GstBayer2RGB:ba[ 530.122705] Zumi __mipi_csis_set_format fmt: 0x300f, 480 x 320
yer2rgb0.GstPad:src: caps = video/x-raw, width=(int)480, height=(int)320, framerate=(fraction)120/1, pixel-aspect-ratio=(fraction)1/1, interlace-mode=(s0
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:src: caps = video/x-raw, width=(int)480, height=(int)320, framerate=(fraction)120/1, pixel-a0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink.GstProxyPad:proxypad0: caps = video/x-raw, width=(int)480, height=(int)320, fr0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:src: caps = video/x-raw, width=(int)480, height=0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink.GstProxyPad:proxypad1: caps = video/x-raw, wid0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:autovideosink0/GstWaylandSink:autovideosink0-actual-sink-wayland.GstPad:sink: 0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:autovideosink0.GstGhostPad:sink: caps = video/x-raw, width=(int)480, height=(i0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay.GstPad:video_sink: caps = video/x-raw, width=(int)480, 0
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0.GstGhostPad:sink: caps = video/x-raw, width=(int)480, height=(int)320, framerate=(fraction)120/0
/GstPipeline:pipeline0/GstVideoConvert:videoconvert0.GstPad:sink: caps = video/x-raw, width=(int)480, height=(int)320, framerate=(fraction)120/1, pixel-0
/GstPipeline:pipeline0/GstBayer2RGB:bayer2rgb0.GstPad:sink: caps = video/x-bayer, width=(int)480, height=(int)320, framerate=(fraction)120/1, format=(ste
[ 531.536801] Zumi Setting Exposure: 0x3e80 (High Byte: 0x3e, Low Byte: 0x80)
[ 531.545965] Zumi Exposure successfully set to 0x3e80
[ 531.554928] IMX298: stream on
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstAutoVideoSink:autovideosink0/GstWaylandSink:autovideosink0-actual-sink-wayland: sync = true
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 2, dropped: 0, current: 1.76, average6
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 2, dropped: 0, current: 1.76, average: 1.76
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0/GstTextOverlay:fps-display-text-overlay: text = rendered: 3, dropped: 0, current: 0.84, average9
/GstPipeline:pipeline0/GstFPSDisplaySink:fpsdisplaysink0: last-message = rendered: 3, dropped: 0, current: 0.84, average: 1.29
root@imx8mmevk:/# v4l2-ctl --device=/dev/video0 --set-fmt-video=width=480,height=320,pixelformat=RG10 --stream-mmap --stream-count=100
[ 48.061928] set to pixelformat 'RAWRGB'
[ 48.065809] type 1
[ 48.067852] width 480
[ 48.070123] height 320
[ 48.072511] Zumi In function: mx6s_configure_csi - pixelformat 0x30314752 width = 480
[ 48.096054] Zumi __mipi_csis_set_format fmt: 0x300f, 480 x 320
[ 49.596468] Zumi Setting Exposure: 0x3e80 (High Byte: 0x3e, Low Byte: 0x80)
[ 49.605997] Zumi Exposure successfully set to 0x3e80
[ 49.613550] IMX298: stream on
<<<<< 0.82 fps
< 0.83 fps
< 0.84 fps
< 0.84 fps
< 0.85 fps
< 0.85 fps
We suspect that either bayer2rgb conversion is causing a delay or another factor is limiting the performance.
Issue: Low FPS (1 FPS) from the IMX298 Camera Sensor
1. MIPI CSI Configuration
Our current device tree configuration is as follows:
link-frequencies = /bits/ 64 <480000000>;
#define IMX298_DEFAULT_CLK_FREQ (24000000)
#define IMX298_DEFAULT_LINK_FREQ (480000000)
#define IMX298_DEFAULT_PIXEL_RATE ((IMX298_DEFAULT_LINK_FREQ * 8LL) / 10)
Is this configuration sufficient to achieve 30 FPS, or can we increase the MIPI clock to improve the frame rate?
2. Effect of Exposure and Gain on FPS
By varying the exposure value, we were able to achieve up to 9 FPS:
imx298->exposure = v4l2_ctrl_new_std(&imx298->ctrls, &imx298_ctrl_ops,
V4L2_CID_EXPOSURE,
16, 33333, 16, 16000);
imx298->gain = v4l2_ctrl_new_std(&imx298->ctrls, &imx298_ctrl_ops,
V4L2_CID_GAIN,
128, 8091, 128, 2048);
How can we determine the optimal exposure and gain values to achieve the best possible FPS for our sensor?
Any guidance on improving the MIPI clock settings or reducing processing delays in the pipeline would be greatly appreciated.
Regards,
SanthanaKumarS