Re: [PATCH v1 0/6] Add support of OV9655 camera

From: Hugues FRUCHET
Date: Mon Jul 03 2017 - 08:04:05 EST


Hi Nikolaus,

nothing really strange in trace, I wanted to check the latest S_FMT and
it is well 1280x1024 YUV:
>> [ 425.579498] video2: VIDIOC_S_FMT: type=vid-cap, width=1280,
height=1024, pixelformat=UYVY, field=none, bytesperline=2560,
sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0,
xfer_func=0

You're right that it seems that the ISP is not seeing any data in input.
Have you double checked the polarities of sync signals ? I see
differences in devicetree:
960 ov9655: endpoint {
961 remote-endpoint = <&parallel_ep>;
962 #if 0 // not used by camera driver - define &parellel_ep for isp
963 bus-width = <8>;
964 data-shift = <2>; /* Lines
9:2 are used */
965 hsync-active = <1>; /* Active
high */
966 vsync-active = <1>; /* Active
high */
967 data-active = <1>; /* Active
high */
968 pclk-sample = <1>; /* Rising */
969 #endif

Which has been commented out in flavour of:

1011 /* parallel camera interface */
1012 &parallel_ep {
1013 remote-endpoint = <&ov9655>;
1014 ti,isp-clock-divisor = <1>;
1015 ti,strobe-mode;
1016 bus-width = <8>;/* Used data lines */
1017 data-shift = <2>; /* Lines 9:2 are used */
1018 hsync-active = <0>; /* Active low */
1019 vsync-active = <1>; /* Active high */
1020 data-active = <1>;/* Active high */
1021 pclk-sample = <1>;/* Rising */
1022 };

there is a difference regarding active level of hsync.

Nevertheless seems OK if I check OMAP3 ISP register:
CCDC SYN_MODE=0x00071704
#define ISPCCDC_SYN_MODE_VDPOL (1 << 2)
#define ISPCCDC_SYN_MODE_HDPOL (1 << 3)

seems well that vertical is 1 and horizontal is 0.


BR,
Hugues.

On 07/03/2017 11:14 AM, H. Nikolaus Schaller wrote:
> Hi Hugues,
>
>> Am 03.07.2017 um 10:16 schrieb Hugues FRUCHET <hugues.fruchet@xxxxxx>:
>>
>> Hi Nikolaus,
>> Could you enable V4L2 UAPI traces ? Something like:
>> echo 0xFF > /sys/devices/platform/soc/<isp address>.<isp
>> name>/video4linux/video2/dev_debug
>>
>> you will see then in kernel dmesg the V4L2 calls and their
>> parameters/return values.
>
> Nice.
>
>> root@letux:~# echo 255 >/sys/devices/platform/68000000.ocp/480bc000.isp/video4linux/video2/dev_debug
>> root@letux:~# ./camera-demo sxga
>> Camera: /dev/v4l-subdev8
>> Setting mode sxga
>> media-ctl -r
>> media-ctl -l '"ov965x":0 -> "OMAP3 ISP CCDC":0[1]'
>> media-ctl -l '"OMAP3 ISP CCDC":1 -> "OMAP3 ISP CCDC output":0[1]'
>> media-ctl -V '"ov965x":0 [UYVY2X8 1280x1024]'
>> media-ctl -V '"OMAP3 ISP CCDC":0 [UYVY2X8 1280x1024]'
>> media-ctl -V '"OMAP3 ISP CCDC":1 [UYVY 1280x1024]'
>> ### starting mplayer in sxga mode ###
>> mplayer tv:// -vf rotate=2 -tv driver=v4l2:device=/dev/video2:outfmt=uyvy:width=1280:height=1024:fps=15 -vo x11
>> MPlayer2 2.0-728-g2c378c7-4+b1 (C) 2000-2012 MPlayer Team
>>
>> Playing tv://.
>> Detected file format: TV
>> Selected driver: v4l2
>> name: Video 4 Linux 2 input
>> author: Martin Olschewski <olschewski@xxxxxxxxxxxxxxxx>
>> comment: first try, more to come ;-)
>> [ 425.216094] video2: open (0)
>> [ 425.219329] video2: VIDIOC_QUERYCAP: driver=ispvideo, card=OMAP3 ISP CCDC output, bus=media, version=0x00040c00, capabilities=0x84200003, device_caps=0x04200001
>> [ 425.236389] video2: VIDIOC_G_FMT: type=vid-cap, width=0, height=0, pixelformat=, field=any, bytesperline=0, sizeimage=0, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.254699] video2: VIDIOC_G_STD: error -25: std=0x00000000
>> [ 425.260620] video2: VIDIOC_G_PARM: error -22: type=vid-cap, capability=0x0, capturemode=0x0, timeperframe=0/0, extendedmode=0, readbuffers=0
>> v4l2: ioctl get standard failed: Invalid argumen[ 425.275573] video2: VIDIOC_ENUMSTD: error -25: index=0, id=0x0, name=, fps=0/0, framelines=0
>> t
>> Selected device: OMAP3 ISP CCDC output
>> Capa[ 425.289398] video2: VIDIOC_ENUMINPUT: index=0, name=camera, type=2, audioset=0x0, tuner=0, std=0x00000000, status=0x0, capabilities=0x0
>> bilities: video capture video output streamin[ 425.306396] video2: VIDIOC_ENUMINPUT: error -22: index=1, name=, type=0, audioset=0x0, tuner=0, std=0x00000000, status=0x0, capabilities=0x0
>> g
>> supported norms:
>> inputs: 0 = camera;[ 425.323822] video2: VIDIOC_G_INPUT: value=0
>>
>> Current input: 0
>> [ 425.332580] video2: VIDIOC_ENUM_FMT: error -25: index=0, type=vid-cap, flags=0x0, pixelformat=, description=''
>> Current format: unknown (0x0)
>> [ 425.345428] video2: VIDIOC_G_FMT: type=vid-cap, width=0, height=0, pixelformat=, field=any, bytesperline=0, sizeimage=0, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.367858] video2: VIDIOC_S_FMT: type=vid-cap, width=640, height=480, pixelformat=, field=none, bytesperline=0, sizeimage=0, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.386627] video2: VIDIOC_G_FMT: type=vid-cap, width=640, height=480, pixelformat=, field=none, bytesperline=0, sizeimage=0, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.405334] video2: VIDIOC_S_FMT: type=vid-cap, width=640, height=480, pixelformat=UYVY, field=none, bytesperline=1280, sizeimage=614400, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.425720] video2: VIDIOC_ENUMINPUT: index=0, name=camera, type=2, audioset=0x0, tuner=0, std=0x00000000, status=0x0, capabilities=0x0
>> [ 425.439727] video2: VIDIOC_S_INPUT: value=0
>> [ 425.445159] video2: VIDIOC_ENUMSTD: error -25: index=0, id=0x0, name=, fps=0/0, framelines=0
>> tv.c: norm_from_string(pal): Bogus norm paramete[ 425.455871] video2: VIDIOC_ENUMSTD: error -25: index=0, id=0x0, name=, fps=0/0, framelines=0
>> r, setting default.
>> v4l2: ioctl enum norm failed: In[ 425.470397] video2: VIDIOC_G_FMT: type=vid-cap, width=640, height=480, pixelformat=UYVY, field=none, bytesperline=1280, sizeimage=614400, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> appropriate ioctl for device
>> Error: Cannot set [ 425.493743] video2: VIDIOC_S_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> norm!
>> [ 425.517669] video2: VIDIOC_G_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.538238] video2: VIDIOC_S_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.558990] video2: VIDIOC_G_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.579498] video2: VIDIOC_S_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> Selected input hasn't got a tuner!
>> [ 425.600646] video2: VIDIOC_G_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.623840] video2: VIDIOC_G_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.644317] video2: VIDIOC_G_FMT: type=vid-cap, width=1280, height=1024, pixelformat=UYVY, field=none, bytesperline=2560, sizeimage=2621440, colorspace=0, flags=0x0, ycbcr_enc=0, quantization=0, xfer_func=0
>> [ 425.676971] video2: VIDIOC_REQBUFS: count=2, type=vid-cap, memory=mmap
>> [ 425.684082] video2: VIDIOC_QUERYBUF: 00:00:00.00000000 index=0, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x0, length=2621440
>> [ 425.702117] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
>> [ 425.713073] video2: mmap (0)
>> [ 425.716400] video2: VIDIOC_QBUF: 00:00:00.00000000 index=0, type=vid-cap, flags=0x00002003, field=any, sequence=0, memory=mmap, bytesused=2621440, offset/userptr=0x0, length=2621440
>> [ 425.734436] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
>> [ 425.743499] video2: VIDIOC_QUERYBUF: 00:00:00.00000000 index=1, type=vid-cap, flags=0x00002000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x280000, length=2621440
>> [ 425.761688] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
>> [ 425.772186] video2: mmap (0)
>> [ 425.775299] video2: VIDIOC_QBUF: 00:00:00.00000000 index=1, type=vid-cap, flags=0x00002003, field=any, sequence=0, memory=mmap, bytesused=2621440, offset/userptr=0x280000, length=2621440
>> [ 425.793670] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
>> [ 425.802703] video2: VIDIOC_S_CTRL: error -25: id=0x980909, value=0
>> v4l2: ioctl set mute failed: Inappropriate ioctl[ 425.809661] video2: VIDIOC_QUERYCTRL: error -25: id=0x980900, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000
>> for device
>> v4l2: ioctl query control failed: Inappropriate [ 425.826965] video2: VIDIOC_QUERYCTRL: error -25: id=0x980903, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000
>> ioctl for device
>> v4l2: ioctl query control failed[ 425.844055] video2: VIDIOC_QUERYCTRL: error -25: id=0x980902, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000
>> : Inappropriate ioctl for device
>> v4l2: ioctl quer[ 425.860198] video2: VIDIOC_QUERYCTRL: error -25: id=0x980901, type=0, name=, min/max=0/0, step=0, default=0, flags=0x00000000
>> y control failed: Inappropriate ioctl for device
>> v4l2: ioctl query control failed: Inappropriate ioctl for device
>> [ 425.930206] configuring for 1280(2560)x1024
>> [ 425.943481] omap3isp 480bc000.isp: -------------CCDC Register dump-------------
>> [ 425.951171] omap3isp 480bc000.isp: ###CCDC PCR=0x00000000
>> [ 425.958007] omap3isp 480bc000.isp: ###CCDC SYN_MODE=0x00071704
>> [ 425.964996] omap3isp 480bc000.isp: ###CCDC HD_VD_WID=0x00000000
>> [ 425.972656] omap3isp 480bc000.isp: ###CCDC PIX_LINES=0x00000000
>> [ 425.978881] omap3isp 480bc000.isp: ###CCDC HORZ_INFO=0x000004ff
>> [ 425.986114] omap3isp 480bc000.isp: ###CCDC VERT_START=0x00000000
>> [ 425.993255] omap3isp 480bc000.isp: ###CCDC VERT_LINES=0x000003ff
>> [ 425.999694] omap3isp 480bc000.isp: ###CCDC CULLING=0xffff00ff
>> [ 426.006530] omap3isp 480bc000.isp: ###CCDC HSIZE_OFF=0x00000a00
>> [ 426.013580] omap3isp 480bc000.isp: ###CCDC SDOFST=0x00000000
>> [ 426.019531] omap3isp 480bc000.isp: ###CCDC SDR_ADDR=0x40000000
>> [ 426.026550] omap3isp 480bc000.isp: ###CCDC CLAMP=0x00000010
>> [ 426.033142] omap3isp 480bc000.isp: ###CCDC DCSUB=0x00000000
>> [ 426.039123] omap3isp 480bc000.isp: ###CCDC COLPTN=0xbb11bb11
>> [ 426.046020] omap3isp 480bc000.isp: ###CCDC BLKCMP=0x00000000
>> [ 426.052795] omap3isp 480bc000.isp: ###CCDC FPC=0x00000000
>> [ 426.058532] omap3isp 480bc000.isp: ###CCDC FPC_ADDR=0x00000000
>> [ 426.065551] omap3isp 480bc000.isp: ###CCDC VDINT=0x03fe02aa
>> [ 426.072143] omap3isp 480bc000.isp: ###CCDC ALAW=0x00000006
>> [ 426.078033] omap3isp 480bc000.isp: ###CCDC REC656IF=0x00000000
>> [ 426.084960] omap3isp 480bc000.isp: ###CCDC CFG=0x00008800
>> [ 426.090759] omap3isp 480bc000.isp: ###CCDC FMTCFG=0x00000000
>> [ 426.097869] omap3isp 480bc000.isp: ###CCDC FMT_HORZ=0x00000000
>> [ 426.104949] omap3isp 480bc000.isp: ###CCDC FMT_VERT=0x00000000
>> [ 426.111053] omap3isp 480bc000.isp: ###CCDC PRGEVEN0=0x00000000
>> [ 426.118103] omap3isp 480bc000.isp: ###CCDC PRGEVEN1=0x00000000
>> [ 426.124999] omap3isp 480bc000.isp: ###CCDC PRGODD0=0x00000000
>> [ 426.131164] omap3isp 480bc000.isp: ###CCDC PRGODD1=0x00000000
>> [ 426.138000] omap3isp 480bc000.isp: ###CCDC VP_OUT=0x00000000
>> [ 426.144744] omap3isp 480bc000.isp: ###CCDC LSC_CONFIG=0x00006600
>> [ 426.151062] omap3isp 480bc000.isp: ###CCDC LSC_INITIAL=0x00000000
>> [ 426.158325] omap3isp 480bc000.isp: ###CCDC LSC_TABLE_BASE=0x00000000
>> [ 426.165740] omap3isp 480bc000.isp: ###CCDC LSC_TABLE_OFFSET=0x00000000
>> [ 426.173400] omap3isp 480bc000.isp: --------------------------------------------
>> [ 426.188140] video2: VIDIOC_STREAMON: type=vid-cap
>> [ 426.194244] video2: poll: 00000000
>> [ass] auto-open
>> Opening video filter: [rotate=2]
>> VIDEO: 1280x1024 15.000 fps 0.0 kbps ( 0.0 kB/s)
>> Could not find matching colorspace - retrying with -vf scale...
>> Opening video filter: [scale]
>> [swscaler @ 0xb5d45980]using unscaled uyvy422 -> yuv420p special converter
>> VO: [x11] 1024x1280 => 1024x1280 Planar YV12
>> [swscaler @ 0xb5d45980]No accelerated colorspace conversion found from yuv420p to bgra.
>> Colorspace details not fully supported by selected vo.
>> Selected video codec: RAW UYVY [raw]
>> Audio: no sound
>> Starting playback...
>> [ 427.194793] video2: poll: 00000000
>> v4l2: select timeout
>> [ 427.203033] video2: poll: 00000000
>> [ 428.204498] video2: poll: 00000000
>>
>> v4l2: select timeout
>> [ 428.215667] video2: poll: 00000000
>> [ 429.217102] video2: poll: 00000000
>>
>> v4l2: select timeout
>> [ 429.233978] video2: poll: 00000000
>> [ 430.235656] video2: poll: 00000000
>>
>> v4l2: select timeout
>> [ 430.240661] video2: poll: 00000000
>> [ 431.242889] video2: poll: 00000000
>>
>> v4l2: select timeout
>> [ 431.249114] video2: poll: 00000000
>> V: 0.0 6/ 6 ??% ??% ??,?% 0 0
>>
>>
>> MPlayer interrupted by signal 2 in module: filter_video
>> [ 432.251220] video2: poll: 00000000
>> v4l2: select timeout
>> [ 432.256713] video2: poll: 00000000
>> [ 433.258941] video2: poll: 00000000
>>
>> v4l2: select timeout
>> [ 433.266632] omap3isp 480bc000.isp: OMAP3 ISP AEWB: user wants to disable module.
>> [ 433.280090] omap3isp 480bc000.isp: OMAP3 ISP AEWB: module is being disabled
>> [ 433.290130] omap3isp 480bc000.isp: OMAP3 ISP AF: user wants to disable module.
>> [ 433.300140] omap3isp 480bc000.isp: OMAP3 ISP AF: module is being disabled
>> [ 433.309631] omap3isp 480bc000.isp: OMAP3 ISP histogram: user wants to disable module.
>> [ 433.319885] omap3isp 480bc000.isp: OMAP3 ISP histogram: module is being disabled
>> [ 435.373168] omap3isp 480bc000.isp: CCDC stop timeout!
>> [ 435.380371] omap3isp 480bc000.isp: Unable to stop OMAP3 ISP CCDC
>> [ 435.391754] video2: VIDIOC_STREAMOFF: type=vid-cap
>> [ 435.397583] video2: VIDIOC_DQBUF: error -22: 00:00:00.00000000 index=0, type=vid-cap, flags=0x00000000, field=any, sequence=0, memory=mmap, bytesused=0, offset/userptr=0x0, length=0
>> [ 435.417175] timecode=00:00:00 type=0, flags=0x00000000, frames=0, userbits=0x00000000
>> [ 435.431549] video2: VIDIOC_S_CTRL: error -25: id=0x980909, value=1
>> v4l2: ioctl set mute failed: Inappropriate ioctl for device
>> [ 435.495422] video2: release
>> v4l2: 0 frames successfully processed, 1 frames dropped.
>>
>> Exiting... (Quit)
>> root@letux:~#
>
> Seem as if it tells me not much more than setting "pal" norm does fail and there is no "MUTE".
> VIDIOC_STREAMON is successful and the poll times out.
>
> Anyways, this indicates that the problem is probably not in the v4l2 layer but below, i.e. omap3isp+camera.
>
> Maybe as simple as the ISP ignoring the SYNC inputs and then of course failing to capture frames within given time.
> I have checked our pinmux setup but didn't find anything suspicious.
>
> So is it somehow possible to check if the omap3isp is running and receiving sync inpulses?
>
> BR and thanks,
> Nikolaus
>