Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] Re: Audio sync
Régis Bossut wrote:
PCR means Program Clock Reference. Packets are sent at regular
intervals. Between packets, the clock is deduced from these timesyncs
packets from an internal PLL synchronized on them. This is one
mechanism.
ok
> An other one is the DTS (decoding timestamp) which is carried
on audio and video packets in the MPEG headers. These DTS are generally
sent in the TS header of the packet starting the beginning of a frame
PES-header, not TS-header.
(this is the case for DVD MPEG streams, which do not contain a PCR).
PCR is for TS what SCR (system clock reference) is for PS. As DVD
contain PS, they don't contain PCRs. But they contain SCRs.
(Esentially they are the same, but one transport stream often has
multiple programs, and thus, there are multiple clocks, so they aren't
called *System* Clock Reference)
BUT:
Syncing your local "system" or "program" clock to the one in the stream
is only neccessary when having a "live" input, where the incoming
bitrate is fixed. Because normally, your local clock will NEVER be
EXACTLY the same as the one of the broadcaster, you use that PLL to
ensure they are at the same frequency, so that frames are consumed
exactly as fast as they are produced.
The question:
Which clock does the ARM use for audio/video synchronization ? I guess
it's DTS if present, PCR if not. But I'm not a guru...
Well, DTS are plain "decoding time stamps". You can, however, take the
first DTS as your clock reference, and let your local clock just "run",
for example using a normal timer, or even udelay() (bad idea :) or
whatever. In that case, your "sync master" is the video stream. (You can
do the same for audio) But this only works as long as your buffer fills
in the same rate as your system decodes and displays them. If you can
load the stream in the speed you want (DVD for example, or a recording)
this is no problem, since you only keep the buffers "full", thus loading
the stream in the rate you display the frames.
But if you get a "live" stream (for example, real DVB), you have to
display the frames in the right speed. that's only possible with the
correct PCR and the PLL.
So in a "broadcasting environment", PCR evaluation is essential to avoid
buffer over- or underruns.
(A real pain is to sync to PCRs when your delivery network has variable
latencies, for example the internet, for example in a multicast-environment)
Please correct my if i'm wrong.
And after all, i never used a AV7110-based card, so i can't say anything
to that matter.
felix
--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index