Mailing List archive

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

[linux-dvb] Re: [PATCH] fix for stream corruption on budget /Nova-T cards



Edward Wildgoose wrote:

Sorry, wasn't deliberate.  To be clear.  It completely fixes the problem for
me with the dvb_kernel branch.  However, with the DVB branch, it is vastly
better, but there is still severe corruption (ie no way tolerable).
I took a look at the DVB code and it looks like it does the wrong thing when there is no data available (i.e. newdma == av7110->ttbp).

Try this patch to DVB instead, it justs adds the special case where there is no data available. This is already covered in the dvb-kernel code.

The dvb-kernel vpeirq() code looks easier to understand than the DVB code, but looks like it should do exactly the same thing. Should we consider putting the dvb-kernel vpeirq() into DVB?

Jon





diff -urw cvs/DVB/driver/av7110/av7110.c DVB/driver/av7110/av7110.c
--- cvs/DVB/driver/av7110/av7110.c	2003-08-28 14:05:53.000000000 +0100
+++ DVB/driver/av7110/av7110.c	2003-08-31 00:55:34.000000000 +0100
@@ -919,11 +919,27 @@
         u32 dmapos;
 
         dmapos=saa7146_read(av7110->saa_mem, PCI_VDP3);
+
+	if ((dmapos == 0) || (dmapos == TS_BUFLEN / 2)) {
+	          /* The DMA Pointer is unreliable at 0% and 50% of buffer and
+	           * frequently gets the two positions confused, we make a
+		   * guess of the likely value based on the last known value
+		   */
+	           if (av7110->ttbp < TS_BUFLEN/2) {
+		           dmapos = TS_BUFLEN/2;
+		   } else {
+		           dmapos = 0;
+		   }
+	}
+
         dmapos-=(dmapos%188);
 
         if (dmapos >= TS_BUFLEN)
                 return;
 
+        if (dmapos == av7110->ttbp) {
+        	return;
+        }
 
         if (dmapos > av7110->ttbp) {
                mem+=av7110->ttbp;

Home | Main Index | Thread Index