[linux-dvb] [PATCH 6/6] DVB-PinnSat: Misc cleanup and robustness tweaks

Edgar Toernig froese at gmx.de
Mon Jan 9 17:54:47 CET 2006


Manu Abraham wrote:
>
> >I still don't know what causes the audio fifo to overflow
> >on some chipsets - the video fifo seems to never show
> >this problem (yeah, it's two time as big but the data
> >rate is much more then twice of that comming via DVB).
> 
> The reason why it overflows is data is not read from the FIFO as it 
> should be and the PCI bus expects larger chunks. Another way of handling 
> this is to reduce the latency, [...]

All good and fine - but I get no errors with the video fifo,
only with the audio fifo.  Afaics, there are only two differences:
the video fifo is two times as deep as the audio fifo (but data rates
are 4-8 times as high), and the read-only MAX_LAT register which is
10us for video and 64us for audio.

> >-static int bt878_make_risc(struct bt878 *bt)
> >+static int bt878_calc_line_size(struct bt878 *bt)
> 
> calc_line_size would be misleading, since it is in fact creating the 
> RISC program itself.

No, that's bt878_risc_program.  Hence the name change.

> >+		if (astat & ~BT878_ARISCI) {
> >+			if (time_after(jiffies, bt->error_expire))
> >+				bt->errors = 0;
> >+			bt->error_expire = jiffies + 5*HZ;
> >+			bt->errors++;
> 
> IMHO, You shouldn't be sleeping inside an interrupt handler.

Heh?  Who's sleeping?  The expire is there to reset the error
counter if everything was well for 5 seconds.  I don't want
to reset dma if there's only a single error every 2 hours.

> >+			if (bt->errors == 10 || bt->errors == 15) {
> >+				printk(KERN_ERR "bt878(%d): too many errors, "
> >+						"resetting dma\n", bt->nr);
> >+				/* reset dma and set fifo-trigger to minimum */
> >+				btand(~0x1f, BT878_AGPIO_DMA_CTL);
> >+				btor(0x13, BT878_AGPIO_DMA_CTL);
> >+			}
> >+			if (bt->errors == 20) {
> >+				printk(KERN_ERR "bt878(%d): too many errors, "
> >+						"shutting up\n", bt->nr);
> >+				btwrite(BT878_ARISCI, BT878_AINT_MASK);
> >+			}
> 
> I would say that just,
> 
> errors > error_count,
> do_operations would be sufficient ..

No, won't do.

> But anyway what's the idea behind reducing the fifo size if in case of 
> errors ? normally when we have communication errors , we generally 
> increase the buffer size, not reduce it...

Not the fifo-depth is changed (that's not possible in the bt878), the
trigger point at which access to the PCI bus is requested is lowered.

Ciao, ET.



More information about the linux-dvb mailing list