On Thursday 31 July 2003 09:50, Edward Wildgoose wrote:
> So previously I had a full featured DVB-T cards which "locked up" after
> half a dozen channel changes, no matter which driver used, etc...  Now I
> just bought a nice new motherboard (Asus p4p800) + new powersupply and
> ambitiously hoped that this might make a difference....
>
> .... nope....
>
> ...Still crashes after a couple of channel changes, and is possibly even
> getting worse now.  I think it may have fallen over on it's own last night
> when it wasn't even in use.  Previously it did not seem to lock up when not
> in use.  Currently testing with the pre3 driver on a 2.4.22 gs kernel
>
> This may point to a failing card to be honest.  It is possible that due to
> the really high temperatures that the card runs at it is slowly dying.
> Certainly it used to be able to get 30+ channel changes before locking up
> and this has dropped to about 2-8 now.

Hi,
maybe I found a solution for the lock-up problem. Because of the last very hot  
days here in Berlin my card also started to show this lock-up's more often. 
So it really seems to be heat depending. 
I installed a fan close to it and I already got less lock-up's. Then I found 
out that some channels became disturbed by the fan. So it's also important 
that the card is not disturbed by other electric devices.     
Next I did some more debugging on the driver. I couldn't find a way to avoid 
the hangups of the sp8870 firmware, but probably found a solution to let the 
driver detect it and recover from it (see Patch). 
With this patch my card now seems to run absolutly stable even without a fan. 
(though it's probably better for the card to install one).      

Juergen

Patch:
---------------------------------------------------------------------------------------------------------------------------------------------------------
diff -rpu DVB/driver/frontends/alps_tdlb7.c 
DVB_PATCH/driver/frontends/alps_tdlb7.c
--- DVB/driver/frontends/alps_tdlb7.c   Fri Aug  1 17:36:54 2003
+++ DVB_PATCH/driver/frontends/alps_tdlb7.c     Sun Aug  3 20:24:35 2003
@@ -50,6 +50,7 @@
 #include <linux/vmalloc.h>
 #include <linux/fs.h>
 #include <linux/unistd.h>
+#include <linux/delay.h>
 
 #include "compat.h"
 #include "dvb_frontend.h"
@@ -285,6 +286,88 @@ int sp8870_init (struct dvb_i2c_bus *i2c
        return 0;
 }
 
+static
+void sp8870_set_frontend_parameters (struct dvb_i2c_bus *i2c,
+                                     struct dvb_frontend_parameters *p)
+{
+       // system controller stop 
+       sp8870_writereg(i2c,0x0F00,0x0000);
+
+       sp5659_set_tv_freq (i2c, p->frequency);
+
+       // sample rate correction bit [23..17]
+       sp8870_writereg(i2c,0x0319,0x000A);
+
+       // sample rate correction bit [16..0]
+       sp8870_writereg(i2c,0x031A,0x0AAB);
+
+       // integer carrier offset 
+       sp8870_writereg(i2c,0x0309,0x0400);
+
+       // fractional carrier offset
+       sp8870_writereg(i2c,0x030A,0x0000);
+
+       // filter for 6/7/8 Mhz channel
+       if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
+               sp8870_writereg(i2c,0x0311,0x0002);
+       else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
+               sp8870_writereg(i2c,0x0311,0x0001);
+       else
+               sp8870_writereg(i2c,0x0311,0x0000);
+
+       // scan order: 2k first = 0x0000, 8k first = 0x0001 
+       if (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_2K)
+               sp8870_writereg(i2c,0x0338,0x0000);
+       else
+               sp8870_writereg(i2c,0x0338,0x0001);
+
+       // read status reg in order to clear pending irqs
+       sp8870_readreg(i2c, 0x200);
+
+       // instruction RAM register loword
+       sp8870_writereg(i2c,0x0F09,0x0000);
+
+       // instruction RAM register hiword
+       sp8870_writereg(i2c,0x0F08,0x0000);
+
+       // system controller start
+       sp8870_writereg(i2c,0x0F00,0x0001);
+}
+
+
+#define MAXTRIALS 5
+#define MAXCHECKS 100  
+
+static
+void sp8870_set_frontend (struct dvb_i2c_bus *i2c,
+                                     struct dvb_frontend_parameters *p)
+{
+       int lock;
+       int trials;
+       int check_count;
+       
+       for (trials = 0; trials < MAXTRIALS; trials++) {
+           sp8870_set_frontend_parameters(i2c, p);
+           for (check_count = 0; check_count < MAXCHECKS; check_count++) {
+               lock = (sp8870_readreg(i2c, 0x0200) & 4);
+               if (!lock) { 
+                   dprintk("%s: Delay (%i usec)\n",__FUNCTION__, check_count*10);
+                   break;
+               }    
+               udelay(10);
+           }
+           if (!lock) { 
+               if (trials > 0) 
+                   dprintk("%s: firmware lockup recovered!\n", __FUNCTION__);
+               break;
+           } else      
+               dprintk("%s: firmware lockup!\n", __FUNCTION__);
+       };
+       if (lock) 
+           printk("%s: firmware crash!!!!", __FUNCTION__);
+
+}
+
 
 static
 int tdlb7_ioctl (struct dvb_frontend *fe, unsigned int cmd, void *arg)
@@ -350,63 +433,21 @@ int tdlb7_ioctl (struct dvb_frontend *fe
                return -EOPNOTSUPP;
        }
 
+
         case FE_SET_FRONTEND:
         {
                struct dvb_frontend_parameters *p = arg;
-
-               // system controller stop 
-               sp8870_writereg(i2c,0x0F00,0x0000);
-
-               sp5659_set_tv_freq (i2c, p->frequency);
-
-               // read status reg in order to clear pending irqs
-               sp8870_readreg(i2c, 0x200);
-
-               // sample rate correction bit [23..17]
-               sp8870_writereg(i2c,0x0319,0x000A);
-
-               // sample rate correction bit [16..0]
-               sp8870_writereg(i2c,0x031A,0x0AAB);
-
-               // integer carrier offset 
-               sp8870_writereg(i2c,0x0309,0x0400);
-
-               // fractional carrier offset
-               sp8870_writereg(i2c,0x030A,0x0000);
-
-               // filter for 6/7/8 Mhz channel
-               if (p->u.ofdm.bandwidth == BANDWIDTH_6_MHZ)
-                       sp8870_writereg(i2c,0x0311,0x0002);
-               else if (p->u.ofdm.bandwidth == BANDWIDTH_7_MHZ)
-                       sp8870_writereg(i2c,0x0311,0x0001);
-               else
-                       sp8870_writereg(i2c,0x0311,0x0000);
-
-               // scan order: 2k first = 0x0000, 8k first = 0x0001 
-               if (p->u.ofdm.transmission_mode == TRANSMISSION_MODE_2K)
-                       sp8870_writereg(i2c,0x0338,0x0000);
-               else
-                       sp8870_writereg(i2c,0x0338,0x0001);
-
-               // instruction RAM register loword
-               sp8870_writereg(i2c,0x0F09,0x0000);
-
-               // instruction RAM register hiword
-               sp8870_writereg(i2c,0x0F08,0x0000);
-
-               // system controller start
-               sp8870_writereg(i2c,0x0F00,0x0001);
-
+               sp8870_set_frontend(i2c, p);
                break;
         }
 
        case FE_RESET:
                // system controller stop
-               sp8870_writereg(i2c,0x0F00,0x0000);
+//             sp8870_writereg(i2c,0x0F00,0x0000);
                // read status reg in order to clear pending irqs
-               sp8870_readreg(i2c, 0x200);
+//             sp8870_readreg(i2c, 0x200);
                // system controller start
-               sp8870_writereg(i2c,0x0F00,0x0001);
+//             sp8870_writereg(i2c,0x0F00,0x0001);
                break;
 
        case FE_GET_FRONTEND:  // FIXME: read known values back from Hardware...





-- 
Info:
To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe linux-dvb" as 
subject.

Reply via email to