Re: TechnoTrend C-1501 - Locking issues on 388Mhz

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

 





On Fri, Feb 27, 2009 at 6:35 AM, hermann pitton <hermann-pitton@xxxxxxxx> wrote:
Hi,

Am Mittwoch, den 25.02.2009, 20:42 +0000 schrieb erik:
> klaas de waal <klaas.de.waal <at> gmail.com> writes:
> >
> > On Fri, Oct 10, 2008 at 2:36 AM, hermann pitton <hermann-pitton <at> arcor.de>
> wrote:
> > Hi,
> > Am Donnerstag, den 09.10.2008, 22:15 +0200 schrieb klaas de waal:
> >  The table starts a new segment at 390MHz,
> > > it then starts to use VCO2 instead of VCO1.
> > > I have now (hack, hack) changed the segment start from 390 to 395MHz
> > > so that the 388MHz is still tuned with VCO1, and this works OK!!
> > > Like this:
> > >
> > > static const struct tda827xa_data tda827xa_dvbt[] = {
> > >     { .lomax =  56875000, .svco = 3, .spd = 4, .scr = 0, .sbs =
> > > 0, .gc3 = 1},
> > > #else
> > >     { .lomax = 395000000, .svco = 2, .spd = 1, .scr = 0, .sbs =
> > > 3, .gc3 = 1},
> > > #endif
> > >     { .lomax = 455000000, .svco = 3, .spd = 1, .scr = 0, .sbs =
> > > 3, .gc3 = 1},
> > > etc etc
> > >
>
> Hi Klaas/Hermann
>
> Your fix works perfectly for me as well. Prior I could not get the channels in
> the 386750000 freq. With Fix appied my Ziggo locking issues disappeared.
>
> Is there any chance to get it into the official version?
>
> Erik
>

yes, there should be one for the later patch with the separate tuning
table for tda8274a DVB-C I think.

Patch for a review must be against recent mercurial v4l-dvb, needs to be
in form of a unified diff, with mercurial installed and v4l-dvb cloned
"hg diff > tda827x_dvb-c_improved-tuning-table.patch" something does
create it most simple.

Needs to go to linux-media@xxxxxxxxxxxxxxx , please try README.patches
in the v4l-dvb Documentation. Needs a Signed-off-by line.

Also testers like you should provide a Tested-by line to promote it.

Don't know if somebody has the tuning table for that specific tuner,
tda8274a IIRC, or if this will only rely on the reports of the testers.

Some equivalent of lna config = 0 needs to be introduced too to keep it
quiet was said as well.

Cheers,
Hermann



Hi Hermann,

Thanks for your "howto" on making a proper patch.
After a "make commit" in my local v4l-dvb tree, and filling in the template I got the following output. I confess I do not know if this has now ended up somewhere in linuxtv.org or that it is just local.
However, here it is:

changeset:   11143:f10e05176a88
tag:         tip
user:        Klaas de Waal <klaas.de.waal@xxxxxxxxx>
date:        Tue Mar 24 22:59:44 2009 +0100
files:       linux/drivers/media/common/tuners/tda827x.c linux/drivers/media/dvb/ttpci/budget-ci.c
description:
Separate tuning table for DVB-C solves tuning problem at 388MHz.

From: Klaas de Waal <klaas.de.waal@xxxxxxxxx>

TechnoTrend C-1501 DVB-C card does not lock on 388MHz.
I assume that existing frequency table is valid for DVB-T. This is suggested
by the name of the table: tda827xa_dvbt.
Added a table for DVB-C with the name tda827xa_dvbc.
Added runtime selection of the DVB-C table when the tuner is type FE_QAM.
This should leave the behaviour of this driver with with DVB_T tuners unchanged.
This modification is in file tda827x.c

The tda827x.c gives the following warning message when debug=1 :
tda827x: tda827x_config not defined, cannot set LNA gain!
Added a tda827x_config struct in budget-ci.c to get rid of this message.

Priority: normal

Signed-off-by: Klaas de Waal <klaas.de.waal@xxxxxxxxx>


I have attached the result of "hg diff > tda827x_dvb-c_tuning_table.patch.
Patch is with the "hg clone" done 23 march.
Tested with Linux kernel 2.6.28.9.

Cheers,
Klaas.



 

diff -r e7d22285a9eb linux/drivers/media/common/tuners/tda827x.c
--- a/linux/drivers/media/common/tuners/tda827x.c	Sun Mar 22 22:42:26 2009 -0400
+++ b/linux/drivers/media/common/tuners/tda827x.c	Tue Mar 24 22:44:16 2009 +0100
@@ -352,7 +352,7 @@
 	u8  gc3;
 };
 
-static const struct tda827xa_data tda827xa_dvbt[] = {
+static struct tda827xa_data tda827xa_dvbt[] = {
 	{ .lomax =  56875000, .svco = 3, .spd = 4, .scr = 0, .sbs = 0, .gc3 = 1},
 	{ .lomax =  67250000, .svco = 0, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1},
 	{ .lomax =  81250000, .svco = 1, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1},
@@ -382,6 +382,36 @@
 	{ .lomax =         0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0}
 };
 
+static struct tda827xa_data tda827xa_dvbc[] = {
+	{ .lomax =  50125000, .svco = 2, .spd = 4, .scr = 2, .sbs = 0, .gc3 = 3},
+	{ .lomax =  58500000, .svco = 3, .spd = 4, .scr = 2, .sbs = 0, .gc3 = 3},
+	{ .lomax =  69250000, .svco = 0, .spd = 3, .scr = 2, .sbs = 0, .gc3 = 3},
+	{ .lomax =  83625000, .svco = 1, .spd = 3, .scr = 2, .sbs = 0, .gc3 = 3},
+	{ .lomax =  97500000, .svco = 2, .spd = 3, .scr = 2, .sbs = 0, .gc3 = 3},
+	{ .lomax = 100250000, .svco = 2, .spd = 3, .scr = 2, .sbs = 1, .gc3 = 1},
+	{ .lomax = 117000000, .svco = 3, .spd = 3, .scr = 2, .sbs = 1, .gc3 = 1},
+	{ .lomax = 138500000, .svco = 0, .spd = 2, .scr = 2, .sbs = 1, .gc3 = 1},
+	{ .lomax = 167250000, .svco = 1, .spd = 2, .scr = 2, .sbs = 1, .gc3 = 1},
+	{ .lomax = 187000000, .svco = 2, .spd = 2, .scr = 2, .sbs = 1, .gc3 = 1},
+	{ .lomax = 200500000, .svco = 2, .spd = 2, .scr = 2, .sbs = 2, .gc3 = 1},
+	{ .lomax = 234000000, .svco = 3, .spd = 2, .scr = 2, .sbs = 2, .gc3 = 3},
+	{ .lomax = 277000000, .svco = 0, .spd = 1, .scr = 2, .sbs = 2, .gc3 = 3},
+	{ .lomax = 325000000, .svco = 1, .spd = 1, .scr = 2, .sbs = 2, .gc3 = 1},
+	{ .lomax = 334500000, .svco = 1, .spd = 1, .scr = 2, .sbs = 3, .gc3 = 3},
+	{ .lomax = 401000000, .svco = 2, .spd = 1, .scr = 2, .sbs = 3, .gc3 = 3},
+	{ .lomax = 468000000, .svco = 3, .spd = 1, .scr = 2, .sbs = 3, .gc3 = 1},
+	{ .lomax = 535000000, .svco = 0, .spd = 0, .scr = 1, .sbs = 3, .gc3 = 1},
+	{ .lomax = 554000000, .svco = 0, .spd = 0, .scr = 2, .sbs = 3, .gc3 = 1},
+	{ .lomax = 638000000, .svco = 1, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1},
+	{ .lomax = 669000000, .svco = 1, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 1},
+	{ .lomax = 720000000, .svco = 2, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1},
+	{ .lomax = 802000000, .svco = 2, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 1},
+	{ .lomax = 835000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1},
+	{ .lomax = 885000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 1},
+	{ .lomax = 911000000, .svco = 3, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 1},
+	{ .lomax =         0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0}
+};
+
 static struct tda827xa_data tda827xa_analog[] = {
 	{ .lomax =  56875000, .svco = 3, .spd = 4, .scr = 0, .sbs = 0, .gc3 = 3},
 	{ .lomax =  67250000, .svco = 0, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 3},
@@ -485,6 +515,7 @@
 			       struct dvb_frontend_parameters *params)
 {
 	struct tda827x_priv *priv = fe->tuner_priv;
+	struct tda827xa_data *frequency_map = tda827xa_dvbt;
 	u8 buf[11];
 
 	struct i2c_msg msg = { .addr = priv->i2c_addr, .flags = 0,
@@ -511,22 +542,27 @@
 	}
 	tuner_freq = params->frequency + if_freq;
 
+	if (fe->ops.info.type == FE_QAM) {
+		dprintk("%s select tda827xa_dvbc\n", __func__);
+		frequency_map = tda827xa_dvbc;
+	}
+
 	i = 0;
-	while (tda827xa_dvbt[i].lomax < tuner_freq) {
-		if(tda827xa_dvbt[i + 1].lomax == 0)
+	while (frequency_map[i].lomax < tuner_freq) {
+		if (frequency_map[i + 1].lomax == 0)
 			break;
 		i++;
 	}
 
-	N = ((tuner_freq + 31250) / 62500) << tda827xa_dvbt[i].spd;
+	N = ((tuner_freq + 31250) / 62500) << frequency_map[i].spd;
 	buf[0] = 0;            // subaddress
 	buf[1] = N >> 8;
 	buf[2] = N & 0xff;
 	buf[3] = 0;
 	buf[4] = 0x16;
-	buf[5] = (tda827xa_dvbt[i].spd << 5) + (tda827xa_dvbt[i].svco << 3) +
-			tda827xa_dvbt[i].sbs;
-	buf[6] = 0x4b + (tda827xa_dvbt[i].gc3 << 4);
+	buf[5] = (frequency_map[i].spd << 5) + (frequency_map[i].svco << 3) +
+			frequency_map[i].sbs;
+	buf[6] = 0x4b + (frequency_map[i].gc3 << 4);
 	buf[7] = 0x1c;
 	buf[8] = 0x06;
 	buf[9] = 0x24;
@@ -585,7 +621,7 @@
 
 	/* correct CP value */
 	buf[0] = 0x30;
-	buf[1] = 0x10 + tda827xa_dvbt[i].scr;
+	buf[1] = 0x10 + frequency_map[i].scr;
 	rc = tuner_transfer(fe, &msg, 1);
 	if (rc < 0)
 		goto err;
@@ -600,7 +636,7 @@
 	msleep(3);
 	/* freeze AGC1 */
 	buf[0] = 0x50;
-	buf[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4);
+	buf[1] = 0x4f + (frequency_map[i].gc3 << 4);
 	rc = tuner_transfer(fe, &msg, 1);
 	if (rc < 0)
 		goto err;
diff -r e7d22285a9eb linux/drivers/media/dvb/ttpci/budget-ci.c
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c	Sun Mar 22 22:42:26 2009 -0400
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c	Tue Mar 24 22:44:16 2009 +0100
@@ -1084,6 +1084,10 @@
 	.deltaf = 0xa511,
 };
 
+static struct tda827x_config tda827x_config = {
+	.config = 0,
+};
+
 /* TT S2-3200 DVB-S (STB0899) Inittab */
 static const struct stb0899_s1_reg tt3200_stb0899_s1_init_1[] = {
 
@@ -1422,7 +1426,7 @@
 	case 0x101a: /* TT Budget-C-1501 (philips tda10023/philips tda8274A) */
 		budget_ci->budget.dvb_frontend = dvb_attach(tda10023_attach, &tda10023_config, &budget_ci->budget.i2c_adap, 0x48);
 		if (budget_ci->budget.dvb_frontend) {
-			if (dvb_attach(tda827x_attach, budget_ci->budget.dvb_frontend, 0x61, &budget_ci->budget.i2c_adap, NULL) == NULL) {
+			if (dvb_attach(tda827x_attach, budget_ci->budget.dvb_frontend, 0x61, &budget_ci->budget.i2c_adap, &tda827x_config) == NULL) {
 				printk(KERN_ERR "%s: No tda827x found!\n", __func__);
 				dvb_frontend_detach(budget_ci->budget.dvb_frontend);
 				budget_ci->budget.dvb_frontend = NULL;
_______________________________________________
linux-dvb users mailing list
For V4L/DVB development, please use instead linux-media@xxxxxxxxxxxxxxx
linux-dvb@xxxxxxxxxxx
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux