[linux-dvb] SAA7146 DMA buffer overflow

Johannes Stezenbach js at linuxtv.org
Wed Feb 15 13:21:55 CET 2006


On Tue, Feb 14, 2006, Ingo Schneider wrote:
> I hava a problem that I loose TS packets due to overruns of the SAA 7146 
> DMA buffer when the system is under I/O load (e.g. backup).
> 
> I modified the budget-core.c to give warning when the buffer is nearly 
> full to verify that this is really the cause (see code below).
> The simplest thing would be to increase the buffer size. The current 
> size = 1024 TS packets, about 192k.

Processing is done from the irq handler (well, actually from
a tasklet triggered by irq). For a 30Mbit/s stream
this buffer holds ~50ms worth of TS packets which are then pushed
into a larger ringbuffer where it waits to be picked up by read()
from the demux/dvr device. If the DMA buffer overflows you have
an irq/tasklet latency problem.

If your irqs/tasklets are delayed more than 50ms you need to find
out why. First check hdparm settings if you have ATA disk.
Second consider trying -rt kernel.

If you just try to increase the buffer size the vpeirq
might create similar latency problems for other drivers ;-/
IIRC the saa7146 has some hw bugs which restrict DMA
settings.

One thing you could try is to call vpeirq() directly from
irq handler (i.e. replace the tasklet_schedule() call).


HTH,
Johannes



More information about the linux-dvb mailing list