[dvblast-devel] SAA7146 driver fix for better PCR accuracy and finer IP granularity

Marian Ďurkovič md at bts.sk
Fri Jun 11 11:49:41 CEST 2010


Hi,

On Fri, Jun 11, 2010 at 11:04:09AM +0300, Sergiy wrote:
> I'm also searched for solution to make better IP granularity for dvblast's
> output streams.
> What about using another thread with ringbuffer, that will send IP-packets
> with variable time-interval, that depends on stream bitrate?

Once you get TS packets from kernel in big chunks, your whole timing is
screwed - PCRs fluctuate as much as 14 msec (at SR27500). As Christophe
pointed out, with low symbol rates the problem is *much* bigger.

So the problem really needs to be addressed in the kernel driver, not 
in dvblast. Once the kernel delivers packets more frequently, dvblast
will exactly replicate the correct master clock and decent granularity
to the IP level without any additional efforts.

The SAA7146 register could be tuned as needed. So if you need even
better granularity, set it to lower value, but watch your CPU and
number of interrupts per second. The effect of this register
is that SAA7146 triggers an interrupt after receiving the specified
amount of data (and thus kernel delivers it to the application):

0x90 ...  64 kB
0x80 ...  32 kB
0x70 ...  16 kB
0x60 ...   8 kB
0x50 ...   4 kB
0x40 ...   2 kB
0x30 ...   1 kB

It would certainly be of interest to autotune this automatically based on
total mux bitrate, or at least have a way to tell the kernel to use
application-specified value.

   With kind regards,

         M.

   


More information about the dvblast-devel mailing list