RE: My wishlist entry
Brought to you by:
aeb,
bencollins
From: Arne S. <ar...@sc...> - 2000-05-01 09:42:24
|
Aren't you already discussing this feature with Andreas in the thread "updated dma to user space API"? I don't want to spend some effort on this if this feature will be available in libraw 0.x anyway. How should a frame grabbing routine using dma be implemented? The naive solution (used in dvgrab up to 0.6x) was: throw away any packet which is 16 bytes long wait until first packet for frame is received put packet into frame buffer until it is filled This would be easy to implement using dma but has several drawbacks: 1. It assumes that packets always come in the required order. I do not know whether this assumption always holds for any type of camcorder. 2. If we lose just one packet this will result in the loss of a full frame, because the next "start of frame" packet will be put in the last position in the previous frame. Therefore synchronization is lost until we get another "start of frame" packet, which is one frame away. Also the current frame is completely broken because all packets from now on are in the wrong place Starting with dvgrab 0.7 I am using a somewhat more robust algorithm which explicitly calculates the packet offset in the frame buffer. If we lose a packet the corresponding area in the frame buffer still contains the previous packet. The assembled frame is "less wrong" than with the naive approach. One tester said he had better results with the new algorithm. But... I can calculate the offset only after I have the packet. So the only way to do it would be predicting the expected address and verifying the packet after it comes in. If the verification fail I have to do some form of smart recovery. Any comments? Arne -----Original Message----- From: Sebastien Rougeaux [SMTP:Seb...@sy...] Sent: Friday, April 28, 2000 1:23 AM To: ar...@sc... Cc: Seb...@sy...; and...@mu...; lin...@li... Subject: Re: My wishlist entry >>>>> "Arne" == Arne Schirmacher <ar...@sc...> writes: Arne> I wanted to modify my dvgrab code, but dvgrab uses libraw 0.6, no direct Arne> dma available there :-( [ yet? :-) ] Sorry for the confusion. I might not have been explicit enough. Direct user space dma and libraw are completely independent (for the moment). You use libraw to initialize the camera (everything you did before, except you do not need the iso_handler, and you DO NOT use raw1394_start_iso_rcv() nor the raw1394_loop_iterate(). Then you use /dev/ohci1394 as a frame grabbing device, following the instructions I have given in my previous announcement. I have already two successful users for this feature ;-), so it should work. Feel free to ask any question you might have, -- Sebastien Rougeaux RSISE, The Australian National University |