From: Milton Aupperle <milton@outcastsoft.com>

Date: September 18, 2012 8:05:28 PM MDT

To: Astro_IIDC@yahoogroups.com

Subject: Re: [Astro_IIDC] pgr camera extended exposure


Dave;


On 2012-09-18, at 7:18 PM, Dave Goodyear wrote:

Hi all. 


Question.  When I am doing long exposure with a PGR Grasshopper Express @ 800x600 16bit after each exposure (5 sec, 30sec, 5 min) the video preview screen refreshes after each exposure.  Works perfectly.


When I am doing 1600x1200 16bit, the screen only refreshes after every other exposure.  So If I do a 5 sec exposure, after the 5sec, nothing changes on the preview screen until another 5 second exposure is taken.  So if doing a 5min exposure, I really have to wait 10min for the video preview to show up. 


This is with trigger mode 14 on or off.


There is no reason to use Trigger mode 14 except if your externally triggering frames - as done with Machine Vision applications. It will make no difference on this issue either.


Which version of Astro IIDC are you using?


I had the exact same issue with the Grasshopper 1 camera in certain Modes of Format 7.


The PGR Cameras have some issues with Format 7 packet size and ring buffer size issues. Apple doesn't want full frame buffers to be used, because the DMA memory is in the kernel and with large frame sizes in ring buffers, that uses up a fair chunk of memory.  So we are forced to use smaller buffers (all of which have to be aligned on 4K boundaries), which Windows and Linux aren't subject to this so they can allocate full frame buffers - so this issue never happens.


The reason this happens is because of packets size does not work out to an even number of packets per ring buffer. So you wind up with one packet waiting until the next bunch of packets arrive before it completes a frame - which is why it appears to skip a frame. This took about a week of low level packet tracing to eventually figure out. Apple doesn't care because there are no long exposures in Apple's world and the data pipeline is always full as your running at 15 fps or higher not one frame every 20 minutes.


In Astro IIDC 4.08, I added some code to calculate the optimum packets size for long exposures so they are even multiples of the ring buffer sizes and then there should be no hanging packets holding up the frame delivery.  However depending on the incremental packets size in specific Format 7 modes, it may not be able to calculate a packet size that will fit in a buffer in even multiples. The larger the increment size (some modes have 24 byte increments - others have 4 byte increments), the harder it is to find a suitable packet size.


I already mentioned this to PGR and asked them to make sure they have small enough increment sizes for the packets so we can work around it. But for cameras that already exist, there may be no way to adjust for it.


Milton J. Aupperle