[Patch TT-Budget S-1401 (TDA10086/TDA8262)] (was: [Testers wanted] TDA10086/TDA826x patch)

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

 



Oliver Endriss wrote:
> Helmut Auer wrote:
> > Helmut Auer schrieb:
> > >> With this patch my TTs1401 works much better than without.
> > >> The BER's are gon and I can receive all channels fine
>
> AFAICS the latest patch was posted in message
> http://linuxtv.org/pipermail/linux-dvb/2007-January/015251.html
> 
> After reading all messages in this thread it is not clear to me
> whether the patch improves things or not.
> 
> http://linuxtv.org/pipermail/linux-dvb/2007-January/015360.html
> indicates a problem with some transponders.
> 
> Unfortunately I neither have the datasheets nor the hardware to play
> with. I can't tell whether it makes sense or not.
> 
> Furthermore the patch might also break an USB device which uses the
> same tuner (dvb-usb driver - Pinnacle 400e DVB-S)...
> We need more testing!

With Helmut's help I've prepared a new patch which solved all
tuning problems for him.

Basically the same as the previous patch, except for:
- TDA8262: set baseband gain to 9db (maximum value)
- TDA10086: toggle register 0x02 between 0x35 (tuning) and 0x00 (locked)
- STR and SNR values are inverted now.

Helmut already confirmed that it works for him.

@all TT-budget S-1401 & Pinnacle 400e DVB-S users:
Please test the attached patch.

If nobody objects I'll commit this patch on Thursday.

Oliver

-- 
--------------------------------------------------------
VDR Remote Plugin 0.3.9 available at
http://www.escape-edv.de/endriss/vdr/
--------------------------------------------------------
diff -r 6feceafd45d7 linux/drivers/media/dvb/frontends/tda10086.c
--- a/linux/drivers/media/dvb/frontends/tda10086.c	Fri May 04 00:59:04 2007 +0200
+++ b/linux/drivers/media/dvb/frontends/tda10086.c	Sat May 12 21:57:22 2007 +0200
@@ -41,6 +41,7 @@ struct tda10086_state {
 	/* private demod data */
 	u32 frequency;
 	u32 symbol_rate;
+	bool has_lock;
 };
 
 static int debug = 0;
@@ -116,7 +117,7 @@ static int tda10086_init(struct dvb_fron
 	// misc setup
 	tda10086_write_byte(state, 0x01, 0x94);
 	tda10086_write_byte(state, 0x02, 0x35); // NOTE: TT drivers appear to disable CSWP
-	tda10086_write_byte(state, 0x03, 0x64);
+	tda10086_write_byte(state, 0x03, 0xe4);
 	tda10086_write_byte(state, 0x04, 0x43);
 	tda10086_write_byte(state, 0x0c, 0x0c);
 	tda10086_write_byte(state, 0x1b, 0xb0); // noise threshold
@@ -146,7 +147,7 @@ static int tda10086_init(struct dvb_fron
 	// setup AGC
 	tda10086_write_byte(state, 0x05, 0x0B);
 	tda10086_write_byte(state, 0x37, 0x63);
-	tda10086_write_byte(state, 0x3f, 0x03); // NOTE: flydvb uses 0x0a and varies it
+	tda10086_write_byte(state, 0x3f, 0x0a); // NOTE: flydvb varies it
 	tda10086_write_byte(state, 0x40, 0x64);
 	tda10086_write_byte(state, 0x41, 0x4f);
 	tda10086_write_byte(state, 0x42, 0x43);
@@ -398,6 +399,10 @@ static int tda10086_set_frontend(struct 
 
 	dprintk ("%s\n", __FUNCTION__);
 
+	// modify parameters for tuning
+	tda10086_write_byte(state, 0x02, 0x35);
+	state->has_lock = false;
+
 	// set params
 	if (fe->ops.tuner_ops.set_params) {
 		fe->ops.tuner_ops.set_params(fe, fe_params);
@@ -542,8 +547,14 @@ static int tda10086_read_status(struct d
 		*fe_status |= FE_HAS_VITERBI;
 	if (val & 0x08)
 		*fe_status |= FE_HAS_SYNC;
-	if (val & 0x10)
+	if (val & 0x10) {
 		*fe_status |= FE_HAS_LOCK;
+		if (!state->has_lock) {
+			state->has_lock = true;
+			// modify parameters for stable reception
+			tda10086_write_byte(state, 0x02, 0x00);
+		}
+	}
 
 	return 0;
 }
@@ -555,7 +566,7 @@ static int tda10086_read_signal_strength
 
 	dprintk ("%s\n", __FUNCTION__);
 
-	_str = tda10086_read_byte(state, 0x43);
+	_str = 0xff - tda10086_read_byte(state, 0x43);
 	*signal = (_str << 8) | _str;
 
 	return 0;
@@ -568,7 +579,7 @@ static int tda10086_read_snr(struct dvb_
 
 	dprintk ("%s\n", __FUNCTION__);
 
-	_snr = tda10086_read_byte(state, 0x1c);
+	_snr = 0xff - tda10086_read_byte(state, 0x1c);
 	*snr = (_snr << 8) | _snr;
 
 	return 0;
diff -r 6feceafd45d7 linux/drivers/media/dvb/frontends/tda826x.c
--- a/linux/drivers/media/dvb/frontends/tda826x.c	Fri May 04 00:59:04 2007 +0200
+++ b/linux/drivers/media/dvb/frontends/tda826x.c	Sat May 12 21:44:17 2007 +0200
@@ -89,8 +89,8 @@ static int tda826x_set_params(struct dvb
 	buf[2] = (1<<5) | 0x0b; // 1Mhz + 0.45 VCO
 	buf[3] = div >> 7;
 	buf[4] = div << 1;
-	buf[5] = 0xff; // basedband filter to max
-	buf[6] = 0xfe; // gains at max + no RF attenuation
+	buf[5] = 0x77; // baseband cut-off 19 MHz
+	buf[6] = 0xfe; // baseband gain 9 db + no RF attenuation
 	buf[7] = 0x83; // charge pumps at high, tests off
 	buf[8] = 0x80; // recommended value 4 for AMPVCO + disable ports.
 	buf[9] = 0x1a; // normal caltime + recommended values for SELTH + SELVTL
_______________________________________________
linux-dvb mailing list
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