can not get all details with command: v4l2-ctl --device /dev/video0 --all

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

can not get all details with command: v4l2-ctl --device /dev/video0 --all

3,671件の閲覧回数
btarnowski
Contributor III

Hi All,

I'm working with camera sensor os02g10. I can get the RAW10 file from sensor but the picture is not correct. There is misalignment  and picture has 2 parts shifted to each other. You can see it here:

https://community.nxp.com/t5/i-MX-Processors/Camera-sensor-os02g10-MIPI-CSI-for-IMX8MM-Image-issue/m...

 

I tested many DeviceTree setting for camera sensor and mipi-csi but no changes in the picture.
There is also issue with v4l2, below you can see it. Why it can not get

 

Driver Info:

        Driver name      : mx6s-csi
        Card type        : i.MX6S_CSI
        Bus info         : platform:32e20000.csi_bridge
        Driver version   : 5.10.72
        Capabilities     : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps      : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Priority: 0
Video input : 0 (Camera: ok)
Format Video Capture:
        Width/Height      : 1920/1080
        Pixel Format      : ''
        Field             : None
        Bytes per Line    : 0
        Size Image        : 4147200
        Colorspace        : Default
        Transfer Function : Default (maps to Rec. 709)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Full Range)
        Flags             :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 0, Height 0
        Default     : Left 0, Top 0, Width 0, Height 0
        Pixel Aspect: 1/1
Selection Video Capture: crop, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: crop_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: crop_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_default, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_bounds, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: compose_padded, Left 0, Top 0, Width 0, Height 0, Flags:
Selection Video Capture: native_size, Left 0, Top 0, Width 0, Height 0, Flags:

 

But when I get picture there is more details. I try to identify if v4l2 is the source of incorrect picture or something else. What can be wrong ?

 

v4l2-ctl -d /dev/video0 --verbose --set-fmt-video=width=1920,height=1080,pixelformat=BG10  --stream-mmap --stream-count=1 --stream-to=bb001.raw
VIDIOC_QUERYCAP: ok

VIDIOC_G_FMT: ok
VIDIOC_S_FMT: ok
Format Video Capture:
        Width/Height      : 1920/1080
        Pixel Format      : 'BG10' (10-bit Bayer BGBG/GRGR)
        Field             : None
        Bytes per Line    : 3840
        Size Image        : 4147200
        Colorspace        : sRGB
        Transfer Function : Default (maps to sRGB)
        YCbCr/HSV Encoding: ITU-R 601
        Quantization      : Full Range
        Flags             :
                VIDIOC_REQBUFS returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QUERYBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_QBUF returned 0 (Success)
                VIDIOC_STREAMON returned 0 (Success)
cap dqbuf: 0 seq:      0 bytesused: 4147200 ts: 46.903731 delta: 46903.731 ms (ts-monotonic, ts-src-eof)

 

ラベル(1)
0 件の賞賛
10 返答(返信)

3,623件の閲覧回数
btarnowski
Contributor III

And also I see not correct assignments. The csi_bridge should be assigned to media0.

btarnowski_0-1662374734790.png

How to do that, any help?

 

0 件の賞賛

3,623件の閲覧回数
btarnowski
Contributor III

in the meantime:
root@qrnd:~# gst-inspect-1.0 -a > gst-inspect.txt

and the result below in the attachement

0 件の賞賛

3,641件の閲覧回数
btarnowski
Contributor III

next issue: I can see video devices, but there is no /dev/media devices

root@qrnd:~# v4l2-ctl --list-devices
i.MX6S_CSI (platform:32e20000.csi_bridge):
        /dev/video0

vsi_v4l2dec (platform:vsi_v4l2dec):
        /dev/video2

vsi_v4l2enc (platform:vsi_v4l2enc):
        /dev/video1
0 件の賞賛

3,651件の閲覧回数
btarnowski
Contributor III

Looks that Yocto makes this issue. There is no all needed components in the kernel image. Lack of v4lsrc from gstreamer-plugins-good. I added additional packages to Yocto build but no effect. Need to investigate the deploy stage of Yocto build process.

0 件の賞賛

3,649件の閲覧回数
btarnowski
Contributor III

I had to update the list of packages for yocto build:

# Camera support tools
IMAGE_INSTALL_append = " i2c-tools"
IMAGE_INSTALL_append = " v4l-utils"
IMAGE_INSTALL_append = " gstreamer1.0"
IMAGE_INSTALL_append = " gstreamer1.0-plugins-good"
IMAGE_INSTALL_append = " gstreamer1.0-plugins-imx"
IMAGE_INSTALL_append = " gstreamer1.0-plugins-base"
IMAGE_INSTALL_append = " gst-player"
IMAGE_INSTALL_append = " gstreamer1.0-meta-base"
IMAGE_INSTALL_append = " gst-examples"
IMAGE_INSTALL_append = " gstreamer1.0-rtsp-server"
IMAGE_INSTALL_append = " gst1.0-fsl-plugin"
IMAGE_INSTALL_append = " gstreamer1.0-plugins-good-video4linux2"
IMAGE_INSTALL_append = " gstreamer1.0-plugins-good-png"
IMAGE_INSTALL_append = " gstreamer1.0-plugins-good-jpeg"

 

but now I have issue with the command
gst-launch-1.0 v4l2src device=/dev/video0 num-buffers=1 ! video/x-raw,width=1920,height=1080 ! pngenc ! filesink location=/tmp/test_1920x1080.png

I got:

 

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Pipeline is PREROLLED ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
ERROR: from element /GstPipeline:
pipeline0/GstV4l2Src:v4l2src0: Internal data stream error.
Additional debug info:
../git/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.057218529
Setting pipeline to NULL ...
Freeing pipeline ...

 

0 件の賞賛

3,563件の閲覧回数
udhayamoorthi
Contributor II

did you get any solution for that? because i have got the same error if you got pls share your solution

 

 

0 件の賞賛

2,996件の閲覧回数
btarnowski
Contributor III

regarding RAW10 there is solution

https://community.nxp.com/t5/i-MX-Graphics/gst-launch-1-0-returns-Internal-data-stream-error/m-p/153...

and regarding: v4l2-ctl --device /dev/video0 --all

hard to say what is wrong, maybe camera driver uses ctrl API instead ctrlio for V4L2

But now it's not problem, for me next thing is to set parameter like exposure or gain

 

0 件の賞賛

3,525件の閲覧回数
btarnowski
Contributor III

Hi,
Regarding v4l2-ctl --device /dev/video0 --all  and  gstream no progress.
Looks like it is camera sensor driver issue.
dev/media0 - is not necessary


There is different approaches for handling camera sensor.
Below you can see differences for low level API handling.
ov5640 (camera sensor) works on other device.

btarnowski_0-1663928001102.png

And the other comparison:

btarnowski_1-1663928150167.png

 

 

0 件の賞賛

3,184件の閲覧回数
JustADevGuy
Contributor I

hi @btarnowski 
for the display thing with v4l2-ctl --all, you just need to edit mx6s_capture.c In function 'mx6s_vidioc_s_fmt_vid_cap' : just copy the whole pix struct instead of just width/height/sizeimage/field

csi_dev->pix = f->fmt.pix;

this way, internal struct csi_dev->pix has all the information needed when you do a get_format (see function mx6s_vidioc_g_fmt_vid_cap)

i feel mx6s_capture.c is full of little mistakes and needs a lot of improvements to have a better compliance with v4l2 tools.

regards

2,995件の閲覧回数
btarnowski
Contributor III

Looks like mx6s_vidioc_g_fmt_vid_cap is incomplete. 

mx6s_vidioc_s_fmt_vid_cap has all details

 

btarnowski_0-1672393812102.png

 

0 件の賞賛