Video recording issue in APQ8096 Open Embedded with latest kernel 4.14.96 release

Hi,

I am trying ov5640 camera with latest kernel 4.14.96 release. camera preview and image capture is working but video recording is not working.
Below is error logs:

SI1_RDI1_1920x1080.mp4trate=2000000;" ! h264parse ! mp4mux ! filesink location=CS
[ 126.180424] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.716759] qcom-camss a34000.camss: CSIPHY 3PH HW Version = 0x10000000
[ 126.717098] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.724823] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.729589] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.735079] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.740893] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.747020] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[ 126.752934] qcom-camss a34000.camss: VFE HW Version = 0x70020000
Setting pipeline to PAUSED …
[ 127.412063] qcom-camss a34000.camss: CSIPHY 3PH HW Version = 0x10000000
[ 127.412400] qcom-camss a34000.camss: VFE HW Version = 0x70020000
Pipeline is live and does not need PREROLL …
Got context from element ‘sink’: gst.gl.GLDisplay=context, gst.gl.GLDisplay=(GstGLDisplay)"(GstGLDisplayX11)\ gldisplayx11-0";
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
…/…/…/…/gstreamer-1.14.4/libs/gst/base/gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn’t want to preroll.
Setting pipeline to PAUSED …
Setting pipeline to READY …
Setting pipeline to NULL …
Freeing pipeline …

With kernel release 4.14.90, No issue in video recording. Preview, Image capture and video recording is working.
Below is result with different resolution:

  1. 176x144 : Not Working
  2. 320x240 : Not Working
  3. 640x480 : Not Working
  4. 720x480 : Working
  5. 720x576 : Working
  6. 1024x768 : Working
  7. 1280x720 : Working (sometime multiple preview observed)
  8. 1920x1080 : Working
  9. 2592x1944 : Not Working

So can someone please suggest what is the issue here and how can i resolve it in kernel 4.14.96?

Note : I have used ov5640 driver from qcomlt-4.14-d3-mezzanine branch.

can you share the gstreamer pipeline you run.

Pipeline:
media-ctl -d /dev/media0 -l '"msm_csiphy1":1->"msm_csid1":0[1],"msm_csid1":1->"msm_ispif1":0[1],"msm_ispif1":1->"msm_vfe0_rdi1":0[1]'

media-ctl -d /dev/media0 -V '"ov5640 13-003c":0[fmt:UYVY2X8/1920x1080 field:none],"msm_csiphy1":0[fmt:UYVY2X8/1920x1080 field:none],"msm_csid1":0[fmt:UYVY2X8/1920x1080 field:none],"msm_ispif1":0[fmt:UYVY2X8/1920x1080 field:none],"msm_vfe0_rdi1":0[fmt:UYVY2X8/1920x1080 field:none]'

Preview:-
DISPLAY=:0 gst-launch-1.0 v4l2src device=/dev/video1 ! 'video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1' ! glimagesink

Capture:-
gst-launch-1.0 v4l2src device=/dev/video1 num-buffers=1 ! 'video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1' ! jpegenc ! filesink location=CSI1_RDI1_1920x1080.jpg

Video Recording:-
gst-launch-1.0 -e v4l2src device=/dev/video1 ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! autovideoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! v4l2h264enc extra-controls="controls,h264_profile=4,video_bitrate=2000000;" ! h264parse ! mp4mux ! filesink location=CSI1_RDI1_1920x1080.mp4

Preview + Video Recording
DISPLAY=:0 gst-launch-1.0 -e v4l2src device=/dev/video1 ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 ! autovideoconvert ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! tee name="t" ! queue ! glupload ! glimagesink t. ! queue ! v4l2h264enc extra-controls="controls,h264_profile=4,video_bitrate=2000000;" ! h264parse ! mp4mux ! filesink location=CSI1_RDI1_1920x1080.mp4

Same command is working with 4.14.90 kernel

Do you meet same issue replacing ov5640 capture with test src?

gst-launch-1.0 videotestsrc -e ! video/x-raw,format=UYVY,width=1920,height=1080,framerate=30/1 !  autovideoconvert !  video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 !  v4l2h264enc extra-controls="controls,h264_profile=4,video_bitrate=2000000;" !  h264parse ! mp4mux ! filesink location=CSI1_RDI1_1920x1080.mp4

Yes, same issue with test src also.

rse ! mp4mux ! filesink location=videotestsrc_1920x1080.mp44l2h264enc extra-controls="controls,h264_profile=4,video_bitrate=2000000;" !  h264pr
[  133.511559] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.046852] qcom-camss a34000.camss: CSIPHY 3PH HW Version = 0x10000000
[  134.047199] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.054250] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.059547] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.065206] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.071072] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.077252] qcom-camss a34000.camss: VFE HW Version = 0x70020000
[  134.083183] qcom-camss a34000.camss: VFE HW Version = 0x70020000
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0: Internal data stream error.
Additional debug info:
../../../../gstreamer-1.14.4/libs/gst/base/gstbasesrc.c(3055): gst_base_src_loop (): /GstPipeline:pipeline0/GstVideoTestSrc:videotestsrc0:
streaming stopped, reason not-negotiated (-4)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

OK it looks like an encoding issue on 820c (no problem with 410c), @svarbanov, any idea?

Hi, can you revert this kernel commit : 5354ea814aebe6f066d55a6a0840831fa638d20a venus: enc: fix enum_frameintervals
This is the only (?) change related to venus encoder after 4.14.90. I will try also on my side.

Hi,

After reverting commit : 5354ea814aebe6f066d55a6a0840831fa638d20a venus: enc: fix enum_frameintervals, Video recording is working.

Thank you for your suggestion.