public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Tom <Bassai_Dai@gmx.net>
To: linux-media@vger.kernel.org
Subject: Re: OMAP3 ISP DQBUF hangs
Date: Mon, 19 Aug 2013 14:53:23 +0000 (UTC)	[thread overview]
Message-ID: <loom.20130819T160758-83@post.gmane.org> (raw)
In-Reply-To: CALxrGmX2aZsTGG_gM6EECLa1Y9vWgWNqEg_TFoXFr=gVmsJnvw@mail.gmail.com

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

Hello,

> 
> Hi Tom,
> 
> 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:
> >
> > 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
> 
> > --
> > 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





  reply	other threads:[~2013-08-19 14:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-15 14:15 OMAP3 ISP DQBUF hangs Tom
2013-08-17 23:38 ` Su Jiaquan
2013-08-19 14:53   ` Tom [this message]
2013-08-19 15:35     ` Enrico
2013-08-20  0:50     ` Su Jiaquan
2013-08-20  9:38       ` Tom

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20130819T160758-83@post.gmane.org \
    --to=bassai_dai@gmx.net \
    --cc=linux-media@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox