Mailing List archive

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

[linux-dvb] Tuning problems investigation



Hi, I've done some investigation into the problems I'm having. I have
two WinTV Nova-T cards,with Grundig 29504-401 tuner modules. I'm using
the latest "dvb-kernel" driver from CVS under linux 2.4.20. 

Whenever I tune a card for the first time, I always get the following
behaviour: 

[root@burble dvbtune-1.dec.2002]# ./tunemux1 
Using DVB card "Grundig 29504-401" 
tuning DVB-T (in United Kingdom) to 634167000 Hz 
polling.... 
polling.... 
Getting frontend event 
FE_STATUS: FE_HAS_SIGNAL FE_TIMEDOUT FE_HAS_CARRIER 
Not able to lock to the signal on the given frequency 
[root@burble dvbtune-1.dec.2002]# ./tunemux1 
Using DVB card "Grundig 29504-401" 
tuning DVB-T (in United Kingdom) to 634167000 Hz 
polling.... 
Getting frontend event 
FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI
FE_HAS_SYNC 
Event:  Frequency: 634167000 
        SymbolRate: 0 
        FEC_inner:  3 
Bit error rate: 124 
Signal strength: 11565 
SNR: 58596 
FE_STATUS: FE_HAS_SIGNAL FE_HAS_LOCK FE_HAS_CARRIER FE_HAS_VITERBI
FE_HAS_SYNC 


I do not know if this is related to the problems others have had with 
"FE_GET_EVENT: Value too large for defined data type "
being reported on a first time tune or not 

I've looked about in the frontend source, and the problem is the
frequency bending. The first time I tune, the frequency is bent from
"634167000" to "634333633"... ie.. 166KHz below the desired frequency.
Both my cards are unable to lock on at this frequency. 

The second time I tune, the frequency is bent to "634167000"... i.e.
left the same, and tuning works. 

If I remove the call to dvb_bend_frequency(), tuning works perfectly
every time. 

If anyone else has this problem, can you try one of the attached patches
and tell me if it solves it?

I'm thinking of adding a module parameter to control the bending,
defaulted to OFF. Do many people have multiple cards tuned to the same
frequency in the same machine anyway? 

Another option would be to make the bending only occur if it really
needs to (i.e. if there actually ARE two cards tuned to the same
frequency). What do people think would be best? Please note that I am
not tuning my second card at the moment, so there is no real reason for
any frequency bending to have occured.

diff -Naur dvb-kernel.ORIGINAL/linux/drivers/media/dvb/dvb-core/dvb_frontend.c dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_frontend.c
--- dvb-kernel.ORIGINAL/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	2003-01-02 11:26:46.000000000 +0000
+++ dvb-kernel/linux/drivers/media/dvb/dvb-core/dvb_frontend.c	2003-01-07 13:36:52.000000000 +0000
@@ -300,7 +300,8 @@
 	struct dvb_frontend *frontend = &fe->frontend;
 	int err;
 
-	dvb_bend_frequency (fe, 0);
+	// dvb_bend_frequency (fe, 0);
+	fe->bending = 0;
 
 	if (first_trial) {
 		fe->timeout_count = 0;
@@ -316,7 +317,9 @@
 	dprintk ("%s: f == %i, drift == %i\n",
 		 __FUNCTION__, param->frequency, fe->lnb_drift);
 
+	printk("REQUESTEDFREQ: %i\n", param->frequency);
 	param->frequency += fe->lnb_drift + fe->bending;
+	printk("TUNEDFREQ: %i\n", param->frequency);
 	err = dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
 	param->frequency -= fe->lnb_drift + fe->bending;
 
diff -Naur DVB.ORIGINAL/driver/dvb_frontend.c DVB/driver/dvb_frontend.c
--- DVB.ORIGINAL/driver/dvb_frontend.c	2003-01-07 13:32:26.000000000 +0000
+++ DVB/driver/dvb_frontend.c	2003-01-07 13:33:46.000000000 +0000
@@ -301,7 +301,8 @@
 	struct dvb_frontend *frontend = &fe->frontend;
 	int err;
 
-	dvb_bend_frequency (fe, 0);
+	// dvb_bend_frequency (fe, 0);
+	fe->bending = 0;
 
 	if (first_trial) {
 		fe->timeout_count = 0;
@@ -317,7 +318,9 @@
 	dprintk ("%s: f == %i, drift == %i\n",
 		 __FUNCTION__, param->frequency, fe->lnb_drift);
 
+	printk("REQUESTEDFREQ: %i\n", param->frequency);
 	param->frequency += fe->lnb_drift + fe->bending;
+	printk("TUNEDFREQ: %i\n", param->frequency);
 	err = dvb_frontend_internal_ioctl (frontend, FE_SET_FRONTEND, param);
 	param->frequency -= fe->lnb_drift + fe->bending;
 

Home | Main Index | Thread Index