* OMAP3 ISP DQBUF hangs
@ 2013-08-15 14:15 Tom
2013-08-17 23:38 ` Su Jiaquan
0 siblings, 1 reply; 6+ messages in thread
From: Tom @ 2013-08-15 14:15 UTC (permalink / raw)
To: linux-media
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OMAP3 ISP DQBUF hangs
2013-08-15 14:15 OMAP3 ISP DQBUF hangs Tom
@ 2013-08-17 23:38 ` Su Jiaquan
2013-08-19 14:53 ` Tom
0 siblings, 1 reply; 6+ messages in thread
From: Su Jiaquan @ 2013-08-17 23:38 UTC (permalink / raw)
To: Tom; +Cc: linux-media
Hi Tom,
On Thu, Aug 15, 2013 at 10:15 PM, Tom <Bassai_Dai@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@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OMAP3 ISP DQBUF hangs
2013-08-17 23:38 ` Su Jiaquan
@ 2013-08-19 14:53 ` Tom
2013-08-19 15:35 ` Enrico
2013-08-20 0:50 ` Su Jiaquan
0 siblings, 2 replies; 6+ messages in thread
From: Tom @ 2013-08-19 14:53 UTC (permalink / raw)
To: linux-media
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OMAP3 ISP DQBUF hangs
2013-08-19 14:53 ` Tom
@ 2013-08-19 15:35 ` Enrico
2013-08-20 0:50 ` Su Jiaquan
1 sibling, 0 replies; 6+ messages in thread
From: Enrico @ 2013-08-19 15:35 UTC (permalink / raw)
To: Tom; +Cc: linux-media@vger.kernel.org
On Mon, Aug 19, 2013 at 4:53 PM, Tom <Bassai_Dai@gmx.net> wrote:
>
> 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?
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OMAP3 ISP DQBUF hangs
2013-08-19 14:53 ` Tom
2013-08-19 15:35 ` Enrico
@ 2013-08-20 0:50 ` Su Jiaquan
2013-08-20 9:38 ` Tom
1 sibling, 1 reply; 6+ messages in thread
From: Su Jiaquan @ 2013-08-20 0:50 UTC (permalink / raw)
To: Tom; +Cc: linux-media
Hi 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
>
> 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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: OMAP3 ISP DQBUF hangs
2013-08-20 0:50 ` Su Jiaquan
@ 2013-08-20 9:38 ` Tom
0 siblings, 0 replies; 6+ messages in thread
From: Tom @ 2013-08-20 9:38 UTC (permalink / raw)
To: linux-media
Su Jiaquan <jiaquan.lnx <at> gmail.com> writes:
Hello,
>
> Hi Tom
>
>
> 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
>
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
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2013-08-20 9:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-15 14:15 OMAP3 ISP DQBUF hangs Tom
2013-08-17 23:38 ` Su Jiaquan
2013-08-19 14:53 ` Tom
2013-08-19 15:35 ` Enrico
2013-08-20 0:50 ` Su Jiaquan
2013-08-20 9:38 ` Tom
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox