Skip to contentSkip to conversation

OMAP3 ISP DQBUF hangs

DISCUSSION Tom 3 participants 6 messages Aug 15, 2013 – Aug 20, 2013 Media (V4L/DVB)

lore
Share & tools
lore

Tom

author
#0 lore raw

Hello,

I'm working with an OMAP3 DM3730 processor module with a ov3640 camera module attached on parallel interface. I'm using Linux 3.5 and an application which builds the pipeline and grabs an image like the "media-ctl" and the "yavta" tools.

I configured the pipeline to:

sensor->ccdc->memory

When I call ioctl with DQBUF the calling functions are:

isp_video_dqbuf -> omap3isp_video_queue_dqbuf -> isp_video_buffer_wait -> wait_event_interruptible

The last function waits until the state of the buffer will be reseted somehow. Can someone tell my which function sets the state of the buffer? Am I missing an interrupt?

Best Regards, Tom

#1 lore raw

Hi Tom,

Quoted 13 lines · Tom

Hello,

I'm working with an OMAP3 DM3730 processor module with a ov3640 camera module attached on parallel interface. I'm using Linux 3.5 and an application which builds the pipeline and grabs an image like the "media-ctl" and the "yavta" tools.

I configured the pipeline to:

sensor->ccdc->memory

When I call ioctl with DQBUF the calling functions are:

Quoted 9 lines

isp_video_dqbuf -> omap3isp_video_queue_dqbuf -> isp_video_buffer_wait -> wait_event_interruptible

The last function waits until the state of the buffer will be reseted somehow. Can someone tell my which function sets the state of the buffer? Am I missing an interrupt?

Best Regards, Tom

I'm not familar with omap3isp, but from the code, the wait queue is released by function ccdc_isr_buffer->omap3isp_video_buffer_next. You are either missing a interrupt, or running out of buffer, or found a buffer under run.

Jiaquan

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

author
#2 lore raw

Su Jiaquan <jiaquan.lnx <at> gmail.com> writes:

Hello,

Quoted 27 lines

Hi Tom,

Quoted 13 lines · On Thu, Aug 15, 2013 at 10:15 PM, Tom <Bassai_Dai <at> gmx.net> wrote:

Hello,

I'm working with an OMAP3 DM3730 processor module with a ov3640 camera module attached on parallel interface. I'm using Linux 3.5 and an application which builds the pipeline and grabs an image like the "media-ctl" and the "yavta" tools.

I configured the pipeline to:

sensor->ccdc->memory

When I call ioctl with DQBUF the calling functions are:

Quoted 9 lines

isp_video_dqbuf -> omap3isp_video_queue_dqbuf -> isp_video_buffer_wait -> wait_event_interruptible

The last function waits until the state of the buffer will be reseted somehow. Can someone tell my which function sets the state of the buffer? Am I missing an interrupt?

Best Regards, Tom

Quoted 12 lines

I'm not familar with omap3isp, but from the code, the wait queue is released by function ccdc_isr_buffer->omap3isp_video_buffer_next. You are either missing a interrupt, or running out of buffer, or found a buffer under run.

Jiaquan

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo <at> vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

you are right. it seems that the list of the ccdc has no buffer left, because the printk("TOM ccdc_isr_buffer ERROR 1 ##########\n"); is shown in my log. But I don't understand what I need to do to solve the problem. What I do is:
- configure the pipeline
- open the video device
- do ioctl VIDIOC_REQBUFS (with memory = V4L2_MEMORY_MMAP and type = V4L2_BUF_TYPE_VIDEO_CAPTURE)
- do ioctl VIDIOC_QUERYBUF
- do ioctl VIDIOC_STREAMON
- do ioctl VIDIOC_QBUF

without fail. and when I do ioctl VIDIOC_DQBUF. I get my problem.

Does anyone have an idea what I need to do to solve this problem?

static int ccdc_isr_buffer(struct isp_ccdc_device *ccdc)

{
	printk("TOM ccdc_isr_buffer ##########\n");
	struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity);
	struct isp_device *isp = to_isp_device(ccdc);
	struct isp_buffer *buffer;
	int restart = 0;

	/* The CCDC generates VD0 interrupts even when disabled (the datasheet
	 * doesn't explicitly state if that's supposed to happen or not, so it
	 * can be considered as a hardware bug or as a feature, but we have to
	 * deal with it anyway). Disabling the CCDC when no buffer is available
	 * would thus not be enough, we need to handle the situation explicitly.
	 */
	printk("TOM ccdc_isr_buffer 1 ##########\n");
	if (list_empty(&ccdc->video_out.dmaqueue))
	{
		printk("TOM ccdc_isr_buffer ERROR 1 ##########\n");
		goto done;
	}

	/* We're in continuous mode, and memory writes were disabled due to a
	 * buffer underrun. Reenable them now that we have a buffer. The buffer
	 * address has been set in ccdc_video_queue.
	 */
	printk("TOM ccdc_isr_buffer 2 ##########\n");
	if (ccdc->state == ISP_PIPELINE_STREAM_CONTINUOUS && ccdc->underrun) {
		restart = 1;
		ccdc->underrun = 0;
		printk("TOM ccdc_isr_buffer ERROR 2 ##########\n");
		goto done;
	}

	printk("TOM ccdc_isr_buffer 3 ##########\n");
	if (ccdc_sbl_wait_idle(ccdc, 1000)) {
		printk("TOM ccdc_isr_buffer ERROR 3 ##########\n");
		dev_info(isp->dev, "CCDC won't become idle!\n");
		goto done;
	}

	printk("TOM ccdc_isr_buffer 4 ##########\n");
	buffer = omap3isp_video_buffer_next(&ccdc->video_out);
	if (buffer != NULL) {
		ccdc_set_outaddr(ccdc, buffer->isp_addr);
		restart = 1;
	}
	printk("TOM ccdc_isr_buffer 5 ##########\n");

	pipe->state |= ISP_PIPELINE_IDLE_OUTPUT;

	if (ccdc->state == ISP_PIPELINE_STREAM_SINGLESHOT &&
	    isp_pipeline_ready(pipe))
		omap3isp_pipeline_set_stream(pipe,
					ISP_PIPELINE_STREAM_SINGLESHOT);
	printk("TOM ccdc_isr_buffer DONE ##########\n");
done:
	return restart;
}

Regards, Tom

#3 lore raw
Quoted 13 lines · Tom

you are right. it seems that the list of the ccdc has no buffer left, because the printk("TOM ccdc_isr_buffer ERROR 1 ##########\n"); is shown in my log. But I don't understand what I need to do to solve the problem. What I do is:
- configure the pipeline
- open the video device
- do ioctl VIDIOC_REQBUFS (with memory = V4L2_MEMORY_MMAP and type = V4L2_BUF_TYPE_VIDEO_CAPTURE)
- do ioctl VIDIOC_QUERYBUF
- do ioctl VIDIOC_STREAMON
- do ioctl VIDIOC_QBUF

Quoted 3 lines

without fail. and when I do ioctl VIDIOC_DQBUF. I get my problem.

Does anyone have an idea what I need to do to solve this problem?

Even if you are sure your application works, try with media-ctl + yavta first so you can send logs that everybody understand.

Did you check you have interrupts during capture? (cat /proc/interrupts before and after yavta, look for omap3isp or something like that).

Enrico

#4 lore raw
In reply to Tom

Hi Tom

Quoted 12 lines

you are right. it seems that the list of the ccdc has no buffer left, because the printk("TOM ccdc_isr_buffer ERROR 1 ##########\n"); is shown in my log. But I don't understand what I need to do to solve the problem. What I do is:
- configure the pipeline
- open the video device
- do ioctl VIDIOC_REQBUFS (with memory = V4L2_MEMORY_MMAP and type = V4L2_BUF_TYPE_VIDEO_CAPTURE)
- do ioctl VIDIOC_QUERYBUF
- do ioctl VIDIOC_STREAMON
- do ioctl VIDIOC_QBUF

Quoted 6 lines

without fail. and when I do ioctl VIDIOC_DQBUF. I get my problem.

Does anyone have an idea what I need to do to solve this problem?

Well, for our practice, we QBUF before STREAMON (not on omap3 isp). You can try that and see what happens.

As I check the omap3 code, you sequence maybe OK. Coz there is a restart mechanism in the code to restart CCDC hardware after buffer underrun. But for you sequence, if the interrupt comes before you QBUF, then the hardware is running in underrun state ever from the STREAMON. Not sure the restart mechanism works in this scenario. Let's wait for answers from the professional :-)

Jiaquan

author
#5 lore raw

Su Jiaquan <jiaquan.lnx <at> gmail.com> writes:

Hello,

Quoted 7 lines

Hi Tom

Well, for our practice, we QBUF before STREAMON (not on omap3 isp). You can try that and see what happens.

Quoted 9 lines

As I check the omap3 code, you sequence maybe OK. Coz there is a restart mechanism in the code to restart CCDC hardware after buffer underrun. But for you sequence, if the interrupt comes before you QBUF, then the hardware is running in underrun state ever from the STREAMON. Not sure the restart mechanism works in this scenario. Let's wait for answers from the professional

Jiaquan

Thanks for your reply. The hang is solved. You were right. Now I do QBUF -> STREAMON -> DQBUF -> STREAMOFF.

My new Problem is that I receive a black image, but I think I do a new post with the appropriate subject.

Best Regrads, Tom