I’m still playing around with getting the ADV7280-M chip working on the Apalis TK1.
Having done a compile and deploy with only the ADV7280-M selected from the make menuconfig
, I still have two devices listed in /dev/video
:
ls -l /dev/video*
crw-rw---- 1 root video 81, 0 May 23 12:37 /dev/video0
crw-rw---- 1 root video 81, 1 May 23 12:37 /dev/video1
I’m really unsure as to what the 2nd device is but I’m thinking it is something relating to the soc_camera_platform
device??
The following modules are installed:
root@apalis-tk1:~# lsmod
Module Size Used by
soc_camera_platform 2140 1
adv7280 3652 1
tegra_camera 22452 0
videobuf2_dma_contig 8932 1 tegra_camera
iwlmvm 134563 0
mac80211 388155 1 iwlmvm
iwlwifi 128616 1 iwlmvm
cfg80211 350450 3 iwlwifi,mac80211,iwlmvm
compat 1374 4 cfg80211,iwlwifi,mac80211,iwlmvm
apalis_tk1_k20 9016 0
Following the notes on the Antmicro website, I managed to install the modules in the correct order as follows:
modprobe videobuf2-dma-contig
modprobe adv7280
modprobe tegra_camera
Occasionally, the tegra_camera
module installs without any gripes, yet other times there are plenty of complaints:
root@apalis-tk1:~# modprobe videobuf2-dma-contig
root@apalis-tk1:~# modprobe adv7280
root@apalis-tk1:~# modprobe tegra_camera
[ 29.250226] vi vi.0: initialized
[ 29.268130] platform vi.1: Driver vi requests probe deferral
[ 29.300901] soc-camera-pdrv soc-camera-pdrv.7: Probing soc-camera-pdrv.7
[ 29.345373] probe, id=adv7280
[ 29.350655] adv7280 2-0021: chip found @ 0x42 (Tegra I2C adapter)
[ 29.362807] adv7280 2-0021: ident reg is 0x42
[ 29.379439] tegra-i2c tegra12-i2c.2: no acknowledge from address 0x21
[ 29.392564] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (UYVY) packed
[ 29.404145] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (VYUY) packed
[ 29.415816] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (YUYV) packed
[ 29.427290] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (YVYU) packed
[ 29.437904] vi vi.0: Supporting mbus format code 0x2006 using YUV420 (YU12) planar
[ 29.448733] vi vi.0: Supporting mbus format code 0x2006 using YVU420 (YV12) planar
[ 29.460235] vi vi.1: initialized
[ 29.467032] vi vi.0: Tegra camera driver loaded.
[ 29.473499] soc-camera-pdrv soc-camera-pdrv.0: Probing soc-camera-pdrv.0
[ 29.496232] vi vi.1: Supporting mbus format code 0x100e using RGBA 8-8-8-8
[ 29.505130] vi vi.1: Tegra camera driver loaded.
root@apalis-tk1:~# [ 29.514910] ------------[ cut here ]------------
[ 29.521729] WARNING: at arch/arm/mach-tegra/clock.c:303 clk_disable+0x50/0x88()
[ 29.531190] Attempting to disable clock vib.vi.c4bus with refcnt 0
[ 29.537306] Modules linked in: soc_camera_platform tegra_camera adv7280 videobuf2_dma_contig iwlmvm(O) mac80211(O) iwlwifi(O) cfg80211(O) apalis_tk1_k20 compat(O)
[ 29.557232] CPU: 1 PID: 600 Comm: v4l_id Tainted: G O 3.10.40-g19722d4-dirty #10
[ 29.567797] [<c0015494>] (unwind_backtrace+0x0/0x120) from [<c00120c0>] (show_stack+0x18/0x1c)
[ 29.578861] [<c00120c0>] (show_stack+0x18/0x1c) from [<c005852c>] (warn_slowpath_common+0x54/0x74)
[ 29.590271] [<c005852c>] (warn_slowpath_common+0x54/0x74) from [<c0058580>] (warn_slowpath_fmt+0x34/0x44)
[ 29.602360] [<c0058580>] (warn_slowpath_fmt+0x34/0x44) from [<c0023668>] (clk_disable+0x50/0x88)
[ 29.613347] [<c0023668>] (clk_disable+0x50/0x88) from [<bf17d5ec>] (vi2_clks_disable+0x3c/0x9c [tegra_camera])
[ 29.625741] [<bf17d5ec>] (vi2_clks_disable+0x3c/0x9c [tegra_camera]) from [<bf17a7a0>] (tegra_camera_deactivate+0x24/0x80 [tegra_camera])
[ 29.640309] [<bf17a7a0>] (tegra_camera_deactivate+0x24/0x80 [tegra_camera]) from [<c051c088>] (soc_camera_close+0x8c/0xe0)
[ 29.653651] [<c051c088>] (soc_camera_close+0x8c/0xe0) from [<c0507fa8>] (v4l2_release+0x38/0x70)
[ 29.664652] [<c0507fa8>] (v4l2_release+0x38/0x70) from [<c012d4ec>] (__fput+0xf0/0x1f4)
[ 29.674925] [<c012d4ec>] (__fput+0xf0/0x1f4) from [<c0079114>] (task_work_run+0xbc/0xd8)
[ 29.685119] [<c0079114>] (task_work_run+0xbc/0xd8) from [<c0011b28>] (do_work_pending+0x3b0/0x3fc)
[ 29.696184] [<c0011b28>] (do_work_pending+0x3b0/0x3fc) from [<c000e640>] (work_pending+0xc/0x20)
[ 29.706929] ---[ end trace ac6bad7bee5c0c1a ]---
When the tegra_camera
module gets installed, it brings along soc_camera_platform
with it - which I’m sure I’ve read somewhere before it not being supported on the TK1.
If I run get-device-monitor-1.0
, the following output is produced for BOTH video devices:
root@apalis-tk1:~# gst-device-monitor-1.0
Probing devices...
Device found:
name : vi
class : Video/Source
caps : video/x-raw, format=(string)YUY2, framerate=(fraction)[ 0/1, 100/1 ], width=(int)640, height=(int)576, interlace-mode=(string){ progressive, progressive }, pixel-aspect-ratio=(fraction)1/1;
video/x-raw, format=(string)UYVY, framerate=(fraction)[ 0/1, 100/1 ], width=(int)640, height=(int)576, interlace-mode=(string){ progressive, progressive }, pixel-aspect-ratio=(fraction)1/1;
video/x-raw, format=(string)I420, framerate=(fraction)[ 0/1, 100/1 ], width=(int)640, height=(int)576, interlace-mode=(string){ progressive, progressive }, pixel-aspect-ratio=(fraction)1/1;
video/x-raw, format=(string)YV12, framerate=(fraction)[ 0/1, 100/1 ], width=(int)640, height=(int)576, interlace-mode=(string){ progressive, progressive }, pixel-aspect-ratio=(fraction)1/1;
video/x-raw, format=(string)YVYU, framerate=(fraction)[ 0/1, 100/1 ], width=(int)640, height=(int)576, interlace-mode=(string){ progressive, progressive }, pixel-aspect-ratio=(fraction)1/1;
Device found:
name : vi
class : Video/Source
caps : video/x-raw, format=(string)xRGB, framerate=(fraction)[ 0/1, 100/1 ], width=(int)1280, height=(int)720, interlace-mode=(string){ progressive, progressive }, pixel-aspect-ratio=(fraction)1/1;
Ok, so far so good - or as it would seem.
One thing I haven’t mentioned is that our carrier board is headless and therefore I’m unable to bring up a camera preview window on any kind of display. As much as I’ve been able to, I’ve tested on the Ixora carrier board however as this is the CSI
version of the ADV7280
chip, I can’t use the Analog Camera Adapter board to verify.
If I attempt to capture a single raw frame from the camera, this is when the world implodes!
root@apalis-tk1:~# gst-launch-1.0 v4l2src ! 'video/x-raw,format=YUY2,width=640,height=576' ! filesink location=/tmp/frame.raw
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 204.726551] vi vi.0: MIPI calibration timeout!
[ 204.942015] vi vi.0: CSI_A syncpt timeout, syncpt = 1, err = -11
[ 204.960182] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000010
[ 204.970844] TEGRA_CSI_CSI_CILA_STATUS 0x00000040
[ 204.981057] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
[ 204.991314] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
[ 204.997249] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
[ 205.003197] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
[ 205.008907] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
[ 205.015389] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
[ 205.022015] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
[ 205.027828] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
[ 205.232992] vi vi.0: CSI_A syncpt timeout, syncpt = 2, err = -11
[ 205.247271] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000010
[ 205.256079] TEGRA_CSI_CSI_CILA_STATUS 0x00000040
[ 205.261764] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
[ 205.267525] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
[ 205.273181] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
[ 205.278888] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
[ 205.284556] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
[ 205.290897] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
[ 205.296988] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
[ 205.302357] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
[ 205.507006] vi vi.0: CSI_A syncpt timeout, syncpt = 3, err = -11
[ 205.517395] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000010
[ 205.524214] TEGRA_CSI_CSI_CILA_STATUS 0x00000040
[ 205.530961] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
[ 205.538059] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
[ 205.544868] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
[ 205.551488] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
[ 205.558300] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
[ 205.565820] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
[ 205.573297] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
[ 205.580138] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
[ 205.786993] vi vi.0: CSI_A syncpt timeout, syncpt = 4, err = -11
[ 226.799745] INFO: rcu_preempt self-detected stall on CPU { 0} (t=21000 jiffies g=12972 c=12971 q=16)
[ 226.813327] Backtrace for cpu 0 (current):
[ 226.819494] CPU: 0 PID: 719 Comm: vi.0 Tainted: G W O 3.10.40-g19722d4-dirty #10
[ 226.832286] [<c0015494>] (unwind_backtrace+0x0/0x120) from [<c00120c0>] (show_stack+0x18/0x1c)
[ 226.846321] [<c00120c0>] (show_stack+0x18/0x1c) from [<c00143c8>] (smp_send_all_cpu_backtrace+0x6c/0xd8)
[ 226.862020] [<c00143c8>] (smp_send_all_cpu_backtrace+0x6c/0xd8) from [<c00c784c>] (rcu_check_callbacks+0x250/0x6ac)
[ 226.879381] [<c00c784c>] (rcu_check_callbacks+0x250/0x6ac) from [<c0068120>] (update_process_times+0x40/0x6c)
[ 226.896817] [<c0068120>] (update_process_times+0x40/0x6c) from [<c00a9244>] (tick_sched_handle+0x5c/0x68)
[ 226.914300] [<c00a9244>] (tick_sched_handle+0x5c/0x68) from [<c00a929c>] (tick_sched_timer+0x4c/0x7c)
[ 226.932186] [<c00a929c>] (tick_sched_timer+0x4c/0x7c) from [<c007fd98>] (__run_hrtimer+0xf0/0x294)
[ 226.950591] [<c007fd98>] (__run_hrtimer+0xf0/0x294) from [<c0080800>] (hrtimer_interrupt+0x134/0x290)
[ 226.969918] [<c0080800>] (hrtimer_interrupt+0x134/0x290) from [<c056e230>] (arch_timer_handler_phys+0x30/0x38)
[ 226.990698] [<c056e230>] (arch_timer_handler_phys+0x30/0x38) from [<c00c1f94>] (handle_percpu_devid_irq+0xa0/0x1a8)
[ 227.012336] [<c00c1f94>] (handle_percpu_devid_irq+0xa0/0x1a8) from [<c00be730>] (generic_handle_irq+0x28/0x38)
[ 227.033690] [<c00be730>] (generic_handle_irq+0x28/0x38) from [<c000ef24>] (handle_IRQ+0x70/0x98)
[ 227.054069] [<c000ef24>] (handle_IRQ+0x70/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 227.074234] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 227.094285] Exception stack(0xec723dd8 to 0xec723e20)
[ 227.105090] 3dc0: 00208040 c0a660c0
[ 227.124406] 3de0: 00000000 00000000 ec722000 0000001d 00000202 fdc42000 c0b7e540 c0b42d18
[ 227.143544] 3e00: c0b42d68 fffffff5 00000000 ec723e20 c00605c0 c006063c 200f0113 ffffffff
[ 227.162591] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<c006063c>] (__do_softirq+0x94/0x288)
[ 227.181694] [<c006063c>] (__do_softirq+0x94/0x288) from [<c00608d4>] (do_softirq+0x4c/0x58)
[ 227.200894] [<c00608d4>] (do_softirq+0x4c/0x58) from [<c0060b70>] (irq_exit+0x80/0xc8)
[ 227.219605] [<c0060b70>] (irq_exit+0x80/0xc8) from [<c000ef28>] (handle_IRQ+0x74/0x98)
[ 227.238341] [<c000ef28>] (handle_IRQ+0x74/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 227.257666] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 227.276880] Exception stack(0xec723eb0 to 0xec723ef8)
[ 227.287293] 3ea0: 00000034 00000000 011cf000 fe480000
[ 227.305996] 3ec0: ee3f7410 fffffff5 00000001 ed07d010 00000007 ed07d010 00000001 fffffff5
[ 227.324522] 3ee0: c1c2e70c ec723ef8 bf17d48c bf17d498 600f0013 ffffffff
[ 227.336460] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<bf17d498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera])
[ 227.357328] [<bf17d498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera]) from [<bf17aab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera])
[ 227.381624] [<bf17aab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera]) from [<c007c938>] (kthread+0xc0/0xcc)
[ 227.403527] [<c007c938>] (kthread+0xc0/0xcc) from [<c000e698>] (ret_from_fork+0x14/0x20)
[ 227.422600]
[ 227.422600] sending IPI to all other CPUs:
This output repeats for a few minutes before ultimately, the system reboots.
Sadly, this is the final thing I need to get working for our application and so far, it’s beating me! Any help, hints, tips or advice would be greatly appreciated.