Web lists-archives.org

Re: question for soc-camera driver




On Thu, 15 May 2008, ·ëöÎ wrote:

> sorry,i trouble you.
> 
> 2008/5/15 Guennadi Liakhovetski <g.liakhovetski@xxxxxx>:
> > What is your <struct pxacamera_platform_data>.mclk_10khz set to? What
> > kernel version are you using? I do not know what you do in your FPGA, are
> > you sure it doesn't modify your camera bus timing (pixel clock, VSYNC,
> > HSYNC, master clock)?
> 
> mclk_10khz=1000,and I try 800,500. kernel is linux-2.6.24. I sure it
> doesn't modify your camera bus timing.Usually FIFO overrun occur.

Does the number of dropped frames decrease with lower frequencies?

2.6.24? Then you must have patched it heavily... Might be worth trying 
2.6.26-rc2 or similar - aöö soc-camera patches are already there.

> > Do you mean camera FIFO overruns occur, but fraims do not get dropped? The
> > reason, why with NOR you have more problems might be, that you produce
> > extra load on the memory bus? I don't remember id you already told us,
> > what type of LCD you have on your system and what other bus masters you
> > have? What's your frame format? 640x480x8bit?
> 
> My frame format is 752x480x8bit.Now I only capure frame.And I do not
> display. the following is my capture thread:
> static int dhpa_capture_thread(void)
> {
> 	struct v4l2_buffer buf;
> 	int frame_cnt;
> 	static time_t init, end;
> 	
> 	while(1)
> 	{
> 		/*read frame*/
> 		memset(&buf, 0, sizeof(buf));
> 		buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
> 		buf.memory = V4L2_MEMORY_MMAP;	
> 
> 		/*get the captured buffer*/
> 		if(-1 == ioctl(fd, VIDIOC_DQBUF, &buf))
> 		{
> 			printf( "VIDIOC_DQBUF failed\n ");
> 			return -1;
> 		}
> 
> 		if(-1 == ioctl(fd, VIDIOC_QBUF, &buf))
> 		{
> 			printf("VIDIOC_QBUF failed\n");
> 			return -1;
> 		}
> 	}
> }
> Now if I write a file to jffs2 norflash,FIFO overrun will
> occur.Certainly frame is dropped.I only hope you give me some
> advice.why do overrun occur when writting norflash.Because I feel
> capture frame only use DMA now,I think that write norflash will not
> affect DMA.

DMA uses the same memory bus as NOR flash. Also, if the NOR driver blocks 
interrupts, it will delay processing of DMA interrupts, but that is 
unlikely to cause you problems, provided you use enough (4 should be good) 
video buffers.

More importantly, what do you do while waiting for jffs2 write to finish? 
I assume, you write to the filesystem from another thread, right? And the 
writer thread just blocks on write(). What does your grabber thread do at 
this time? Can it continue processing video buffers and queuing new ones 
or it waits for the writer thread?

Thanks
Guennadi
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer

--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@xxxxxxxxxx?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list