Re: How to detect loss of COMPOSITE signal?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]




Michel Bardiaux wrote:

I have some more data now.

At this stage, my capture application grans only 2 frames per second, using simple VIDIOCMCAPTURE+VIDIOCSYNC pairs; I observe delays between 80 and 120ms, whether there is a signal or not! The delay changes from session to session, but seems stable from second to second in one session; EXCEPT when the signal disappears or returns: then there is a sudden change in delay. Looks like my board at least (Hercules SmartTV) uses ticks from somewhere (internal clock? PCI bus?) as locum for the VSYNC.

A delay up to 80msec would be easily explained if CMCAPTURE has to wait for a VSYNC on an even-numbered frame before actually initiating the grab (up to 40msec), then it takes exactly 40msec for the frame to complete. The rest of the delay might be due to the fact I always use the 1st buffer page here; if the driver or the device uses alternate pages internally, then there can be an extra wait of 1 frame for an even-numbered *frame*, not field.

Does all this sound reasonable?

When I use the 'butterfly' arrangement of VIDIOCMCAPTURE and VIDIOCSYNC recommended by all HOWTOs, the delay between the end of 2 successive CSYNC is still 40msec, very stable, signal or no signal. When the signal disappears, the delay is unchanged. When the signal comes back, for a few frames some of the delays can be up to 80msec. Looks like the TV board has an internal PLL; that would explain why no bump at signal loss, but bumps when it comes back.

This is good news for me, I had been afraid I would have to forcibly terminate any initiated grab in case of signal loss, re-initiate the butterfly loop later, supply my own timings,... Seems I just have to skip the transfer, but the grab logic is unaffected.

I have some more info, which may be of interest to list members.

Using the same test program for 'butterfly' interleaved VIDIOCMCAPTURE and VIDIOCSYNC, on a Hauppauge WinTV-GO (the BT878 based avatar), when the signal is cut, inter-synch times begin to fluctuate between 70 and 90 msec, randomly AFAICS; when the signal is restore, capture delay returns immediately to 40 msec. So it seems this board uses a one-shot timer to forecast the next synch, instead of a PLL.

On a Pinnacle PCTV, same behavior.

--
Michel Bardiaux
Peaktime Belgium S.A.  Bd. du Souverain, 191  B-1160 Bruxelles
Tel : +32 2 790.29.41





[Index of Archives]     [Linux DVB]     [Video Disk Recorder]     [Asterisk]     [Photo]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Free Photo Albums]     [Fedora Users]     [Fedora Women]     [ALSA Users]     [ALSA Devel]     [Linux USB]

Powered by Linux