[Letux-kernel] GTA04 Camera driver

H. Nikolaus Schaller hns at goldelico.com
Thu Jul 20 18:14:57 CEST 2017


HI,
I have now cleaned up the driver a little. Here is the feature branch:

http://git.goldelico.com/?p=gta04-kernel.git;a=shortlog;h=refs/heads/work/hns/video/ov9655-alt

For operation you need the latest camera-setup and camera-demo from Letux/root:

http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=Letux/root/camera-setup;h=25437f4d820f5e50f2c077dd25b3c54231e7dc38;hb=25437f4d820f5e50f2c077dd25b3c54231e7dc38
http://git.goldelico.com/?p=gta04-kernel.git;a=blob;f=Letux/root/camera-demo;h=c6f7238488634606f2935bbbf949f535af34ab7b;hb=c6f7238488634606f2935bbbf949f535af34ab7b

Basically it works, although image quality isn't optimal (noisy, stripes and a little misaligned).

One major issue is that stopping mplayer and starting camera-demo a
second time makes the kernel hang completely (!) without any other
message.

First call:

> root at letux:~# ./camera-demo 
> DISPLAY=:0
> XAUTHORITY=tcp
> Camera: /dev/v4l-subdev8
> Setting mode sxga
> media-ctl -r
> media-ctl -l '"ov9655 1-0030":0 -> "OMAP3 ISP CCDC":0[1]'
> media-ctl -l '"OMAP3 ISP CCDC":1 -> "OMAP3 ISP CCDC output":0[1]'
> media-ctl -V '"ov9655 1-0030":0 [UYVY2X8 1280x1024]'
> [  469.325622] ov9655 1-0030: ov9655_open
> [  469.329589] ov9655 1-0030: __ov9655_set_power: on = 1
> [  469.336700] ov9655 1-0030: OV9655 power on
> [  469.387512] ov9655 1-0030: ov9655_reset
> [  469.395019] ov9655 1-0030: OV9655 write register 09 : 01
> [  469.401641] ov9655 1-0030: OV9655 write register 15 : 40
> [  469.408599] ov9655 1-0030: OV9655 write register 11 : 00
> [  469.415405] ov9655 1-0030: OV9655 write register 6b : 4a
> [  469.421295] ov9655 1-0030: ov9655_s_ctrl 9963796
> [  469.427429] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_HFLIP 0
> [  469.433624] ov9655 1-0030: OV9655 read register 1e : 00
> [  469.440063] ov9655 1-0030: ov9655_s_ctrl 9963797
> [  469.445709] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_VFLIP 0
> [  469.451934] ov9655 1-0030: OV9655 read register 1e : 00
> [  469.458312] ov9655 1-0030: ov9655_s_ctrl 10422531
> [  469.463287] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_TEST_PATTERN 0
> [  469.470947] ov9655 1-0030: OV9655 read register 0c : 00
> [  469.477630] ov9655 1-0030: OV9655 read register 8d : 00
> [  469.483154] ov9655 1-0030: ov9655_s_ctrl 9967874
> [  469.489074] ov9655 1-0030: ov9655_s_ctrl 9967875
> [  469.494781] ov9655 1-0030: ov9655_s_ctrl 9967876
> [  469.499633] ov9655 1-0030: ov9655_s_ctrl 9967877
> [  469.505401] ov9655 1-0030: ov9655_set_format
> [  469.509887] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=0 csp=0
> [  469.517791] ov9655 1-0030: __ov9655_get_pad_crop: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  469.527160] ov9655 1-0030: __ov9655_get_pad_format: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  469.536682] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  469.544494] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  469.551513] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  469.559631] ov9655 1-0030: ov9655_close
> [  469.564666] ov9655 1-0030: __ov9655_set_power: on = 0
> [  469.569976] ov9655 1-0030: OV9655 power off
> 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[  473.197021] ov9655 1-0030: __ov9655_set_power: on = 1
> Linux 2 input
> author: Martin Olschewski <olsc[  473.206237] ov9655 1-0030: OV9655 power on
> hewski at zpr.uni-koeln.de>
> comment: first try, more to come ;-)
> [  473.267181] ov9655 1-0030: ov9655_reset
> [  473.273803] ov9655 1-0030: OV9655 write register 09 : 01
> [  473.283142] ov9655 1-0030: OV9655 write register 15 : 40
> [  473.290191] ov9655 1-0030: OV9655 write register 11 : 00
> [  473.297027] ov9655 1-0030: OV9655 write register 6b : 4a
> [  473.302917] ov9655 1-0030: ov9655_s_ctrl 9963796
> [  473.309295] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_HFLIP 0
> [  473.318115] ov9655 1-0030: OV9655 read register 1e : 00
> [  473.323608] ov9655 1-0030: ov9655_s_ctrl 9963797
> [  473.329681] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_VFLIP 0
> [  473.336761] ov9655 1-0030: OV9655 read register 1e : 00
> [  473.342224] ov9655 1-0030: ov9655_s_ctrl 10422531
> [  473.348083] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_TEST_PATTERN 0
> [  473.355895] ov9655 1-0030: OV9655 read register 0c : 00
> [  473.361755] ov9655 1-0030: OV9655 read register 8d : 00
> [  473.368164] ov9655 1-0030: ov9655_s_ctrl 9967874
> [  473.373046] ov9655 1-0030: ov9655_s_ctrl 9967875
> [  473.378753] ov9655 1-0030: ov9655_s_ctrl 9967876
> [  473.383605] ov9655 1-0030: ov9655_s_ctrl 9967877
> v4l2: ioctl get standard failed: Invalid argument
> Selected device: OMAP3 ISP CCDC output
> Capabilities:  video capture  video output  streaming
> supported norms:
> inputs: 0 = camera;
> Current input: 0
> Current format: unknown (0x0)
> tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
> v4l2: ioctl enum norm failed: Inappropriate ioctl for device
> Error: Cannot set norm!
> Selected input hasn't got a tuner!
> v4l2: ioctl set mute failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> [  473.457946] ov9655 1-0030: ov9655_get_format
> [  473.462768] ov9655 1-0030: __ov9655_get_pad_format: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  473.473327] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  473.482818] ov9655 1-0030: ov9655_get_format
> [  473.488739] ov9655 1-0030: __ov9655_get_pad_format: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  473.498382] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  473.506835] omap3isp 480bc000.isp: -------------CCDC Register dump-------------
> [  473.515502] omap3isp 480bc000.isp: ###CCDC PCR=0x00000000
> [  473.521362] omap3isp 480bc000.isp: ###CCDC SYN_MODE=0x00031704
> [  473.528900] omap3isp 480bc000.isp: ###CCDC HD_VD_WID=0x00000000
> [  473.536041] omap3isp 480bc000.isp: ###CCDC PIX_LINES=0x00000000
> [  473.542266] omap3isp 480bc000.isp: ###CCDC HORZ_INFO=0x000004ff
> [  473.549438] omap3isp 480bc000.isp: ###CCDC VERT_START=0x00000000
> [  473.556518] omap3isp 480bc000.isp: ###CCDC VERT_LINES=0x000003ff
> [  473.562988] omap3isp 480bc000.isp: ###CCDC CULLING=0xffff00ff
> [  473.569854] omap3isp 480bc000.isp: ###CCDC HSIZE_OFF=0x00000a00
> [  473.576904] omap3isp 480bc000.isp: ###CCDC SDOFST=0x00000000
> [  473.582885] omap3isp 480bc000.isp: ###CCDC SDR_ADDR=0x40000000
> [  473.590789] omap3isp 480bc000.isp: ###CCDC CLAMP=0x00000010
> [  473.597564] omap3isp 480bc000.isp: ###CCDC DCSUB=0x00000000
> [  473.603576] omap3isp 480bc000.isp: ###CCDC COLPTN=0xbb11bb11
> [  473.610382] omap3isp 480bc000.isp: ###CCDC BLKCMP=0x00000000
> [  473.622375] omap3isp 480bc000.isp: ###CCDC FPC=0x00000000
> [  473.629302] omap3isp 480bc000.isp: ###CCDC FPC_ADDR=0x00000000
> [  473.636535] omap3isp 480bc000.isp: ###CCDC VDINT=0x03fe02aa
> [  473.642395] omap3isp 480bc000.isp: ###CCDC ALAW=0x00000006
> [  473.649230] omap3isp 480bc000.isp: ###CCDC REC656IF=0x00000000
> [  473.656188] omap3isp 480bc000.isp: ###CCDC CFG=0x00008800
> [  473.662017] omap3isp 480bc000.isp: ###CCDC FMTCFG=0x00000000
> [  473.669097] omap3isp 480bc000.isp: ###CCDC FMT_HORZ=0x00000000
> [  473.676116] omap3isp 480bc000.isp: ###CCDC FMT_VERT=0x00000000
> [  473.682250] omap3isp 480bc000.isp: ###CCDC PRGEVEN0=0x00000000
> [  473.689483] omap3isp 480bc000.isp: ###CCDC PRGEVEN1=0x00000000
> [  473.696472] omap3isp 480bc000.isp: ###CCDC PRGODD0=0x00000000
> [  473.702667] omap3isp 480bc000.isp: ###CCDC PRGODD1=0x00000000
> [  473.709533] omap3isp 480bc000.isp: ###CCDC VP_OUT=0x00000000
> [  473.716339] omap3isp 480bc000.isp: ###CCDC LSC_CONFIG=0x00006600
> [  473.722656] omap3isp 480bc000.isp: ###CCDC LSC_INITIAL=0x00000000
> [  473.729949] omap3isp 480bc000.isp: ###CCDC LSC_TABLE_BASE=0x00000000
> [  473.737396] omap3isp 480bc000.isp: ###CCDC LSC_TABLE_OFFSET=0x00000000
> [  473.744964] omap3isp 480bc000.isp: --------------------------------------------
> [  473.752777] ov9655 1-0030: ov9655_s_stream(1)
> [  473.758422] ov9655 1-0030: ov9655_set_params
> [  473.763061] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  473.773529] ov9655 1-0030: OV9655 read register 0c : 00
> [  473.780181] ov9655 1-0030: OV9655 write register 0f : 40
> [  473.788604] ov9655 1-0030: OV9655 read register 12 : 02
> [  473.794891] ov9655 1-0030: OV9655 write register 3b : 05
> [  473.800933] ov9655 1-0030: OV9655 write register 40 : c0
> [  473.807708] ov9655 1-0030: SXGA
> [  473.811584] ov9655 1-0030: OV9655 read register 12 : 02
> [  473.817962] ov9655 1-0030: OV9655 write register 31 : 50
> [  473.824890] ov9655 1-0030: format->code=00002006
> [  473.830169] ov9655 1-0030: OV9655 read register 12 : 02
> [  473.837280] ov9655 1-0030: OV9655 read register 3a : 8c
> [  473.842773] ov9655 1-0030: OV9655 write register 3a : 88
> [  473.850280] ov9655 1-0030: format->field=00000001
> [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 @ 0xb5d30980]using unscaled uyvy422 -> yuv420p special converter
> VO: [x11] 1024x1280 => 1024x1280 Planar YV12 
> [swscaler @ 0xb5d30980]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...
> V:   0.0  69/ 69 ??% ??% ??,?% 0 0 $<3>
> 
> 
> MPlayer interrupted by signal 2 in module: filter_video
> [  487.030639] omap3isp 480bc000.isp: OMAP3 ISP AEWB: user wants to disable module.
> [  487.039794] omap3isp 480bc000.isp: OMAP3 ISP AEWB: module is being disabled
> [  487.048400] omap3isp 480bc000.isp: OMAP3 ISP AF: user wants to disable module.
> [  487.057159] omap3isp 480bc000.isp: OMAP3 ISP AF: module is being disabled
> [  487.064300] omap3isp 480bc000.isp: OMAP3 ISP histogram: user wants to disable module.
> [  487.073364] omap3isp 480bc000.isp: OMAP3 ISP histogram: module is being disabled
> [  487.082946] ov9655 1-0030: ov9655_s_stream(0)
> 
> v4l2: ioctl set mute failed: Inappropriate ioctl for device
> [  487.110015] ov9655 1-0030: __ov9655_set_power: on = 0
> [  487.115600] ov9655 1-0030: OV9655 power off
> v4l2: 73 frames successfully processed, 121 frames dropped.
> 
> Exiting... (Quit)

Second time:

> root at letux:~# ./camera-demo 
> DISPLAY=:0
> XAUTHORITY=tcp
> Camera: /dev/v4l-subdev8
> Setting mode sxga
> media-ctl -r
> media-ctl -l '"ov9655 1-0030":0 -> "OMAP3 ISP CCDC":0[1]'
> media-ctl -l '"OMAP3 ISP CCDC":1 -> "OMAP3 ISP CCDC output":0[1]'
> media-ctl -V '"ov9655 1-0030":0 [UYVY2X8 1280x1024]'
> [  493.045989] ov9655 1-0030: ov9655_open
> [  493.049957] ov9655 1-0030: __ov9655_set_power: on = 1
> [  493.056854] ov9655 1-0030: OV9655 power on
> [  493.108795] ov9655 1-0030: ov9655_reset
> [  493.116363] ov9655 1-0030: OV9655 write register 09 : 01
> [  493.122344] ov9655 1-0030: OV9655 write register 15 : 40
> [  493.129272] ov9655 1-0030: OV9655 write register 11 : 00
> [  493.135833] ov9655 1-0030: OV9655 write register 6b : 4a
> [  493.141754] ov9655 1-0030: ov9655_s_ctrl 9963796
> [  493.152801] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_HFLIP 0
> [  493.160278] ov9655 1-0030: OV9655 read register 1e : 00
> [  493.166778] ov9655 1-0030: ov9655_s_ctrl 9963797
> [  493.171661] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_VFLIP 0
> [  493.178833] ov9655 1-0030: OV9655 read register 1e : 00
> [  493.184326] ov9655 1-0030: ov9655_s_ctrl 10422531
> [  493.190307] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_TEST_PATTERN 0
> [  493.197906] ov9655 1-0030: OV9655 read register 0c : 00
> [  493.203796] ov9655 1-0030: OV9655 read register 8d : 00
> [  493.210144] ov9655 1-0030: ov9655_s_ctrl 9967874
> [  493.215759] ov9655 1-0030: ov9655_s_ctrl 9967875
> [  493.220611] ov9655 1-0030: ov9655_s_ctrl 9967876
> [  493.226226] ov9655 1-0030: ov9655_s_ctrl 9967877
> [  493.231140] ov9655 1-0030: ov9655_set_format
> [  493.236450] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=0 csp=0
> [  493.243469] ov9655 1-0030: __ov9655_get_pad_crop: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  493.252838] ov9655 1-0030: __ov9655_get_pad_format: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  493.262329] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  493.270080] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  493.277801] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> [  493.285888] ov9655 1-0030: ov9655_close
> [  493.289916] ov9655 1-0030: __ov9655_set_power: on = 0
> [  493.296295] ov9655 1-0030: OV9655 power off
> 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: Vi[  494.725036] ov9655 1-0030: __ov9655_set_power: on = 1
> deo 4 Linux 2 input
> author: Martin Olschewski [  494.733917] ov9655 1-0030: OV9655 power on
> <olschewski at zpr.uni-koeln.de>
> comment: first try, more to come ;-)
> [  494.788360] ov9655 1-0030: ov9655_reset
> [  494.795013] ov9655 1-0030: OV9655 write register 09 : 01
> [  494.801971] ov9655 1-0030: OV9655 write register 15 : 40
> [  494.808746] ov9655 1-0030: OV9655 write register 11 : 00
> [  494.814605] ov9655 1-0030: OV9655 write register 6b : 4a
> [  494.821380] ov9655 1-0030: ov9655_s_ctrl 9963796
> [  494.827026] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_HFLIP 0
> [  494.833190] ov9655 1-0030: OV9655 read register 1e : 00
> [  494.839538] ov9655 1-0030: ov9655_s_ctrl 9963797
> [  494.844390] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_VFLIP 0
> [  494.851409] ov9655 1-0030: OV9655 read register 1e : 00
> [  494.857666] ov9655 1-0030: ov9655_s_ctrl 10422531
> [  494.862640] ov9655 1-0030: ov9655_s_ctrl: V4L2_CID_TEST_PATTERN 0
> [  494.870239] ov9655 1-0030: OV9655 read register 0c : 00
> [  494.876892] ov9655 1-0030: OV9655 read register 8d : 00
> [  494.882385] ov9655 1-0030: ov9655_s_ctrl 9967874
> [  494.888061] ov9655 1-0030: ov9655_s_ctrl 9967875
> [  494.892913] ov9655 1-0030: ov9655_s_ctrl 9967876
> [  494.898559] ov9655 1-0030: ov9655_s_ctrl 9967877
> v4l2: ioctl get standard failed: Invalid argument
> Selected device: OMAP3 ISP CCDC output
> Capabilities:  video capture  video output  streaming
> supported norms:
> inputs: 0 = camera;
> Current input: 0
> Current format: unknown (0x0)
> tv.c: norm_from_string(pal): Bogus norm parameter, setting default.
> v4l2: ioctl enum norm failed: Inappropriate ioctl for device
> Error: Cannot set norm!
> Selected input hasn't got a tuner!
> v4l2: ioctl set mute failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> v4l2: ioctl query control failed: Inappropriate ioctl for device
> [  494.970214] ov9655 1-0030: ov9655_get_format
> [  494.974731] ov9655 1-0030: __ov9655_get_pad_format: pad=0 which=1 V4L2_SUBDEV_FORMAT_ACTIVE
> [  494.985473] ov9655 1-0030: busfmt: h=1024 w=1280 code=8198 field=1 csp=8
> 

... hangs ...

Now I have to look into differences of this log.

BR,
Nikolaus

PS: Help for testing is urgently needed...



More information about the Letux-kernel mailing list