Apalis TK1 GStreamer

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.

Can you share a schematic of your board, especially connection between Apalis TK1 and adv7280-M?

Hello @dominik.tx, I am able to share the camera connection part of the schematic but unfortunately not much else.

schematic

Can you share any changes you’ve made in arch/arm/mach-tegra/board-apalis-tk1-sensors.c ?

Hello @dominik.tx, unfortunately I’m not able to access the code due to a power cut. I do remember though, swapping the MIPI channel from CSI_C to CSI_A (around line 450 of so) and that I also changed the tegra_io_dpd_disable for csia_io - I’m not sure of the line number for this. Other than that, I believe there was minimal changes necessary

Any further suggestions? I’ve attached the adv7280.c file and the board-apalis-tk1-sensors.c files:

Files

Does anything extra need to be added into the device tree in order to support the ADV7280-M?

For example, we have a CAM.RESET# signal hooked up to GPIO8. In the tegra124-apalis-gpio.dtsi, I’ve ensured that the TEGRA_GPIO(DD,2) for the GPIO8 signal is beneath the gpio-output-high branch.

Are there any CSI-related changes needed given that the ADV7280-M is on CSI_A rather than CSI_C as per your setup?

I’ve also noticed that in the tegra124-apalis-eval.dts next to the camera-pcl section, there are two profiles listed: ov4689 and imx185. Does anything need to go in here for the ADV7280-M?

Apologies if these questions are trivial, I am still learning.

Also, when attempting to save video to a filesink, the camera is still bringing down the system. This is another portion of the output:

[ 1119.534569] [<c006063c>] (__do_softirq+0x94/0x288) from [<c00608d4>] (do_softirq+0x4c/0x58)
[ 1119.542974] [<c00608d4>] (do_softirq+0x4c/0x58) from [<c0060b70>] (irq_exit+0x80/0xc8)
[ 1119.550948] [<c0060b70>] (irq_exit+0x80/0xc8) from [<c000ef28>] (handle_IRQ+0x74/0x98)
[ 1119.558919] [<c000ef28>] (handle_IRQ+0x74/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1119.567496] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1119.575963] Exception stack(0xec79beb0 to 0xec79bef8)
[ 1119.581056] bea0:                                     00000036 00000000 011cf000 fe480000
[ 1119.589274] bec0: ed6db410 fffffff5 00000001 ed09be10 00000007 ed09be10 00000001 fffffff5
[ 1119.597489] bee0: c1c2e70c ec79bef8 bf02a48c bf02a498 60070013 ffffffff
[ 1119.604187] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera])
[ 1119.614366] [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera]) from [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera])
[ 1119.627652] [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera]) from [<c007c938>] (kthread+0xc0/0xcc)
[ 1119.638583] [<c007c938>] (kthread+0xc0/0xcc) from [<c000e698>] (ret_from_fork+0x14/0x20)
[ 1119.646706] ---[ end trace 6d86811347c5621e ]---
[ 1119.651460] MSELECT error detected! status=0x3
[ 1119.655945] ------------[ cut here ]------------
[ 1119.660614] WARNING: at drivers/platform/tegra/hier_ictlr/hier_ictlr.c:55 tegra_hier_ictlr_irq_handler+0x3c/0x4c()
[ 1119.670980] Modules linked in: soc_camera_platform tegra_camera adv7280 videobuf2_dma_contig apalis_tk1_k20 [last unloaded: videobuf2_dma_contig]
[ 1119.684153] CPU: 0 PID: 1627 Comm: vi.0 Tainted: G        W    3.10.40-g19722d4-dirty #13
[ 1119.692519] [<c0015494>] (unwind_backtrace+0x0/0x120) from [<c00120c0>] (show_stack+0x18/0x1c)
[ 1119.701203] [<c00120c0>] (show_stack+0x18/0x1c) from [<c005852c>] (warn_slowpath_common+0x54/0x74)
[ 1119.710226] [<c005852c>] (warn_slowpath_common+0x54/0x74) from [<c00585f4>] (warn_slowpath_null+0x20/0x28)
[ 1119.719940] [<c00585f4>] (warn_slowpath_null+0x20/0x28) from [<c0585288>] (tegra_hier_ictlr_irq_handler+0x3c/0x4c)
[ 1119.730351] [<c0585288>] (tegra_hier_ictlr_irq_handler+0x3c/0x4c) from [<c00bee40>] (handle_irq_event_percpu+0x74/0x288)
[ 1119.741281] [<c00bee40>] (handle_irq_event_percpu+0x74/0x288) from [<c00bf098>] (handle_irq_event+0x44/0x64)
[ 1119.751162] [<c00bf098>] (handle_irq_event+0x44/0x64) from [<c00c1e34>] (handle_fasteoi_irq+0xbc/0x104)
[ 1119.760612] [<c00c1e34>] (handle_fasteoi_irq+0xbc/0x104) from [<c00be730>] (generic_handle_irq+0x28/0x38)
[ 1119.770238] [<c00be730>] (generic_handle_irq+0x28/0x38) from [<c000ef24>] (handle_IRQ+0x70/0x98)
[ 1119.779078] [<c000ef24>] (handle_IRQ+0x70/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1119.787657] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1119.796124] Exception stack(0xec79bdd8 to 0xec79be20)
[ 1119.801214] bdc0:                                                       00208040 c0a660c0
[ 1119.809435] bde0: 00000000 00000000 ec79a000 0000001d 00000202 fdc42000 c0b7e540 c0b42d18
[ 1119.817655] be00: c0b42d68 fffffff5 00000000 ec79be20 c00605c0 c006063c 20070113 ffffffff
[ 1119.825893] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<c006063c>] (__do_softirq+0x94/0x288)
[ 1119.834214] [<c006063c>] (__do_softirq+0x94/0x288) from [<c00608d4>] (do_softirq+0x4c/0x58)
[ 1119.842617] [<c00608d4>] (do_softirq+0x4c/0x58) from [<c0060b70>] (irq_exit+0x80/0xc8)
[ 1119.850591] [<c0060b70>] (irq_exit+0x80/0xc8) from [<c000ef28>] (handle_IRQ+0x74/0x98)
[ 1119.858563] [<c000ef28>] (handle_IRQ+0x74/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1119.867139] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1119.875607] Exception stack(0xec79beb0 to 0xec79bef8)
[ 1119.880701] bea0:                                     00000036 00000000 011cf000 fe480000
[ 1119.888920] bec0: ed6db410 fffffff5 00000001 ed09be10 00000007 ed09be10 00000001 fffffff5
[ 1119.897137] bee0: c1c2e70c ec79bef8 bf02a48c bf02a498 60070013 ffffffff
[ 1119.903833] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera])
[ 1119.914010] [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera]) from [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera])
[ 1119.927297] [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera]) from [<c007c938>] (kthread+0xc0/0xcc)
[ 1119.938227] [<c007c938>] (kthread+0xc0/0xcc) from [<c000e698>] (ret_from_fork+0x14/0x20)
[ 1119.946349] ---[ end trace 6d86811347c5621f ]---
[ 1119.951139] MSELECT error detected! status=0x3
[ 1119.955626] ------------[ cut here ]------------
[ 1119.960297] WARNING: at drivers/platform/tegra/hier_ictlr/hier_ictlr.c:55 tegra_hier_ictlr_irq_handler+0x3c/0x4c()
[ 1119.970664] Modules linked in: soc_camera_platform tegra_camera adv7280 videobuf2_dma_contig apalis_tk1_k20 [last unloaded: videobuf2_dma_contig]
[ 1119.983837] CPU: 0 PID: 1627 Comm: vi.0 Tainted: G        W    3.10.40-g19722d4-dirty #13
[ 1119.992203] [<c0015494>] (unwind_backtrace+0x0/0x120) from [<c00120c0>] (show_stack+0x18/0x1c)
[ 1120.000887] [<c00120c0>] (show_stack+0x18/0x1c) from [<c005852c>] (warn_slowpath_common+0x54/0x74)
[ 1120.009911] [<c005852c>] (warn_slowpath_common+0x54/0x74) from [<c00585f4>] (warn_slowpath_null+0x20/0x28)
[ 1120.019624] [<c00585f4>] (warn_slowpath_null+0x20/0x28) from [<c0585288>] (tegra_hier_ictlr_irq_handler+0x3c/0x4c)
[ 1120.030036] [<c0585288>] (tegra_hier_ictlr_irq_handler+0x3c/0x4c) from [<c00bee40>] (handle_irq_event_percpu+0x74/0x288)
[ 1120.040964] [<c00bee40>] (handle_irq_event_percpu+0x74/0x288) from [<c00bf098>] (handle_irq_event+0x44/0x64)
[ 1120.050846] [<c00bf098>] (handle_irq_event+0x44/0x64) from [<c00c1e34>] (handle_fasteoi_irq+0xbc/0x104)
[ 1120.060296] [<c00c1e34>] (handle_fasteoi_irq+0xbc/0x104) from [<c00be730>] (generic_handle_irq+0x28/0x38)
[ 1120.069924] [<c00be730>] (generic_handle_irq+0x28/0x38) from [<c000ef24>] (handle_IRQ+0x70/0x98)
[ 1120.078764] [<c000ef24>] (handle_IRQ+0x70/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1120.087342] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1120.095810] Exception stack(0xec79bdd8 to 0xec79be20)
[ 1120.100902] bdc0:                                                       00208040 c0a660c0
[ 1120.109122] bde0: 00000000 00000000 ec79a000 0000001d 00000202 fdc42000 c0b7e540 c0b42d18
[ 1120.117343] be00: c0b42d68 fffffff5 00000000 ec79be20 c00605c0 c006063c 20070113 ffffffff
[ 1120.125581] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<c006063c>] (__do_softirq+0x94/0x288)
[ 1120.133901] [<c006063c>] (__do_softirq+0x94/0x288) from [<c00608d4>] (do_softirq+0x4c/0x58)
[ 1120.142306] [<c00608d4>] (do_softirq+0x4c/0x58) from [<c0060b70>] (irq_exit+0x80/0xc8)
[ 1120.150281] [<c0060b70>] (irq_exit+0x80/0xc8) from [<c000ef28>] (handle_IRQ+0x74/0x98)
[ 1120.158252] [<c000ef28>] (handle_IRQ+0x74/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1120.166829] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1120.175297] Exception stack(0xec79beb0 to 0xec79bef8)
[ 1120.180389] bea0:                                     00000036 00000000 011cf000 fe480000
[ 1120.188608] bec0: ed6db410 fffffff5 00000001 ed09be10 00000007 ed09be10 00000001 fffffff5
[ 1120.196824] bee0: c1c2e70c ec79bef8 bf02a48c bf02a498 60070013 ffffffff
[ 1120.203520] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera])
[ 1120.213698] [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera]) from [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera])
[ 1120.226985] [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera]) from [<c007c938>] (kthread+0xc0/0xcc)
[ 1120.237916] [<c007c938>] (kthread+0xc0/0xcc) from [<c000e698>] (ret_from_fork+0x14/0x20)
[ 1120.246041] ---[ end trace 6d86811347c56220 ]---
[ 1120.250839] MSELECT error detected! status=0x3
[ 1120.255325] ------------[ cut here ]------------
[ 1120.259994] WARNING: at drivers/platform/tegra/hier_ictlr/hier_ictlr.c:55 tegra_hier_ictlr_irq_handler+0x3c/0x4c()
[ 1120.270361] Modules linked in: soc_camera_platform tegra_camera adv7280 videobuf2_dma_contig apalis_tk1_k20 [last unloaded: videobuf2_dma_contig]
[ 1120.283540] CPU: 0 PID: 1627 Comm: vi.0 Tainted: G        W    3.10.40-g19722d4-dirty #13
[ 1120.291909] [<c0015494>] (unwind_backtrace+0x0/0x120) from [<c00120c0>] (show_stack+0x18/0x1c)
[ 1120.300592] [<c00120c0>] (show_stack+0x18/0x1c) from [<c005852c>] (warn_slowpath_common+0x54/0x74)
[ 1120.309616] [<c005852c>] (warn_slowpath_common+0x54/0x74) from [<c00585f4>] (warn_slowpath_null+0x20/0x28)
[ 1120.319328] [<c00585f4>] (warn_slowpath_null+0x20/0x28) from [<c0585288>] (tegra_hier_ictlr_irq_handler+0x3c/0x4c)
[ 1120.329739] [<c0585288>] (tegra_hier_ictlr_irq_handler+0x3c/0x4c) from [<c00bee40>] (handle_irq_event_percpu+0x74/0x288)
[ 1120.340669] [<c00bee40>] (handle_irq_event_percpu+0x74/0x288) from [<c00bf098>] (handle_irq_event+0x44/0x64)
[ 1120.350552] [<c00bf098>] (handle_irq_event+0x44/0x64) from [<c00c1e34>] (handle_fasteoi_irq+0xbc/0x104)
[ 1120.360000] [<c00c1e34>] (handle_fasteoi_irq+0xbc/0x104) from [<c00be730>] (generic_handle_irq+0x28/0x38)
[ 1120.369628] [<c00be730>] (generic_handle_irq+0x28/0x38) from [<c000ef24>] (handle_IRQ+0x70/0x98)
[ 1120.378467] [<c000ef24>] (handle_IRQ+0x70/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1120.387046] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1120.395515] Exception stack(0xec79bdd8 to 0xec79be20)
[ 1120.400606] bdc0:                                                       00208040 c0a660c0
[ 1120.408827] bde0: 00000000 00000000 ec79a000 0000001d 00000202 fdc42000 c0b7e540 c0b42d18
[ 1120.417045] be00: c0b42d68 fffffff5 00000000 ec79be20 c00605c0 c006063c 20070113 ffffffff
[ 1120.425284] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<c006063c>] (__do_softirq+0x94/0x288)
[ 1120.433603] [<c006063c>] (__do_softirq+0x94/0x288) from [<c00608d4>] (do_softirq+0x4c/0x58)
[ 1120.442006] [<c00608d4>] (do_softirq+0x4c/0x58) from [<c0060b70>] (irq_exit+0x80/0xc8)
[ 1120.449981] [<c0060b70>] (irq_exit+0x80/0xc8) from [<c000ef28>] (handle_IRQ+0x74/0x98)
[ 1120.457953] [<c000ef28>] (handle_IRQ+0x74/0x98) from [<c00084c0>] (gic_handle_irq+0x50/0x158)
[ 1120.466530] [<c00084c0>] (gic_handle_irq+0x50/0x158) from [<c000e1c0>] (__irq_svc+0x40/0x70)
[ 1120.474998] Exception stack(0xec79beb0 to 0xec79bef8)
[ 1120.480092] bea0:                                     00000036 00000000 011cf000 fe480000
[ 1120.488310] bec0: ed6db410 fffffff5 00000001 ed09be10 00000007 ed09be10 00000001 fffffff5
[ 1120.496524] bee0: c1c2e70c ec79bef8 bf02a48c bf02a498 60070013 ffffffff
[ 1120.503222] [<c000e1c0>] (__irq_svc+0x40/0x70) from [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera])
[ 1120.513402] [<bf02a498>] (vi2_capture_start+0x3d8/0x4f0 [tegra_camera]) from [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera])
[ 1120.526689] [<bf027ab4>] (tegra_camera_kthread_capture+0x1a0/0x2e4 [tegra_camera]) from [<c007c938>] (kthread+0xc0/0xcc)
[ 1120.537619] [<c007c938>] (kthread+0xc0/0xcc) from [<c000e698>] (ret_from_fork+0x14/0x20)
[ 1120.545743] ---[ end trace 6d86811347c56221 ]---
[ 1120.550501] MSELECT error detected! status=0x3
[ 1120.554986] ------------[ cut here ]------------
[ 1120.559657] WARNING: at drivers/platform/tegra/hier_ictlr/hier_ictlr.c:55 tegra_hier_ictlr_irq_handler+0x3c/0x4c()
[ 1120.570026] Modules linked in: soc_camera_platform tegra_camera adv7280 videobuf2_dma_contig apalis_tk1_k20 [last unloaded: videobuf2_dma_contig]
[ 1120.5832þ

Having done some extensive research on the NVIDIA forums based around the MSELECT error detected! status=0x3 message, a number of users are reporting bugs in the Linux kernel. Has the Toradex team seen anything like this before?

A little bit of progres…

Having updated the sources to 2.7b and doing the necessary tweaks to the board-apalis-tk1-sensors.c to change the MIPI CSI channel and GPIO, I am now able to attempt to gst-launch without bringing down the entire system.

I’m still getting errors but now I’m seeing:

root@apalis-tk1:~# gst-launch-1.0 v4l2src
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
[ 1433.259507] vi vi.0: Failed to create debugfs directory
[ 1433.465424] vi vi.0: CSI_A syncpt timeout, syncpt = 20, err = -11
ERROR: from element /GstPipeline:pipelin[ 1433.476639] TEGRA_CSI_CSI_CIL_A_STATUS 0x00000000
e0/GstV4l2Src:v4l2src0: Internal data fl[ 1433.484619] TEGRA_CSI_CSI_CILA_STATUS 0x00000000
ow error.
Additional debug info:
../..[ 1433.492753] TEGRA_CSI_CSI_CIL_B_STATUS 0x00000000
/../../gstreamer-1.8.3/libs/gst/base/gst[ 1433.500963] TEGRA_CSI_CSI_CIL_C_STATUS 0x00000000
basesrc.c(2948): gst_base_src_loop (): /[ 1433.509178] TEGRA_CSI_CSI_CIL_D_STATUS 0x00000000
GstPipeline:pipeline0/GstV4l2Src:v4l2src[ 1433.517393] TEGRA_CSI_CSI_CIL_E_STATUS 0x00000000
0:
streaming task paused, reason not-li[ 1433.525669] TEGRA_CSI_CSI_PIXEL_PARSER_A_STATUS 0x00000000
nked (-1)
Execution ended after 0:00:00[ 1433.534958] TEGRA_CSI_CSI_PIXEL_PARSER_B_STATUS 0x00000000
.225489953
Setting pipeline to PAUSED .[ 1433.543811] TEGRA_VI_CSI_0_ERROR_STATUS 0x00000000
..
Setting pipeline to READY ..[ 1433.551665] TEGRA_VI_CSI_1_ERROR_STATUS 0x00000000
.
Setting pipeline to NULL ...
Freeing pipeline ...
root@apalis-tk1:~#

You definitely need to use our latest kernel to get stable adv7280 support. We’e tried TK1 with adv7280m over CSI-A and managed to get it to work by doing very similar modifications to the board-apalis-tk1-sensors.c file.
We’ve seen the same crash when there was no analog video signal on the adv7280m input, so make sure there’s an active video source.

@dominik.tx, I’m now using your latest 2.7b2 kernel. I will investigate the analog side of things tomorrow to check that the video source is OK - I do remember briefly checking on an oscilloscope and it seemed ok.

One thing I’m still a little puzzled by is /dev/video0 and /dev/video1 - why I have two devices when only the adv7280 module is loaded. I’m assuming that /dev/video0 is the device I need to use but I’m confused where the second device is coming from.

It’s a side effect of a way camera system gets initialised. If you can, use oscilloscope to verify if CSI clock and data signals are active when running gstreamer.

Thanks @dominik.tx. Out of curiosity, what arguments have you passed into gst-launch-1.0 when running the adv7280 as I am never really sure what to pass

The following patch which configures continuous_clk, TEGRA_CAMERA_PORT_CSI_A and tegra_io_dpd_disable(&csia_io) applied to our current toradex_tk1_l4t_r21.5-next works with our ADV7280M modified ACA on Ixora V1.1A after loading the following kernel modules and then issuing the gstreamer pipeline as given:

root@apalis-tk1:~# modprobe videobuf2-dma-contig
root@apalis-tk1:~# modprobe adv7280
root@apalis-tk1:~# modprobe tegra_camera
[   47.077900] vi vi.0: initialized
[   47.099332] platform vi.1: Driver vi requests probe deferral
[   47.107887] soc-camera-pdrv soc-camera-pdrv.8: Probing soc-camera-pdrv.8
[   47.120548] probe, id=adv7280
[   47.125059] adv7280 2-0020: chip found @ 0x40 (Tegra I2C adapter)
[   47.136886] adv7280 2-0020: ident reg is 0x42
[   47.160801] vi vi.1: initialized
[   47.167711] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (UYVY) packed
[   47.190231] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (VYUY) packed
[   47.199173] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (YUYV) packed
[   47.207897] vi vi.0: Supporting mbus format code 0x2006 using YUV422 (YVYU) packed
[   47.216453] vi vi.0: Supporting mbus format code 0x2006 using YUV420 (YU12) planar
[   47.224758] vi vi.0: Supporting mbus format code 0x2006 using YVU420 (YV12) planar
[   47.235367] vi vi.1: Tegra camera driver loaded.
[   47.240990] vi vi.0: Tegra camera driver loaded.
root@apalis-tk1:~# gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw,format={UYVY}' ! xvimagesink

Hi @marcel.tx, that’s perfect - thank you for both the patch file and the the gst-launch arguments. The patch file at least confirmed that the alterations I had made to the board-apalis-tk1-sensors.c file were correct and inline with your changes.

I’ve successfully managed to retrieve a video feed on our carrier board. Thank you for this.