public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* Re: [linux-dvb] TechnoTrend C-1501 - Locking issues on 388Mhz
@ 2009-03-25 20:53 klaas de waal
  2009-03-26 23:51 ` hermann pitton
  0 siblings, 1 reply; 27+ messages in thread
From: klaas de waal @ 2009-03-25 20:53 UTC (permalink / raw)
  To: hermann pitton; +Cc: linux-media, linux-dvb, erik_bies

[-- Attachment #1: Type: text/plain, Size: 1594 bytes --]

(2nd try, this should be now  in "plain text" instead of HTML)

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@gmail.com>
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@gmail.com>

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!

Solved this by adding a tda827x_config struct in budget-ci.c.

Priority: normal

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


I have attached the result of "hg diff > tda827x_dvb-c_tuning_table.patch.

Patch is based on the "hg clone" done 23 march.
Tested again, now with Linux kernel 2.6.28.9.

Cheers,
Klaas.

[-- Attachment #2: tda827x_dvb-c_tuning_table.patch --]
[-- Type: text/x-patch, Size: 5793 bytes --]

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;

^ permalink raw reply	[flat|nested] 27+ messages in thread
* [linux-dvb] TechnoTrend C-1501 - Locking issues on 388Mhz
@ 2008-09-11 15:50 jerremy
  0 siblings, 0 replies; 27+ messages in thread
From: jerremy @ 2008-09-11 15:50 UTC (permalink / raw)
  To: linux-dvb

Hi,

This issue has come up at least once a bit more then a month ago and is
still present in the current release of the V4L-DVB drivers. The
Technotrend C-1501 drivers are unable to get a lock on 388Mhz (and a couple
of other frequencies, like 682Mhz and 322Mhz, but I can only test 388Mhz). 

The dmesg will mention an I2C timeout when this occurs, I'm not sure if its
related (as it'll randomly give those timeouts when viewing working
channels too).

I have two seperate installs of Linux (Ubuntu 8.04 64-Bit with 1 received
and Ubuntu 8.04 32-Bit with 2 receivers) which both suffer the same
inability to lock onto that frequency. So its unlikely to be a hardware
problem, also the Windows drivers do not seem to have any issues.

Is anyone looking into this issue? If not, what would be the place to
experiment?

Gr,

Jerremy Koot



_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

^ permalink raw reply	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2009-03-28  5:52 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <7b41dd970809290235x48f63938ic56318ba3064a71b@mail.gmail.com>
     [not found] ` <c4d80f839f7e2e838b04f6c37c68d9c0@10.0.0.2>
2008-10-09 20:15   ` [linux-dvb] TechnoTrend C-1501 - Locking issues on 388Mhz klaas de waal
2008-10-10  0:36     ` hermann pitton
2008-10-12 20:21       ` klaas de waal
2008-10-13 19:27         ` Arthur Konovalov
2008-10-14  7:27           ` klaas de waal
2008-10-14 10:56             ` Arthur Konovalov
2008-10-17  9:57               ` Arthur Konovalov
2009-02-25 20:42         ` erik
2009-02-27  5:35           ` hermann pitton
2009-03-24 22:14             ` klaas de waal
2009-03-25  1:38               ` Christian Lyra
2009-03-25 21:25                 ` klaas de waal
2008-10-10  9:32     ` Arthur Konovalov
2009-03-25 20:53 klaas de waal
2009-03-26 23:51 ` hermann pitton
2009-03-27  0:09   ` Mauro Carvalho Chehab
2009-03-27  0:46     ` hermann pitton
2009-03-27  1:02       ` Mauro Carvalho Chehab
2009-03-27  1:39         ` hermann pitton
2009-03-27 10:38           ` Mauro Carvalho Chehab
2009-03-27 23:23             ` hermann pitton
2009-03-28  3:03               ` hermann pitton
2009-03-28  3:58               ` Mauro Carvalho Chehab
2009-03-28  4:32                 ` hermann pitton
2009-03-28  4:48                   ` hermann pitton
2009-03-28  5:51                     ` hermann pitton
  -- strict thread matches above, loose matches on Subject: below --
2008-09-11 15:50 jerremy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox