Re: [Itifg-tech] Camera readout using itifg 8.4
Brought to you by:
mastein1
|
From: Tim v. W. <T.I...@ph...> - 2008-04-17 15:22:17
|
Hi Matthias, On Apr 15, 2008, at 17:50 , M....@go... wrote: > > When You are doing a normal blocking read with page_size, it is easy > for You and the driver. The call blocks until a new frame has arrived > an then the frame is copied out. If You call read the next time, You > block and read the next frame. > > With select/mmap the things get more difficult: > > 1. How to wait for a new frame? -> with select, You have done this. > > 2. How to get the information, at with offset into Your mmap space > the most recent frame resides, at 0 * page_size, 1* page_size, > 2 * page_size, 3 * page_size (assuming mmap size is 4 frames). > > This is done by lseek 0 SEEK_END > > 3. You have to tell the driver, that You have read/accepted the frame. > This is important for Your problem, thar select always signals > incoming data. > > This is done by lseek paged_size SEEK_CUR > > The lseek interface is as follows > > SEEK_END refers to the producer (the device driver that generated > frames) > SEEK_CUR refers to the consumer (You) > > offset == 0 means: don't change anything, query the current value > offset != 0 means: adjust somthing (paged_size based) The driver appears to do what I want now, although I again have some questions. Again, I init my mmap with size 4*pagedsize. I configure the camera, start grabbing by calling lseek(fd, +LONG_MAX, SEEK_END), do some stuff and stop by calling lseek(fd, -LONG_MAX, SEEK_END). So far so good. When I try a lseek(fd, 0, SEEK_END), process image, lseek(fd, pagedsize, SEEK_CUR) cycle, everything works as expected. Select blocks until a new frame arrives, and the mmap'ed memory holds a new frame every time. I do this without using the return value of the lseek calls at all. What I find a little odd though, is that my new image is always at the beginning of my mmap'ed memory, and the rest of the buffer seems empty. Even if I do not call SEEK_CUR afterwards and thus not tell the driver that I'm ready, I do not see the buffer fill up. SEEK_END *does* return values that keep increasing, like 69632 the first time (pagedsize), 5849088 (84*pagedsize), etc. The image located at the beginning of the buffer is overwritten every time, but I do not see images in the rest of the buffer. Could you explain why every new image is at the beginning of the mmap'ed memory and why the rest remains empty? And do I need to use the output of the lseek() calls at all, or are these merely necessary to signal the driver I want to do something? It seems to me I can always use the data in the beginning of the buffer, and do not need to move my pointer at all. > > Please read the man/extime_itifg.txt manpage, it seems to be up-to- > date > an describes it a little bit. Further You should have a look at > conffiles/vossk-ccd1300b-12bpp-pcd.cam. The values into this file are > setup for a free running mode with fps = 1/121ms and an exposure time > of 40ms (readout is 80ms, safety is 1ms) Oh sorry, I overlooked that. It's a bit clearer, thanks. As for the vossk-ccd1300b-12bpp-pcd.cam file, I see that EXT_SYNC_PERIOD_TIME = 121000.000 sets the complete cycle time, and that either EXSYNC_MIDPOINT_DELAY = 40000.000 or PRI_MIDPOINT_DELAY = 40000.000 set the exposure time (or both?), but I do not see the readout time of 80 ms anywhere. 2x40ms = 80ms, but I assume that the values that control the exposure time do not set the readout time. Could you explain this? Thanks again for your time, Tim |