Failed to get number 0 in pixelformat enumeration for /dev/video0

Hi,

Connected to ACA to Ixora with ribbon cable and tried to capture than got this error:

Failed to get number 0 in pixelformat enumeration for /dev/video0. (25 - Inappropriate ioctl for device)

Tried 640x480, 288x352 resolutions, but no luck. How can I get video from adapter ?

Here some debug info:

dmesg:

root@apalis-imx6:~# dmesg | grep adv
[    3.857427] systemd[1]: System time before build time, advancing clock.
[    9.670134] adv7280 3-0021: chip found @ 0x42 (21a8000.i2c)
[    9.722085] adv7280 3-0021: no sensor pwdn pin available
[    9.841200] mxc_v4l2_master_attach: ipu0:/csi0 parallel attached adv7280:mxc_v4l2_cap0

root@apalis-imx6:~# dmesg | grep max9526
[    8.980394] max9526 3-0020: Error applying setting, reverse things back
[    9.009229] max9526: probe of 3-0020 failed with error -22

Device list:

root@apalis-imx6:~# ls -al /dev/v4l/by-*
drwxr-xr-x    2 root     root           140 Jun 11 15:28 .
drwxr-xr-x    3 root     root            60 Jun 11 15:28 ..
lrwxrwxrwx    1 root     root            12 Jun 11 15:28 platform-v4l2_cap_0-video-index0 -> ../../video0
lrwxrwxrwx    1 root     root            12 Jun 11 15:28 platform-v4l2_cap_1-video-index0 -> ../../video1
lrwxrwxrwx    1 root     root            12 Jun 11 15:28 platform-v4l2_cap_2-video-index0 -> ../../video2
lrwxrwxrwx    1 root     root            13 Jun 11 15:28 platform-v4l2_out-video-index0 -> ../../video16
lrwxrwxrwx    1 root     root            13 Jun 11 15:28 platform-v4l2_out-video-index1 -> ../../video17

v4l2-ctl:

root@apalis-imx6:~# v4l2-ctl --device /dev/video0 --all
Driver Info (not using libv4l2):
	Driver name   : mxc_v4l2
	Card type     : 
	Bus info      : 
	Driver version: 0.1.11
	Capabilities  : 0x05000005
		Video Capture
		Video Overlay
		Read/Write
		Streaming
Video input : 1 (CSI MEM: no power)
Video output: 0 (DISP3 BG)
Video Standard = 0x000000ff
	PAL-B/B1/G/H/I/D/D1/K
Format Video Capture:
	Width/Height      : 720/576
	Pixel Format      : 'UYVY'
	Field             : Any
	Bytes per Line    : 1440
	Size Image        : 829440
	Colorspace        : Default
	Transfer Function : Default
	YCbCr/HSV Encoding: Default
	Quantization      : Default
Format Video Overlay:
	Left/Top    : 0/0
	Width/Height: 160/160
	Field       : Any
	Chroma Key  : 0x00000000
	Global Alpha: 0x00
	Clip Count  : 0
	Clip Bitmap : No
Framebuffer Format:
	Capability    : Extern Overlay
	Flags         : Overlay Matches Capture/Output Size
	Width         : 0
	Height        : 0
	Pixel Format  : ''
Crop Capability Video Capture:
	Bounds      : Left 0, Top 0, Width 720, Height 625
	Default     : Left 0, Top 0, Width 720, Height 625
	Pixel Aspect: 0/0
Crop: Left 0, Top 0, Width 720, Height 625
Streaming Parameters Video Capture:
	Frames per second: 30.000 (30/1)
	Read buffers     : 0
Streaming Parameters Video Output:
	Frames per second: invalid (0/0)
	Write buffers    : 0

gst-launch:

root@apalis-imx6:~# gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,width=720,height=625,framerate=30/1 ! autovideoconvert ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
/GstPipeline:pipeline0/GstAutoVideoConvert:autovideoconvert0/GstAutoConvert:autoconvertchild: factories = (null)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to enumerate possible video formats device '/dev/video0' can work with
Additional debug info:
../../../gst-plugins-good-1.12.2/sys/v4l2/gstv4l2object.c(1171): gst_v4l2_object_fill_format_list (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Failed to get number 0 in pixelformat enumeration for /dev/video0. (25 - Inappropriate ioctl for device)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
g2d_alloc: alloc memory fail with size 16!
Setting pipeline to NULL ...
Freeing pipeline ...

Also got these errors at dmesg:

[ 1964.614947] ERROR: v4l2 capture: slave not found! V4L2_CID_HUE
[ 1970.601720] ERROR: v4l2 capture: slave not found! V4L2_CID_HUE
[ 1970.609338] ERROR: v4l2 capture: slave not found! V4L2_CID_HUE

And you did follow our article here?

Hi,

Sorry for the late response. Yes, read it and did these:

  • Connected camera and ACA as described at image.
  • Forget to get dmesg | grep max9526, added it to question above.
  • After this command gst-launch-1.0 imxv4l2videosrc ! imxipuvideosink use-vsync=true, got:
    imx-ipuv3 2400000.ipu: IDMAC22's EBA0 is not 8-byte aligned
  • Did not do anything about input selection, because I will use only one channel and says For ADV7280, fix set to Channel 0.
  • Did not set FDT_FILE, because of the note : On Apalis iMX6 the default device tree contains the needed configuration.

Giving video format and opened debug:

root@apalis-imx6:~# GST_DEBUG=*:3 gst-launch-1.0 -v v4l2src device=/dev/video0 ! video/x-raw,format=UYVY,width=720,height=576,framerate=30/1 ! fakesink
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
0:00:00.632259334   916  0x1fdb7b0 WARN                    v4l2 gstv4l2object.c:1171:gst_v4l2_object_fill_format_list:<v4l2src0> error: Failed to enumerate possible video formats device '/dev/video0' can work with
0:00:00.632396667   916  0x1fdb7b0 WARN                    v4l2 gstv4l2object.c:1171:gst_v4l2_object_fill_format_list:<v4l2src0> error: Failed to get number 0 in pixelformat enumeration for /dev/video0. (25 - Inappropriate ioctl for device)
0:00:00.632714667   916  0x1fdb7b0 WARN                 basesrc gstbasesrc.c:2939:gst_base_src_loop:<v4l2src0> error: Internal data stream error.
0:00:00.632783667   916  0x1fdb7b0 WARN                 basesrc gstbasesrc.c:2939:gst_base_src_loop:<v4l2src0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Failed to enumerate possible video formats device '/dev/video0' can work with
Additional debug info:
../../../gst-plugins-good-1.12.2/sys/v4l2/gstv4l2object.c(1171): gst_v4l2_object_fill_format_list (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:
Failed to get number 0 in pixelformat enumeration for /dev/video0. (25 - Inappropriate ioctl for device)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Trying same command with imxv4l2videosrc:

root@apalis-imx6:~# GST_DEBUG=*:3 gst-launch-1.0 -v imxv4l2videosrc device=/dev/video0 ! video/x-raw,format=UYVY,width=720,height=576,framerate=30/1 ! fakesink
Setting pipeline to PAUSED ...
0:00:00.579947667   921   0xc0fc40 WARN         imxv4l2videosrc v4l2src.c:124:gst_imx_v4l2src_is_tvin:<imxv4l2videosrc0> VIDIOC_QUERYSTD failed: Invalid argument
Pipeline is live and does not need PREROLL ...
0:00:00.584293334   921   0xc18260 WARN                GST_PADS gstpad.c:4109:gst_pad_peer_query:<imxv4l2videosrc0:src> could not send sticky events
/GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0.GstPad:src: caps = video/x-raw, format=(string)UYVY, width=(int)720, height=(int)576, interlace-mode=(string)interleaved, framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1
Setting pipeline to PLAYING ...
New clock: GstSystemClock
0:00:00.652710001   921   0xc18260 WARN                 basesrc gstbasesrc.c:2939:gst_base_src_loop:<imxv4l2videosrc0> error: Internal data stream error.
0:00:00.652793001   921   0xc18260 WARN                 basesrc gstbasesrc.c:2939:gst_base_src_loop:<imxv4l2videosrc0> error: streaming stopped, reason not-negotiated (-4)
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: Internal data stream error.
Additional debug info:
../../../../gstreamer-1.12.2/libs/gst/base/gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
streaming stopped, reason not-negotiated (-4)
Execution ended after 0:00:00.064790333
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

Loaded default values uboot with env default -a and installed Apalis-iMX6_LXDE-Image_2.8b2.97-20180331.tar.bz2, the result was same.

Made connection like this. Also tested cam with TV.

Tried these :

root@apalis-imx6:~# gst-launch-1.0 imxv4l2videosrc ! imxvpuenc_h264 ! avimux ! filesink location=adv7280_fcbx10.avi                                                                           
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[INFO]  ringBufferEnable 0, chromaInterleave 0, mapType 0, linear2TiledEnable 1
[ 4170.712921] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: Internal data stream error.
Additional debug info:
../../../../gstreamer-1.12.2/libs/gst/base/gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
streaming stopped, reason error (-5)
Execution ended after 0:00:10.349758001
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

root@apalis-imx6:~# gst-launch-1.0 imxv4l2videosrc ! autovideosink
Setting pipeline to PAUSED ...
display(/dev/fb0) resolution is (1920x1080).
====== OVERLAYSINK:[ 4239.596346] mxc_v4l2_output v4l2_out: Bypass IC.
 4.3.1 build on Mar 31 2018 03:42[ 4239.601819] mxc_v4l2_output v4l2_out: Bypass IC.
:05. ======
display(/dev/fb0) resolution is (1920x1080).
display(/dev/fb0) resolution is (1920x1080).
display(/dev/fb0) resolution is (1920x1080).
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 4250.712907] ERROR: v4l2 capture: mxc_v4l_dqueue timeout enc_counter 0
ERROR: from element /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0: Internal data stream error.
Additional debug info:
../../../../gstreamer-1.12.2/libs/gst/base/gstbasesrc.c(2939): gst_base_src_loop (): /GstPipeline:pipeline0/GstImxV4l2VideoSrc:imxv4l2videosrc0:
streaming stopped, reason error (-5)
Execution ended after 0:00:10.449684668
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
Setting pipeline to NULL ...
Freeing pipeline ...

This image installs apalis_imx6/imx6q-apalis-eval.dtb. Do we need to set FDT_FILE at uboot ?

Loaded default values uboot with env default -a and installed Apalis-iMX6_LXDE-Image_2.7-20180104.tar.bz2, the result was same.

I thing, these rows needs some explanation about how to load after set env, at doc:

Colibri iMX6 # setenv fdt_file imx6dl-colibri-cam-eval-v3.dtb
Colibri iMX6 # saveenv

After setting env, I installed dtb with running

Apalis iMX6 # env default -a
Apalis iMX6 # saveenv
Apalis iMX6 # setenv fdt_file imx6q-apalis-ixora.dtb
Apalis iMX6 # saveenv
Apalis iMX6 # run setupdate
Apalis iMX6 # run update

Now, I dont get ERROR: v4l2 capture: slave not found! V4L2_CID_HUE at dmesg (at stock image v2.8).
Continue to digging …

You are aware that ACA to Ixora requires a custom made cable as per the ACA datasheet?

As you are on Apalis no such messing should be required. That said, I recommend using our regular LXDE demo image which is known to work just fine with the ACA use case as described on our developer website.