Mailing List archive

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

[linux-dvb] Re: Your DVB-C patch and my network



  Hi Stefan,

On Tue, 11 Mar 2003, Stefan Norberg wrote:
> Hello Jakko,
>
> I am experiencing some problems with your patch (as posted to the
> dvb-list).
>
> Comhem (sweden) 6,875ksyms/s 306-402 Mhz, QAM_64.
>
> I applied all changes, but then no tuning at all. I nailed it down to
> two things:
>
> * I backed out the ves1820_setup_reg0 inversion changes
>
> Now most freqs tuned ok.
>
> * I Reenabled zigzagging
>
> Better but unreliable tuning
>
> * I changed the zigzig stepsize to 1000.
>
>                 if (fe->info->type == FE_QPSK)
>                         stepsize = fe->parameters.u.qpsk.symbol_rate /
> 16000;
>                 else
>                         //stepsize = fe->info->frequency_stepsize * 2;
>                         stepsize = 1000;
>
> Now tuning is fast and reliable.
>
> I have a Technotrend DVB-C card.
>
>   Bus  1, device   0, function  0:
>     Multimedia controller: Philips Semiconductors SAA7146 (rev 1).
>       IRQ 3.
>       Master Capable.  Latency=64.  Min Gnt=15.Max Lat=38.
>       Non-prefetchable 32 bit memory at 0xff8ffc00 [0xff8ffdff].
>
> Comments?
>
> Thank you for your time!
>
> Stefan Norberg
> Stockholm

  Yes, good ideas, and they show some problems in my patch.  But you
probably did not have correct inversion settings in your channels.conf if
the inversion changes did not work.  Removing my changes only force
mandatory automatic setting, so if you have OFF or ON setting sent to the
driver, and that is wrong, the forced AUTO setting of course fixes that
(if the auto setting works).

  The stepsize 1000 in zigzag effectively means the tuner only tries to
tune one frequency over and over again, because the resolution of the freq
setting is 61250 Hz.  This means also that the auto inversion in
ves1820_setup_reg0 has time to work.  If the zigzag starts changing the
frequency before the auto inversion detection has allowed the lock to
happen, it will not lock, so not changing the freq works.

  My patch needs to be modified to allow resetting the frontend
parameters, but disable frequency changing.  Unfortunately I have no
access to the hardware for the next two weeks, so I'll have to leave this
to the others now.  Maybe the attached patch works.

  I send this to the list too, I hope you do not mind.  Your findings are
valuable.

Jaakko


Index: driver/dvb_frontend.c
===================================================================
RCS file: /cvs/linuxtv/DVB/driver/dvb_frontend.c,v
retrieving revision 1.43
diff -u -r1.43 dvb_frontend.c
--- driver/dvb_frontend.c	20 Feb 2003 14:56:29 -0000	1.43
+++ driver/dvb_frontend.c	11 Mar 2003 07:19:37 -0000
@@ -393,6 +393,8 @@

 		if (fe->info->type == FE_QPSK)
 			stepsize = fe->parameters.u.qpsk.symbol_rate / 16000;
+		else if (fe->info->type == FE_QAM)
+			stepsize = 0;
 		else
 			stepsize = fe->info->frequency_stepsize * 2;

@@ -948,3 +950,6 @@
 MODULE_PARM_DESC(dvb_frontend_debug, "enable verbose debug messages");
 MODULE_PARM_DESC(dvb_shutdown_timeout, "wait <shutdown_timeout> seconds after close() before suspending hardware");

+// Local variables:
+// c-basic-offset: 8
+// End:
Index: driver/frontends/ves1820.c
===================================================================
RCS file: /cvs/linuxtv/DVB/driver/frontends/ves1820.c,v
retrieving revision 1.15
diff -u -r1.15 ves1820.c
--- driver/frontends/ves1820.c	27 Nov 2002 11:24:20 -0000	1.15
+++ driver/frontends/ves1820.c	11 Mar 2003 07:19:37 -0000
@@ -180,7 +180,7 @@
 	if (tuner_type == 0xff)     /*  PLL not reachable over i2c ...  */
 		return 0;

-	div = (freq + 36250000 + 31250) / 62500;
+	div = (freq + 35937500 + 31250) / 62500;
 	buf[0] = (div >> 8) & 0x7f;
 	buf[1] = div & 0xff;
 	buf[2] = byte3[tuner_type];
@@ -199,9 +199,15 @@


 static
-int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0)
+int ves1820_setup_reg0 (struct dvb_frontend *fe, u8 reg0,
+			fe_spectral_inversion_t inversion)
 {
 	reg0 |= GET_REG0(fe->data) & 0x62;
+
+	if (INVERSION_ON == inversion)
+		reg0 &= ~0x20;
+	else if (INVERSION_OFF == inversion)
+		reg0 |= 0x20;

 	ves1820_writereg (fe, 0x00, reg0 & 0xfe);
         ves1820_writereg (fe, 0x00, reg0 | 0x01);
@@ -209,7 +215,7 @@
 	/**
 	 *  check lock and toggle inversion bit if required...
 	 */
-	if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
+	if (INVERSION_AUTO == inversion && !(ves1820_readreg (fe, 0x11) & 0x08)) {
 		ddelay(1);
 		if (!(ves1820_readreg (fe, 0x11) & 0x08)) {
 			reg0 ^= 0x20;
@@ -306,7 +312,7 @@
 			    struct dvb_frontend_parameters *p)
 {
 	static const u8 reg0x00 [] = { 0x00, 0x04, 0x08, 0x0c, 0x10 };
-	static const u8 reg0x01 [] = {  140,  140,  106,  120,   92 };
+	static const u8 reg0x01 [] = {  140,  140,  106,  100,   92 };
 	static const u8 reg0x05 [] = {  135,  100,   70,   54,   38 };
 	static const u8 reg0x08 [] = {  162,  116,   67,   52,   35 };
 	static const u8 reg0x09 [] = {  145,  150,  106,  126,  107 };
@@ -324,7 +330,7 @@
         ves1820_writereg (fe, 0x08, reg0x08[real_qam]);
         ves1820_writereg (fe, 0x09, reg0x09[real_qam]);

-	ves1820_setup_reg0 (fe, reg0x00[real_qam]);
+	ves1820_setup_reg0 (fe, reg0x00[real_qam], p->inversion);

 	return 0;
 }
@@ -544,3 +550,6 @@
 MODULE_AUTHOR("Ralph Metzler, Holger Waechtler");
 MODULE_LICENSE("GPL");

+// Local variables:
+// c-basic-offset: 8
+// End:

-- 
Foreca Ltd                                           Jaakko.Hyvatti@foreca.com
Pursimiehenkatu 29-31 B, FIN-00150 Helsinki, Finland     http://www.foreca.com


-- 
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.



Home | Main Index | Thread Index