public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* omap3-isp : panic using previewer from V4L input
@ 2013-05-06  8:59 jean-philippe francois
  2013-05-07 11:56 ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: jean-philippe francois @ 2013-05-06  8:59 UTC (permalink / raw)
  To: linux-media; +Cc: Laurent Pinchart

[-- Attachment #1: Type: text/plain, Size: 753 bytes --]

Hi,

I am trying to use the previewer to debayer pictures coming from the
filesystem instead of the capture hardware. The media-ctl links are as
follows :

preview V4L input -> preview pad 0 (sink), preview pad 1(src)
->preview V4L output.

Input output format is set via media-ctl for the preview element, and
via the V4L2 api for the V4L2 file descriptors. I am using USERPTR
buffer allocated via memalign, and the application goes like this :

REQBUFS 1 buf on on input
REQBUFS 1 buf on output
alloc buffers
QBUF on input
QBUF on output
STREAMON on output
STREAMON on input
DQBUF on output.

The board either panics or hangs (though HUNG_TASK_DETECTION and
SOFT_LOCKUP_DETECTION is set)

Please find attached the panic log, and the application code.

[-- Attachment #2: session.log --]
[-- Type: application/octet-stream, Size: 5038 bytes --]

[-- Attachment #3: omapdebayer.c --]
[-- Type: text/x-csrc, Size: 4620 bytes --]

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/ioctl.h>
#include <linux/videodev2.h>
#include <malloc.h>
#include "videobuf.h"

#define WIDTH 3664
#define HEIGHT 2752

const char * v4l2_input = "/dev/video3";
const char * v4l2_output = "/dev/video4";

vbuf_desc ibuf;
vbuf_desc obuf;

#define XIOCTL(fd, name, data) do {				\
		int rc;									\
		rc = ioctl(fd, name, data);				\
		if(rc < 0) {							\
			perror(#name);						\
			exit(EXIT_FAILURE);					\
		}										\
	} while(0)

static long filesize(FILE * stream) 
{
	long offs;
	fseek(stream, 0, SEEK_END);
	offs = ftell(stream);
	rewind(stream);
	return offs;
}

int main(int argc, char **argv)
{
	int ifd, ofd;
	FILE * istream,  * ostream;
	struct v4l2_format fmt;
	struct v4l2_pix_format ipfmt;
	struct v4l2_pix_format opfmt;
    struct v4l2_requestbuffers  req;
	struct v4l2_buffer v4l2buf;
	unsigned char * line;
	char * fname;
	long fsize;
	int l;

	// open video fds
	ifd = open(v4l2_input, O_RDWR);
	if(ifd < 0) {
		perror(v4l2_input);
		exit(EXIT_FAILURE);
	}

	ofd = open(v4l2_output, O_RDWR);
	if(ofd < 0) {
		perror(v4l2_output);
		exit(EXIT_FAILURE);
	}

	// get / set input pixel format at SBGGR10
	fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
	ipfmt.width = WIDTH;
	ipfmt.height = HEIGHT;
	fmt.fmt.pix = ipfmt;
	XIOCTL(ifd, VIDIOC_TRY_FMT, &fmt);
	ipfmt = fmt.fmt.pix;

	printf("input is %d x %d\n", ipfmt.width, ipfmt.height);
	XIOCTL(ifd, VIDIOC_S_FMT, &fmt);
	printf("bytesperline is %d\n",ipfmt.bytesperline);
	printf("sizeimage is %d\n",ipfmt.sizeimage);
	// allocate input buffer
	// allocate output buffer via malloc
	ibuf.length = ipfmt.sizeimage;
	ibuf.usrptr = memalign(32, ibuf.length);
	line = malloc(ipfmt.width);

	// request buffer in driver
	req.count = 1;
	req.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
	req.memory = V4L2_MEMORY_USERPTR;
	XIOCTL(ifd, VIDIOC_REQBUFS, &req);



	// get / set output pixel format
	fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
	XIOCTL(ofd, VIDIOC_TRY_FMT, &fmt);
	opfmt = fmt.fmt.pix;
	printf("output is %d x %d\n", opfmt.width, opfmt.height);
	printf("bytesperline is %d\n",opfmt.bytesperline);
	printf("sizeimage is %d\n",opfmt.sizeimage);
	XIOCTL(ofd, VIDIOC_S_FMT, &fmt);

	// allocate output buffer via malloc
	obuf.length = fmt.fmt.pix.sizeimage;
	obuf.usrptr = memalign(32, obuf.length);

	req.count = 1;
	req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
	req.memory = V4L2_MEMORY_USERPTR;
	XIOCTL(ofd, VIDIOC_REQBUFS, &req);


	// open input file
	if(argc < 2) {
		printf("please provide a input file to debayer");
	}
	fname = argv[1];
	printf("Opening %s for debayering\n", fname);
	istream = fopen(fname, "r");
	if(!istream) {
		perror(fname);
		exit(EXIT_FAILURE);
	}

	fsize = filesize(istream);
	if(fsize != ipfmt.width * ipfmt.height) {
		if(fsize < ipfmt.width * ipfmt.height) {
			printf("File is too short fot current input : %d < %d\n", fsize, ipfmt.width * ipfmt.height);
			exit(EXIT_FAILURE);
		} else {
			printf("Warning : too many data in input file\n");
		}
	}


	// read 8 bit pixel line
	for(l =  0; l < ipfmt.height; l++) {
		int idx;
		fread(line, 1, ipfmt.width, istream);
		// transform and store 8 bit input line to 10 bit in input buffer
		for(idx = 0; idx < ipfmt.width; idx++) {
			unsigned short * pix;
			pix = (unsigned short *)&ibuf.usrptr[l * ipfmt.bytesperline + idx * 2];
			*pix = line[idx] * 4;
		}
	}
	

	// queue input buf, queue output buf
	v4l2buf.index = 0;
	v4l2buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
	v4l2buf.memory = V4L2_MEMORY_USERPTR;
	v4l2buf.m.userptr = ibuf.usrptr;
	v4l2buf.length = ibuf.length;
	printf("usrptr = 0x%x \n", v4l2buf.m.userptr);
	printf("v4l2buf.length = %d\n",ibuf.length);
	XIOCTL(ifd, VIDIOC_QBUF, &v4l2buf);
	printf("input buffer queued\n");

	v4l2buf.index = 0;
	v4l2buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
	v4l2buf.memory = V4L2_MEMORY_USERPTR;
	v4l2buf.m.userptr = obuf.usrptr;
	v4l2buf.length = obuf.length;
	XIOCTL(ofd, VIDIOC_QBUF, &v4l2buf);
	printf("output buffer queued\n");

	// streamon
	XIOCTL(ofd, VIDIOC_STREAMON, &v4l2buf.type);
	//printf("output streamon\n");
	v4l2buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
	XIOCTL(ifd, VIDIOC_STREAMON, &v4l2buf.type);
	//printf("input streamon\n");
	// dequeue output buffer
	v4l2buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
	XIOCTL(ofd, VIDIOC_DQBUF, &v4l2buf);

	// store buffer data in output file 
	ostream = fopen("output.yuv", "w");
	for(l = 0; l < opfmt.height; l++) {
		fwrite(&obuf.usrptr[l*opfmt.width*2], 2, opfmt.width, ostream);
	}
	fclose(ostream);
	return 0;
}

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: omap3-isp : panic using previewer from V4L input
  2013-05-06  8:59 omap3-isp : panic using previewer from V4L input jean-philippe francois
@ 2013-05-07 11:56 ` Laurent Pinchart
  2013-05-07 12:41   ` jean-philippe francois
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2013-05-07 11:56 UTC (permalink / raw)
  To: jean-philippe francois; +Cc: linux-media, linux-omap

Hi Jean-Philippe,

(CC'ed linux-omap)

On Monday 06 May 2013 10:59:07 jean-philippe francois wrote:
> Hi,
> 
> I am trying to use the previewer to debayer pictures coming from the
> filesystem instead of the capture hardware. The media-ctl links are as
> follows :
> 
> preview V4L input -> preview pad 0 (sink), preview pad 1(src)
> ->preview V4L output.
> 
> Input output format is set via media-ctl for the preview element, and
> via the V4L2 api for the V4L2 file descriptors. I am using USERPTR
> buffer allocated via memalign, and the application goes like this :
> 
> REQBUFS 1 buf on on input
> REQBUFS 1 buf on output
> alloc buffers
> QBUF on input
> QBUF on output
> STREAMON on output
> STREAMON on input
> DQBUF on output.
> 
> The board either panics or hangs (though HUNG_TASK_DETECTION and
> SOFT_LOCKUP_DETECTION is set)

Does it happen every time you run the application, including on the first run 
after a cold boot ?

> Please find attached the panic log, and the application code.

(log inlined)

> omap3isp omap3isp: can't find source, failing now
> omap3isp omap3isp: can't find source, failing now

Those are harmless warnings. I have a fix for them, I'll repost it.

> ------------[ cut here ]------------
> Kernel BUG at c019bb1c [verbose debug info unavailable]
> Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
> Modules linked in: omap3_isp ov10630(O)
> CPU: 0    Tainted: G           O  (3.9.0 #3)
> PC is at omap3_l3_app_irq+0x3c/0xbc

L3 APP interconnect timeout errors are not supposed to happen. This is the 
first time I see one. Maybe someone on the linux-omap list will have some 
clues regarding how to debug this.

> LR is at handle_irq_event_percpu+0x28/0x10c
> pc : [<c019bb1c>]    lr : [<c006b354>]    psr: 20000193
> sp : c0507e58  ip : 00060000  fp : 00000000
> r10: cf804dc0  r9 : ffff9e65  r8 : 00200000
> r7 : 00000000  r6 : 00001000  r5 : 00000000  r4 : cf87f3c0
> r3 : 00000000  r2 : 00001000  r1 : cf8ffc80  r0 : 00001000
> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
> Control: 10c5387d  Table: 8fa80019  DAC: 00000015
> Process swapper (pid: 0, stack limit = 0xc0506230)
> Stack: (0xc0507e58 to 0xc0508000)
> 7e40:                                                      00000002 cf87f3c0
> 7e60:0000001a 00000000 00000000 c006b354 cf804dc0 cf87f3c0 cf804dc0 c0506000
> 7e80:cf87f3c0 c0507f0c 00200000 ffff9e65 c054d640 c006b490 cf804dc0 c0507f80
> 7ea0:ffffffff c006da68 0000001a c006ac44 0000001a c000ebc8 0000000a c0507ed8
> 7ec0:0000001a c0008594 c054d600 c003400c 60000113 c000df00 00000001 c054d600
> 7ee0:00000101 c0506000 00000002 00000000 ffffffff c0507fb4 00200000 ffff9e65
> 7f00:c054d640 00000000 c0526f28 c0507f20 c054d600 c003400c 60000113 ffffffff
> 7f20:cf805c40 c0506000 c0511c98 c0507fb4 80004059 00000035 00000000 ffffffff
> 7f40:c0507fb4 80004059 413fc082 00000000 00000000 c003440c 00000035 c000ebcc
> 7f60:00000025 c0507f80 00000035 c0008594 c0506008 c000ed78 20000013 c000df00
> 7f80:c0547548 c050fb50 00000001 c0506000 c050e0d8 00000000 c04fb954 c0510844
> 7fa0:80004059 413fc082 00000000 00000000 00000000 c0507fc8 c0506008 c000ed78
> 7fc0:20000013 ffffffff c036c958 c04da7a8 ffffffff ffffffff c04da344 00000000
> 7fe0:c04fb958 271ae41c 00000000 10c53c7d c050e028 80008070 00000000 00000000
> [<c019bb1c>] (omap3_l3_app_irq+0x3c/0xbc)
> from [<c006b354>] (handle_irq_event_percpu+0x28/0x10c)
> [<c006b354>] (handle_irq_event_percpu+0x28/0x10c)
> from [<c006b490>] (handle_irq_event+0x58/0x74)
> [<c006b490>] (handle_irq_event+0x58/0x74)
> from [<c006da68>] (handle_level_irq+0xd8/0x110)
> [<c006da68>] (handle_level_irq+0xd8/0x110)
> from [<c006ac44>] (generic_handle_irq+0x20/0x30)
> [<c006ac44>] (generic_handle_irq+0x20/0x30)
> from [<c000ebc8>] (handle_IRQ+0x60/0x84)
> [<c000ebc8>] (handle_IRQ+0x60/0x84)
> from [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
> [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
> from [<c000df00>] (__irq_svc+0x40/0x70)
> Exception stack(0xc0507ed8 to 0xc0507f20)
> 7ec0:                                                      00000001 c054d600
> 7ee0:00000101 c0506000 00000002 00000000 ffffffff c0507fb4 00200000 ffff9e65
> 7f00:c054d640 00000000 c0526f28 c0507f20 c054d600 c003400c 60000113 ffffffff
> [<c000df00>] (__irq_svc+0x40/0x70)
> from [<c003400c>] (__do_softirq+0x60/0x184)
> [<c003400c>] (__do_softirq+0x60/0x184)
> from [<c003440c>] (irq_exit+0x70/0xc4)
> [<c003440c>] (irq_exit+0x70/0xc4)
> from [<c000ebcc>] (handle_IRQ+0x64/0x84)
> [<c000ebcc>] (handle_IRQ+0x64/0x84)
> from [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
> [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
> from [<c000df00>] (__irq_svc+0x40/0x70)
> Exception stack(0xc0507f80 to 0xc0507fc8)
> 7f80:c0547548 c050fb50 00000001 c0506000 c050e0d8 00000000 c04fb954 c0510844
> 7fa0:80004059 413fc082 00000000 00000000 00000000 c0507fc8 c0506008 c000ed78
> 7fc0:20000013 ffffffff
> [<c000df00>] (__irq_svc+0x40/0x70) from [<c000ed78>] (cpu_idle+0x60/0x90)
> [<c000ed78>] (cpu_idle+0x60/0x90)
> from [<c04da7a8>] (start_kernel+0x234/0x284)
> Code: e0022006 e0033007 e1920003 0a000002 (e7f001f2)
> ---[ end trace 58d781a6c1166535 ]---
> Kernel panic - not syncing: Fatal exception in interrupt

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: omap3-isp : panic using previewer from V4L input
  2013-05-07 11:56 ` Laurent Pinchart
@ 2013-05-07 12:41   ` jean-philippe francois
  2013-05-14  9:29     ` jean-philippe francois
  0 siblings, 1 reply; 5+ messages in thread
From: jean-philippe francois @ 2013-05-07 12:41 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media, linux-omap@vger.kernel.org

2013/5/7 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
> Hi Jean-Philippe,
>
> (CC'ed linux-omap)
>
> On Monday 06 May 2013 10:59:07 jean-philippe francois wrote:
>> Hi,
>>
>> I am trying to use the previewer to debayer pictures coming from the
>> filesystem instead of the capture hardware. The media-ctl links are as
>> follows :
>>
>> preview V4L input -> preview pad 0 (sink), preview pad 1(src)
>> ->preview V4L output.
>>
>> Input output format is set via media-ctl for the preview element, and
>> via the V4L2 api for the V4L2 file descriptors. I am using USERPTR
>> buffer allocated via memalign, and the application goes like this :
>>
>> REQBUFS 1 buf on on input
>> REQBUFS 1 buf on output
>> alloc buffers
>> QBUF on input
>> QBUF on output
>> STREAMON on output
>> STREAMON on input
>> DQBUF on output.
>>
>> The board either panics or hangs (though HUNG_TASK_DETECTION and
>> SOFT_LOCKUP_DETECTION is set)
>
> Does it happen every time you run the application, including on the first run
> after a cold boot ?

Yes, every time.
Previewer usage in device to memory mode works fine.
Tested on 3.6.11 and 3.9 with the same results.
The only difference observed so far between runs is that sometimes
the board hangs without anything printed on the console.

>
>> Please find attached the panic log, and the application code.
>
> (log inlined)
>
>> omap3isp omap3isp: can't find source, failing now
>> omap3isp omap3isp: can't find source, failing now
>
> Those are harmless warnings. I have a fix for them, I'll repost it.
>
>> ------------[ cut here ]------------
>> Kernel BUG at c019bb1c [verbose debug info unavailable]
>> Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
>> Modules linked in: omap3_isp ov10630(O)
>> CPU: 0    Tainted: G           O  (3.9.0 #3)
>> PC is at omap3_l3_app_irq+0x3c/0xbc
>
> L3 APP interconnect timeout errors are not supposed to happen. This is the
> first time I see one. Maybe someone on the linux-omap list will have some
> clues regarding how to debug this.
>
>> LR is at handle_irq_event_percpu+0x28/0x10c
>> pc : [<c019bb1c>]    lr : [<c006b354>]    psr: 20000193
>> sp : c0507e58  ip : 00060000  fp : 00000000
>> r10: cf804dc0  r9 : ffff9e65  r8 : 00200000
>> r7 : 00000000  r6 : 00001000  r5 : 00000000  r4 : cf87f3c0
>> r3 : 00000000  r2 : 00001000  r1 : cf8ffc80  r0 : 00001000
>> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
>> Control: 10c5387d  Table: 8fa80019  DAC: 00000015
>> Process swapper (pid: 0, stack limit = 0xc0506230)
>> Stack: (0xc0507e58 to 0xc0508000)
>> 7e40:                                                      00000002 cf87f3c0
>> 7e60:0000001a 00000000 00000000 c006b354 cf804dc0 cf87f3c0 cf804dc0 c0506000
>> 7e80:cf87f3c0 c0507f0c 00200000 ffff9e65 c054d640 c006b490 cf804dc0 c0507f80
>> 7ea0:ffffffff c006da68 0000001a c006ac44 0000001a c000ebc8 0000000a c0507ed8
>> 7ec0:0000001a c0008594 c054d600 c003400c 60000113 c000df00 00000001 c054d600
>> 7ee0:00000101 c0506000 00000002 00000000 ffffffff c0507fb4 00200000 ffff9e65
>> 7f00:c054d640 00000000 c0526f28 c0507f20 c054d600 c003400c 60000113 ffffffff
>> 7f20:cf805c40 c0506000 c0511c98 c0507fb4 80004059 00000035 00000000 ffffffff
>> 7f40:c0507fb4 80004059 413fc082 00000000 00000000 c003440c 00000035 c000ebcc
>> 7f60:00000025 c0507f80 00000035 c0008594 c0506008 c000ed78 20000013 c000df00
>> 7f80:c0547548 c050fb50 00000001 c0506000 c050e0d8 00000000 c04fb954 c0510844
>> 7fa0:80004059 413fc082 00000000 00000000 00000000 c0507fc8 c0506008 c000ed78
>> 7fc0:20000013 ffffffff c036c958 c04da7a8 ffffffff ffffffff c04da344 00000000
>> 7fe0:c04fb958 271ae41c 00000000 10c53c7d c050e028 80008070 00000000 00000000
>> [<c019bb1c>] (omap3_l3_app_irq+0x3c/0xbc)
>> from [<c006b354>] (handle_irq_event_percpu+0x28/0x10c)
>> [<c006b354>] (handle_irq_event_percpu+0x28/0x10c)
>> from [<c006b490>] (handle_irq_event+0x58/0x74)
>> [<c006b490>] (handle_irq_event+0x58/0x74)
>> from [<c006da68>] (handle_level_irq+0xd8/0x110)
>> [<c006da68>] (handle_level_irq+0xd8/0x110)
>> from [<c006ac44>] (generic_handle_irq+0x20/0x30)
>> [<c006ac44>] (generic_handle_irq+0x20/0x30)
>> from [<c000ebc8>] (handle_IRQ+0x60/0x84)
>> [<c000ebc8>] (handle_IRQ+0x60/0x84)
>> from [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>> [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>> from [<c000df00>] (__irq_svc+0x40/0x70)
>> Exception stack(0xc0507ed8 to 0xc0507f20)
>> 7ec0:                                                      00000001 c054d600
>> 7ee0:00000101 c0506000 00000002 00000000 ffffffff c0507fb4 00200000 ffff9e65
>> 7f00:c054d640 00000000 c0526f28 c0507f20 c054d600 c003400c 60000113 ffffffff
>> [<c000df00>] (__irq_svc+0x40/0x70)
>> from [<c003400c>] (__do_softirq+0x60/0x184)
>> [<c003400c>] (__do_softirq+0x60/0x184)
>> from [<c003440c>] (irq_exit+0x70/0xc4)
>> [<c003440c>] (irq_exit+0x70/0xc4)
>> from [<c000ebcc>] (handle_IRQ+0x64/0x84)
>> [<c000ebcc>] (handle_IRQ+0x64/0x84)
>> from [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>> [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>> from [<c000df00>] (__irq_svc+0x40/0x70)
>> Exception stack(0xc0507f80 to 0xc0507fc8)
>> 7f80:c0547548 c050fb50 00000001 c0506000 c050e0d8 00000000 c04fb954 c0510844
>> 7fa0:80004059 413fc082 00000000 00000000 00000000 c0507fc8 c0506008 c000ed78
>> 7fc0:20000013 ffffffff
>> [<c000df00>] (__irq_svc+0x40/0x70) from [<c000ed78>] (cpu_idle+0x60/0x90)
>> [<c000ed78>] (cpu_idle+0x60/0x90)
>> from [<c04da7a8>] (start_kernel+0x234/0x284)
>> Code: e0022006 e0033007 e1920003 0a000002 (e7f001f2)
>> ---[ end trace 58d781a6c1166535 ]---
>> Kernel panic - not syncing: Fatal exception in interrupt
>
> --
> Regards,
>
> Laurent Pinchart
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: omap3-isp : panic using previewer from V4L input
  2013-05-07 12:41   ` jean-philippe francois
@ 2013-05-14  9:29     ` jean-philippe francois
  2013-05-15  1:32       ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: jean-philippe francois @ 2013-05-14  9:29 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: linux-media, linux-omap@vger.kernel.org

Hi Laurent,

I have a beagle xm board, but no sensor board. Is it possible to have
the omap3-isp initialised ?
I would like to try my program on a beagle board to eliminate any
hardware related problem.
>From the board file in mainline kernel, it seems omap3_init_camera is
not called, do you know any kernel tree
where isp is initialized for beagle board ?

Thank you,
Jean-Philippe François



2013/5/7 jean-philippe francois <jp.francois@cynove.com>:
> 2013/5/7 Laurent Pinchart <laurent.pinchart@ideasonboard.com>:
>> Hi Jean-Philippe,
>>
>> (CC'ed linux-omap)
>>
>> On Monday 06 May 2013 10:59:07 jean-philippe francois wrote:
>>> Hi,
>>>
>>> I am trying to use the previewer to debayer pictures coming from the
>>> filesystem instead of the capture hardware. The media-ctl links are as
>>> follows :
>>>
>>> preview V4L input -> preview pad 0 (sink), preview pad 1(src)
>>> ->preview V4L output.
>>>
>>> Input output format is set via media-ctl for the preview element, and
>>> via the V4L2 api for the V4L2 file descriptors. I am using USERPTR
>>> buffer allocated via memalign, and the application goes like this :
>>>
>>> REQBUFS 1 buf on on input
>>> REQBUFS 1 buf on output
>>> alloc buffers
>>> QBUF on input
>>> QBUF on output
>>> STREAMON on output
>>> STREAMON on input
>>> DQBUF on output.
>>>
>>> The board either panics or hangs (though HUNG_TASK_DETECTION and
>>> SOFT_LOCKUP_DETECTION is set)
>>
>> Does it happen every time you run the application, including on the first run
>> after a cold boot ?
>
> Yes, every time.
> Previewer usage in device to memory mode works fine.
> Tested on 3.6.11 and 3.9 with the same results.
> The only difference observed so far between runs is that sometimes
> the board hangs without anything printed on the console.
>
>>
>>> Please find attached the panic log, and the application code.
>>
>> (log inlined)
>>
>>> omap3isp omap3isp: can't find source, failing now
>>> omap3isp omap3isp: can't find source, failing now
>>
>> Those are harmless warnings. I have a fix for them, I'll repost it.
>>
>>> ------------[ cut here ]------------
>>> Kernel BUG at c019bb1c [verbose debug info unavailable]
>>> Internal error: Oops - BUG: 0 [#1] PREEMPT ARM
>>> Modules linked in: omap3_isp ov10630(O)
>>> CPU: 0    Tainted: G           O  (3.9.0 #3)
>>> PC is at omap3_l3_app_irq+0x3c/0xbc
>>
>> L3 APP interconnect timeout errors are not supposed to happen. This is the
>> first time I see one. Maybe someone on the linux-omap list will have some
>> clues regarding how to debug this.
>>
>>> LR is at handle_irq_event_percpu+0x28/0x10c
>>> pc : [<c019bb1c>]    lr : [<c006b354>]    psr: 20000193
>>> sp : c0507e58  ip : 00060000  fp : 00000000
>>> r10: cf804dc0  r9 : ffff9e65  r8 : 00200000
>>> r7 : 00000000  r6 : 00001000  r5 : 00000000  r4 : cf87f3c0
>>> r3 : 00000000  r2 : 00001000  r1 : cf8ffc80  r0 : 00001000
>>> Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
>>> Control: 10c5387d  Table: 8fa80019  DAC: 00000015
>>> Process swapper (pid: 0, stack limit = 0xc0506230)
>>> Stack: (0xc0507e58 to 0xc0508000)
>>> 7e40:                                                      00000002 cf87f3c0
>>> 7e60:0000001a 00000000 00000000 c006b354 cf804dc0 cf87f3c0 cf804dc0 c0506000
>>> 7e80:cf87f3c0 c0507f0c 00200000 ffff9e65 c054d640 c006b490 cf804dc0 c0507f80
>>> 7ea0:ffffffff c006da68 0000001a c006ac44 0000001a c000ebc8 0000000a c0507ed8
>>> 7ec0:0000001a c0008594 c054d600 c003400c 60000113 c000df00 00000001 c054d600
>>> 7ee0:00000101 c0506000 00000002 00000000 ffffffff c0507fb4 00200000 ffff9e65
>>> 7f00:c054d640 00000000 c0526f28 c0507f20 c054d600 c003400c 60000113 ffffffff
>>> 7f20:cf805c40 c0506000 c0511c98 c0507fb4 80004059 00000035 00000000 ffffffff
>>> 7f40:c0507fb4 80004059 413fc082 00000000 00000000 c003440c 00000035 c000ebcc
>>> 7f60:00000025 c0507f80 00000035 c0008594 c0506008 c000ed78 20000013 c000df00
>>> 7f80:c0547548 c050fb50 00000001 c0506000 c050e0d8 00000000 c04fb954 c0510844
>>> 7fa0:80004059 413fc082 00000000 00000000 00000000 c0507fc8 c0506008 c000ed78
>>> 7fc0:20000013 ffffffff c036c958 c04da7a8 ffffffff ffffffff c04da344 00000000
>>> 7fe0:c04fb958 271ae41c 00000000 10c53c7d c050e028 80008070 00000000 00000000
>>> [<c019bb1c>] (omap3_l3_app_irq+0x3c/0xbc)
>>> from [<c006b354>] (handle_irq_event_percpu+0x28/0x10c)
>>> [<c006b354>] (handle_irq_event_percpu+0x28/0x10c)
>>> from [<c006b490>] (handle_irq_event+0x58/0x74)
>>> [<c006b490>] (handle_irq_event+0x58/0x74)
>>> from [<c006da68>] (handle_level_irq+0xd8/0x110)
>>> [<c006da68>] (handle_level_irq+0xd8/0x110)
>>> from [<c006ac44>] (generic_handle_irq+0x20/0x30)
>>> [<c006ac44>] (generic_handle_irq+0x20/0x30)
>>> from [<c000ebc8>] (handle_IRQ+0x60/0x84)
>>> [<c000ebc8>] (handle_IRQ+0x60/0x84)
>>> from [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>>> [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>>> from [<c000df00>] (__irq_svc+0x40/0x70)
>>> Exception stack(0xc0507ed8 to 0xc0507f20)
>>> 7ec0:                                                      00000001 c054d600
>>> 7ee0:00000101 c0506000 00000002 00000000 ffffffff c0507fb4 00200000 ffff9e65
>>> 7f00:c054d640 00000000 c0526f28 c0507f20 c054d600 c003400c 60000113 ffffffff
>>> [<c000df00>] (__irq_svc+0x40/0x70)
>>> from [<c003400c>] (__do_softirq+0x60/0x184)
>>> [<c003400c>] (__do_softirq+0x60/0x184)
>>> from [<c003440c>] (irq_exit+0x70/0xc4)
>>> [<c003440c>] (irq_exit+0x70/0xc4)
>>> from [<c000ebcc>] (handle_IRQ+0x64/0x84)
>>> [<c000ebcc>] (handle_IRQ+0x64/0x84)
>>> from [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>>> [<c0008594>] (omap3_intc_handle_irq+0x58/0x6c)
>>> from [<c000df00>] (__irq_svc+0x40/0x70)
>>> Exception stack(0xc0507f80 to 0xc0507fc8)
>>> 7f80:c0547548 c050fb50 00000001 c0506000 c050e0d8 00000000 c04fb954 c0510844
>>> 7fa0:80004059 413fc082 00000000 00000000 00000000 c0507fc8 c0506008 c000ed78
>>> 7fc0:20000013 ffffffff
>>> [<c000df00>] (__irq_svc+0x40/0x70) from [<c000ed78>] (cpu_idle+0x60/0x90)
>>> [<c000ed78>] (cpu_idle+0x60/0x90)
>>> from [<c04da7a8>] (start_kernel+0x234/0x284)
>>> Code: e0022006 e0033007 e1920003 0a000002 (e7f001f2)
>>> ---[ end trace 58d781a6c1166535 ]---
>>> Kernel panic - not syncing: Fatal exception in interrupt
>>
>> --
>> Regards,
>>
>> Laurent Pinchart
>>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: omap3-isp : panic using previewer from V4L input
  2013-05-14  9:29     ` jean-philippe francois
@ 2013-05-15  1:32       ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2013-05-15  1:32 UTC (permalink / raw)
  To: jean-philippe francois; +Cc: linux-media, linux-omap@vger.kernel.org

Hi Jean-Philippe,

On Tuesday 14 May 2013 11:29:39 jean-philippe francois wrote:
> Hi Laurent,
> 
> I have a beagle xm board, but no sensor board. Is it possible to have
> the omap3-isp initialised ?

Yes it is. You will just need to call omap3_init_camera() in your board code 
with a pointer to platform data that contain an empty list of subdevs. 
Something like

static struct isp_v4l2_subdevs_group beagle_camera_subdevs[] = {
	{ },
};

static struct isp_platform_data beagle_isp_platform_data = {
	.subdevs = beagle_camera_subdevs,
};

static int __init beagle_camera_init(void)
{
	if (!machine_is_omap3_beagle())
		return 0;

	omap3_init_camera(&beagle_isp_platform_data);

	return 0;
}
late_initcall(beagle_camera_init);

should do (you will also need to include the appropriate headers).

> I would like to try my program on a beagle board to eliminate any
> hardware related problem.
> From the board file in mainline kernel, it seems omap3_init_camera is
> not called, do you know any kernel tree where isp is initialized for beagle
> board ?

-- 
Regards,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-05-15  1:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-06  8:59 omap3-isp : panic using previewer from V4L input jean-philippe francois
2013-05-07 11:56 ` Laurent Pinchart
2013-05-07 12:41   ` jean-philippe francois
2013-05-14  9:29     ` jean-philippe francois
2013-05-15  1:32       ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox