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



(repost to list)

Thanks for the prompt answer Jaakko.

I looked at this some more. It seems that something is broken with
inversion somewhere. I use DVB/apps/scan to test tuning and I define my
freqs in initial.h. As you spotted I Used INVERSION_OFF instead of
INVERSION_ON.

This is strange though:
___
$ ./scan 
using '/dev/dvb/adapter0/frontend0' and '/dev/dvb/adapter0/demux0'

>>> tune to:
306000000:INVERSION_ON:6875000:FEC_NONE:QAM_64

>>> tuning status == 0x00!!!
>>> tuning status == 0x1f!!!
add filter pid 0x0000

start filter pid 0x0000

add filter pid 0x0010

start filter pid 0x0010

add filter pid 0x0011

start filter pid 0x0011

pid 0x00 tid 0x00 id 0x0028, 0/0 (version 9, start 0)
filter done pid 0x0000

add filter pid 0x0101

start filter pid 0x0101

add filter pid 0x0122

start filter pid 0x0122

add filter pid 0x0133

start filter pid 0x0133

add filter pid 0x0104

start filter pid 0x0104

pid 0x11 tid 0x42 id 0x0028, 0/0 (version 7, start 0)
SDT (actual TS)

[snip]

pid 0x10 tid 0x40 id 0xfbfd, 0/1 (version 9, start 0)
NIT (actual TS)

(com hem ab)
0xfbfd/0x0020 338000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0021 362000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0022 354000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0023 370000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0024 378000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0027 394000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0026 346000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
0xfbfd/0x0025 386000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64
filter done pid 0x0010
___

How should I interpret this ^^^^^

Is my provider saying that it does NOT use inversion or is the driver
reporting it or is scan reporting it?
After the first frequency is scanned with INVERSION_ON, scan switches to
INVERSION_OFF and tuning fails:

>>> tune to: 
338000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64 (done)

>>> tuning status == 0x00!!!
>>> tuning status == 0x07!!!
>>> tuning status == 0x07!!!
>>> tuning failed!!!

>>> tune to: 
338000000:INVERSION_OFF:6875000:FEC_NONE:QAM_64 (done) (tuning failed)

>>> tuning status == 0x00!!!
>>> tuning status == 0x07!!!
>>> tuning status == 0x07!!!

And so on.

My temporary gross hack to get this to work (without using
AUTO_INVERSION) is to do this:

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


Please comment. Where's the INVERSION PROBLEM? Provider, driver or scan?

Rgs,

Stefan


Part of scan/initial.h:
static
struct transponder qam_probes [] = {
        {
                .type = FE_QAM,
                .param = {
                        .frequency = 306000000,
                        .inversion = INVERSION_ON,
                        { qam:
                                {
                                        .symbol_rate = 6875000,
                                        .fec_inner = FEC_NONE,
                                        .modulation = QAM_64
                                }
                        }
                }
        },
        {
                .type = FE_QAM,
                .param = {
                        .frequency = 314000000,
                        .inversion = INVERSION_ON,
                        { qam:
                                {
                                        .symbol_rate = 6875000,
                                        .fec_inner = FEC_NONE,
                                        .modulation = QAM_64
                                }
                        }
                }
        },...





-----Original Message-----
From: Jaakko Hyvätti [mailto:jaakko@hyvatti.iki.fi] 
Sent: Tuesday, March 11, 2003 8:27 AM
To: Stefan Norberg
Cc: linux-dvb@linuxtv.org
Subject: 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