Skip to contentSkip to conversation

TT S-1500b tuning issue

DVB In review Sébastien RAILLARD (COEXSI) 3 participants 8 messages Jun 29, 2011 – Jul 10, 2011 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

Dear all,

We have found what seems to be a tuning issue in the driver for the ALPS BSBE1-D01A used in the new TT-S-1500b card from Technotrend.
On some transponders, like ASTRA 19.2E 11817-V-27500, the card can work very well (no lock issues) for hours.

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.
I turned on the debugging of the stb6000 and stv0288 modules, but I can't see anything wrong.

Also, we have noticed that the lock maybe lost by intermittence on others transponders where it may work fine for few hours and then stop working for few hours.

After doing some researches about the ALPS BSBE1-D01A frontend, I've found it's the one used in the DREAMBOX DVB-S tuner module (that is running Linux), but I didn't manage to find the source code repository to check their drivers, maybe someone know where is it?

Best regards,
Sebastien.

#1 lore raw

PATCH 1/1 STV0288 Fast Channel Acquisition

Quoted 5 lines · Sébastien RAILLARD (COEXSI)

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.
I turned on the debugging of the stb6000 and stv0288 modules, but I can't see anything wrong.

I have had similar problems with the stv0288 on astra 19.2 and 28.2 with various frequencies.

I have been using this patch for some time which seems to improve things.

The STV0288 has a fast channel function which eliminates the need for software carrier search.

The patch removes the slow carrier search and replaces it with this faster and more reliable built-in chip function.

If carrier is lost while channel is running, fast channel attempts to recover it.

The patch also reguires registers 50-57 to be set correctly with inittab. All current combinations in the kernel media tree have been checked and tested.

---
 drivers/media/dvb/frontends/stv0288.c |   75 +++++++++++++++++++++-----------
 1 files changed, 49 insertions(+), 26 deletions(-)
drivers/media/dvb/frontends/stv0288.c +49 -26
index 8e0cfad..fa5cba5 100644
@@ -142,6 +142,12 @@ static int stv0288_set_symbolrate(struct dvb_frontend *fe, u32 srate)
 		stv0288_writeregI(state, 0x28, b[0]);
 		stv0288_writeregI(state, 0x29, b[1]);
 		stv0288_writeregI(state, 0x2a, b[2]);
+
+		stv0288_writeregI(state, 0x22, 0x0);
+		stv0288_writeregI(state, 0x23, 0x0);
+		stv0288_writeregI(state, 0x2b, 0x0);
+		stv0288_writeregI(state, 0x2c, 0x0);
+
 		dprintk("stv0288: stv0288_set_symbolrate\n");
 
 	return 0;
@@ -309,12 +315,13 @@ static u8 stv0288_inittab[] = {
 	0xf1, 0x0,
 	0xf2, 0xc0,
 	0x51, 0x36,
-	0x52, 0x09,
-	0x53, 0x94,
-	0x54, 0x62,
-	0x55, 0x29,
-	0x56, 0x64,
-	0x57, 0x2b,
+	0x52, 0x21,
+	/* Fast Channel MIN/MAX Freqency Bounds MSB bit 7 sets stop */
+	0x53, 0x94, /*Min MSB (0-6)*/
+	0x54, 0x62, /*Min LSB*/
+	0x55, 0x29, /*Max MSB (0-6)*/
+	0x56, 0x64, /*Max LSB*/
+	0x57, 0x2b, /* Increment (signed) */
 	0xff, 0xff,
 };
 
@@ -356,6 +363,35 @@ static int stv0288_init(struct dvb_frontend *fe)
 	return 0;
 }
 
+/* STV0288 Fast channel accquisition and blind search */
+static int stv0288_get_fast(struct dvb_frontend *fe)
+{
+	struct stv0288_state *state = fe->demodulator_priv;
+	int timeout = 0;
+
+	/* Coarse Tune */
+	stv0288_writeregI(state, 0x50, 0x35);
+	/* Wait 15ms */
+	msleep(15);
+	/* Fine Tune Control & Center Carrier */
+	stv0288_writeregI(state, 0x50, 0x16);
+	/* Check for Timing lock */
+	while (!(stv0288_readreg(state, 0x1e) & 0x80)) {
+		if (timeout++ > 5)
+			return -EINVAL;
+		msleep(15);
+	}
+
+	/* Center Carrier for further length of time */
+	stv0288_writeregI(state, 0x50, 0x14);
+	udelay(500);
+	/* Fast Search End*/
+	stv0288_writeregI(state, 0x50, 0x10);
+
+	return 0;
+}
+
+
 static int stv0288_read_status(struct dvb_frontend *fe, fe_status_t *status)
 {
 	struct stv0288_state *state = fe->demodulator_priv;
@@ -369,6 +405,9 @@ static int stv0288_read_status(struct dvb_frontend *fe, fe_status_t *status)
 	*status = 0;
 	if (sync & 0x80)
 		*status |= FE_HAS_CARRIER | FE_HAS_SIGNAL;
+		else
+		stv0288_get_fast(fe); /*try to recover*/
+
 	if (sync & 0x10)
 		*status |= FE_HAS_VITERBI;
 	if (sync & 0x08) {
@@ -458,9 +497,7 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
 {
 	struct stv0288_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-
-	char tm;
-	unsigned char tda[3];
+	int ret = 0;
 
 	dprintk("%s : FE_SET_FRONTEND\n", __func__);
 
@@ -487,28 +524,14 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
 	stv0288_set_symbolrate(fe, c->symbol_rate);
 	/* Carrier lock control register */
 	stv0288_writeregI(state, 0x15, 0xc5);
-
-	tda[0] = 0x2b; /* CFRM */
-	tda[2] = 0x0; /* CFRL */
-	for (tm = -6; tm < 7;) {
-		/* Viterbi status */
-		if (stv0288_readreg(state, 0x24) & 0x8)
-			break;
-
-		tda[2] += 40;
-		if (tda[2] < 40)
-			tm++;
-		tda[1] = (unsigned char)tm;
-		stv0288_writeregI(state, 0x2b, tda[1]);
-		stv0288_writeregI(state, 0x2c, tda[2]);
-		udelay(30);
-	}
+	/* Search for carrier */
+	ret = stv0288_get_fast(fe);
 
 	state->tuner_frequency = c->frequency;
 	state->fec_inner = FEC_AUTO;
 	state->symbol_rate = c->symbol_rate;
 
-	return 0;
+	return ret;
 }
 
 static int stv0288_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
Signature · 1 line
1.7.4.1
#2 lore raw

RE: [PATCH] STV0288 Fast Channel Acquisition

Quoted 30 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Malcolm Priestley
Sent: vendredi 1 juillet 2011 00:22
To: Linux Media Mailing List
Cc: Sébastien RAILLARD (COEXSI)
Subject: [PATCH] STV0288 Fast Channel Acquisition

Quoted 5 lines · Sébastien RAILLARD (COEXSI)

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.
I turned on the debugging of the stb6000 and stv0288 modules, but I can't see anything wrong.

I have had similar problems with the stv0288 on astra 19.2 and 28.2 with various frequencies.

I have been using this patch for some time which seems to improve things.

The STV0288 has a fast channel function which eliminates the need for software carrier search.

The patch removes the slow carrier search and replaces it with this faster and more reliable built-in chip function.

Quoted 7 lines

If carrier is lost while channel is running, fast channel attempts to recover it.

The patch also reguires registers 50-57 to be set correctly with inittab. All current combinations in the kernel media tree have been checked and tested.

Thanks Macolm for this patch!

Regarding the TT-S-1500b, it's using a specific inittab, I hope Oliver can have a look and check if this patch is compatible with the ALPS BSBE1 tuner.

Sebastien

Quoted 142 lines
---
 drivers/media/dvb/frontends/stv0288.c |   75 +++++++++++++++++++++-----
------
 1 files changed, 49 insertions(+), 26 deletions(-)
drivers/media/dvb/frontends/stv0288.c +6 -0
index 8e0cfad..fa5cba5 100644
@@ -142,6 +142,12 @@ static int stv0288_set_symbolrate(struct
 dvb_frontend *fe, u32 srate)
 		stv0288_writeregI(state, 0x28, b[0]);
 		stv0288_writeregI(state, 0x29, b[1]);
 		stv0288_writeregI(state, 0x2a, b[2]);
+
+		stv0288_writeregI(state, 0x22, 0x0);
+		stv0288_writeregI(state, 0x23, 0x0);
+		stv0288_writeregI(state, 0x2b, 0x0);
+		stv0288_writeregI(state, 0x2c, 0x0);
+
 		dprintk("stv0288: stv0288_set_symbolrate\n");
 
drivers/media/dvb/frontends/stv0288.c +36 -6
 	return 0;
@@ -309,12 +315,13 @@ static u8 stv0288_inittab[] = {
 	0xf1, 0x0,
 	0xf2, 0xc0,
 	0x51, 0x36,
-	0x52, 0x09,
-	0x53, 0x94,
-	0x54, 0x62,
-	0x55, 0x29,
-	0x56, 0x64,
-	0x57, 0x2b,
+	0x52, 0x21,
+	/* Fast Channel MIN/MAX Freqency Bounds MSB bit 7 sets stop */
+	0x53, 0x94, /*Min MSB (0-6)*/
+	0x54, 0x62, /*Min LSB*/
+	0x55, 0x29, /*Max MSB (0-6)*/
+	0x56, 0x64, /*Max LSB*/
+	0x57, 0x2b, /* Increment (signed) */
 	0xff, 0xff,
 };
 
@@ -356,6 +363,35 @@ static int stv0288_init(struct dvb_frontend *fe)
 	return 0;
 }
 
+/* STV0288 Fast channel accquisition and blind search */ static int
+stv0288_get_fast(struct dvb_frontend *fe) {
+	struct stv0288_state *state = fe->demodulator_priv;
+	int timeout = 0;
+
+	/* Coarse Tune */
+	stv0288_writeregI(state, 0x50, 0x35);
+	/* Wait 15ms */
+	msleep(15);
+	/* Fine Tune Control & Center Carrier */
+	stv0288_writeregI(state, 0x50, 0x16);
+	/* Check for Timing lock */
+	while (!(stv0288_readreg(state, 0x1e) & 0x80)) {
+		if (timeout++ > 5)
+			return -EINVAL;
+		msleep(15);
+	}
+
+	/* Center Carrier for further length of time */
+	stv0288_writeregI(state, 0x50, 0x14);
+	udelay(500);
+	/* Fast Search End*/
+	stv0288_writeregI(state, 0x50, 0x10);
+
+	return 0;
+}
+
+
 static int stv0288_read_status(struct dvb_frontend *fe, fe_status_t
 *status)  {
 	struct stv0288_state *state = fe->demodulator_priv; @@ -369,6
+405,9 @@ static int stv0288_read_status(struct dvb_frontend *fe,

fe_status_t *status)

drivers/media/dvb/frontends/stv0288.c +7 -20
 	*status = 0;
 	if (sync & 0x80)
 		*status |= FE_HAS_CARRIER | FE_HAS_SIGNAL;
+		else
+		stv0288_get_fast(fe); /*try to recover*/
+
 	if (sync & 0x10)
 		*status |= FE_HAS_VITERBI;
 	if (sync & 0x08) {
@@ -458,9 +497,7 @@ static int stv0288_set_frontend(struct dvb_frontend
 *fe,  {
 	struct stv0288_state *state = fe->demodulator_priv;
 	struct dtv_frontend_properties *c = &fe->dtv_property_cache;
-
-	char tm;
-	unsigned char tda[3];
+	int ret = 0;
 
 	dprintk("%s : FE_SET_FRONTEND\n", __func__);
 
@@ -487,28 +524,14 @@ static int stv0288_set_frontend(struct
 dvb_frontend *fe,
 	stv0288_set_symbolrate(fe, c->symbol_rate);
 	/* Carrier lock control register */
 	stv0288_writeregI(state, 0x15, 0xc5);
-
-	tda[0] = 0x2b; /* CFRM */
-	tda[2] = 0x0; /* CFRL */
-	for (tm = -6; tm < 7;) {
-		/* Viterbi status */
-		if (stv0288_readreg(state, 0x24) & 0x8)
-			break;
-
-		tda[2] += 40;
-		if (tda[2] < 40)
-			tm++;
-		tda[1] = (unsigned char)tm;
-		stv0288_writeregI(state, 0x2b, tda[1]);
-		stv0288_writeregI(state, 0x2c, tda[2]);
-		udelay(30);
-	}
+	/* Search for carrier */
+	ret = stv0288_get_fast(fe);
 
 	state->tuner_frequency = c->frequency;
 	state->fec_inner = FEC_AUTO;
 	state->symbol_rate = c->symbol_rate;
 
-	return 0;
+	return ret;
 }
 

static int stv0288_i2c_gate_ctrl(struct dvb_frontend *fe, int enable)
--
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#3 lore raw

RE: [PATCH] STV0288 Fast Channel Acquisition

Quoted 37 lines · Sébastien RAILLARD (COEXSI)
Quoted 29 lines

-----Original Message-----
From: [email protected] [mailto:linux-media- [email protected]] On Behalf Of Malcolm Priestley
Sent: vendredi 1 juillet 2011 00:22
To: Linux Media Mailing List
Cc: Sébastien RAILLARD (COEXSI)
Subject: [PATCH] STV0288 Fast Channel Acquisition

Quoted 5 lines · Sébastien RAILLARD (COEXSI)

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.
I turned on the debugging of the stb6000 and stv0288 modules, but I can't see anything wrong.

I have had similar problems with the stv0288 on astra 19.2 and 28.2 with various frequencies.

I have been using this patch for some time which seems to improve things.

The STV0288 has a fast channel function which eliminates the need for software carrier search.

The patch removes the slow carrier search and replaces it with this faster and more reliable built-in chip function.

Quoted 7 lines

If carrier is lost while channel is running, fast channel attempts to recover it.

The patch also reguires registers 50-57 to be set correctly with inittab. All current combinations in the kernel media tree have been checked and tested.

Quoted 6 lines

Thanks Macolm for this patch!

Regarding the TT-S-1500b, it's using a specific inittab, I hope Oliver can have a look and check if this patch is compatible with the ALPS BSBE1 tuner.

Sebastien

For some reason, I have had nothing but trouble today testing this patch scanning and tuning certain frequencies. Especially 11426V on Astra 28.2.

So this patch is for review only and marked not applicable on Patchwork.

tvboxspy

#4 lore raw
In reply to Sébastien RAILLARD (COEXSI)
Quoted 10 lines · On Wednesday 29 June 2011 15:16:10 Sébastien RAILLARD wrote:

Dear all,

We have found what seems to be a tuning issue in the driver for the ALPS BSBE1-D01A used in the new TT-S-1500b card from Technotrend.
On some transponders, like ASTRA 19.2E 11817-V-27500, the card can work very well (no lock issues) for hours.

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.

Afaics the problem is caused by the tuning loop

    for (tm = -6; tm < 7;)

in stv0288_set_frontend().

I doubt that this code works reliably.
Apparently it never obtains a lock within the given delay (30us).

Could you please try the attached patch?
It disables the loop and tries to tune to the center frequency.

CU
Oliver

Signature · 5 lines
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
4 MByte Mod: http://www.escape-edv.de/endriss/dvb-mem-mod/
Full-TS Mod: http://www.escape-edv.de/endriss/dvb-full-ts-mod/
----------------------------------------------------------------
drivers/media/dvb/frontends/stv0288.c +5 -0
index 8e0cfad..4ffe7da 100644
@@ -488,6 +488,10 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
 	/* Carrier lock control register */
 	stv0288_writeregI(state, 0x15, 0xc5);
 
+#if 1 /* TEST */
+	stv0288_writeregI(state, 0x2b, 0);
+	stv0288_writeregI(state, 0x2c, 0);
+#else
 	tda[0] = 0x2b; /* CFRM */
 	tda[2] = 0x0; /* CFRL */
 	for (tm = -6; tm < 7;) {
@@ -503,6 +507,7 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
 		stv0288_writeregI(state, 0x2c, tda[2]);
 		udelay(30);
 	}
+#endif
 
 	state->tuner_frequency = c->frequency;
 	state->fec_inner = FEC_AUTO;
#5 lore raw
Quoted 22 lines

-----Original Message-----
From: Oliver Endriss [mailto:[email protected]]
Sent: lundi 4 juillet 2011 00:43
To: Linux Media Mailing List
Cc: Sébastien RAILLARD (COEXSI); Malcolm Priestley
Subject: Re: [DVB] TT S-1500b tuning issue

Quoted 10 lines · On Wednesday 29 June 2011 15:16:10 Sébastien RAILLARD wrote:

Dear all,

We have found what seems to be a tuning issue in the driver for the ALPS BSBE1-D01A used in the new TT-S-1500b card from Technotrend. On some transponders, like ASTRA 19.2E 11817-V-27500, the card can work very well (no lock issues) for hours.

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.

Afaics the problem is caused by the tuning loop

Quoted 9 lines
    for (tm = -6; tm < 7;)

in stv0288_set_frontend().

I doubt that this code works reliably.
Apparently it never obtains a lock within the given delay (30us).

Could you please try the attached patch?
It disables the loop and tries to tune to the center frequency.

Ok, I've tested this patch with ASTRA 19.2 #24 transponder that wasn't always working: it seems to work.
I think it would be great to test it for few days more to be sure.

Quoted 9 lines

CU
Oliver

--
----------------------------------------------------------------
VDR Remote Plugin 0.4.0: http://www.escape-edv.de/endriss/vdr/
4 MByte Mod: http://www.escape-edv.de/endriss/dvb-mem-mod/
Full-TS Mod: http://www.escape-edv.de/endriss/dvb-full-ts-mod/
----------------------------------------------------------------

#6 lore raw
Quoted 20 lines · Sébastien RAILLARD (COEXSI)
Quoted 20 lines

-----Original Message-----
From: Oliver Endriss [mailto:[email protected]]
Sent: lundi 4 juillet 2011 00:43
To: Linux Media Mailing List
Cc: Sébastien RAILLARD (COEXSI); Malcolm Priestley
Subject: Re: [DVB] TT S-1500b tuning issue

Quoted 10 lines · On Wednesday 29 June 2011 15:16:10 Sébastien RAILLARD wrote:

Dear all,

We have found what seems to be a tuning issue in the driver for the ALPS BSBE1-D01A used in the new TT-S-1500b card from Technotrend. On some transponders, like ASTRA 19.2E 11817-V-27500, the card can work very well (no lock issues) for hours.

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.

Quoted 6 lines
Quoted 6 lines

Afaics the problem is caused by the tuning loop

    for (tm = -6; tm < 7;)

in stv0288_set_frontend().

I doubt that this code works reliably.
Apparently it never obtains a lock within the given delay (30us).

It's actually quite slow caused by any delay in the I2C bus. I doubt given the age many controllers run at the 400kHz spec, if barely 100kHz.

Quoted 8 lines
Quoted 4 lines

Could you please try the attached patch?
It disables the loop and tries to tune to the center frequency.

Ok, I've tested this patch with ASTRA 19.2 #24 transponder that wasn't always working: it seems to work.
I think it would be great to test it for few days more to be sure.

Unfortunately, this patch does not work well at all.

All that is happening is that the carrier offset is getting forced to 0, after it has been updated by the lock control register losing a 'good' lock.

The value is typically around ~f800+.

Perhaps the loop should be knocked down slightly to -9. The loop was probably intended for 22000 symbol rate.

tvboxspy

#7 lore raw

PATCH 1/1 STV0288 frontend provide wider carrier search and DVB-S2 drop out.

Quoted 41 lines · Malcolm Priestley
Quoted 20 lines · Sébastien RAILLARD (COEXSI)
Quoted 20 lines

-----Original Message-----
From: Oliver Endriss [mailto:[email protected]]
Sent: lundi 4 juillet 2011 00:43
To: Linux Media Mailing List
Cc: Sébastien RAILLARD (COEXSI); Malcolm Priestley
Subject: Re: [DVB] TT S-1500b tuning issue

Quoted 10 lines · On Wednesday 29 June 2011 15:16:10 Sébastien RAILLARD wrote:

Dear all,

We have found what seems to be a tuning issue in the driver for the ALPS BSBE1-D01A used in the new TT-S-1500b card from Technotrend. On some transponders, like ASTRA 19.2E 11817-V-27500, the card can work very well (no lock issues) for hours.

On some other transponders, like ASTRA 19.2E 11567-V-22000, the card nearly never manage to get the lock: it's looking like the signal isn't good enough.

Quoted 6 lines
Quoted 6 lines

Afaics the problem is caused by the tuning loop

    for (tm = -6; tm < 7;)

in stv0288_set_frontend().

I doubt that this code works reliably.
Apparently it never obtains a lock within the given delay (30us).

It's actually quite slow caused by any delay in the I2C bus. I doubt given the age many controllers run at the 400kHz spec, if barely 100kHz.

Quoted 8 lines
Quoted 4 lines

Could you please try the attached patch?
It disables the loop and tries to tune to the center frequency.

Ok, I've tested this patch with ASTRA 19.2 #24 transponder that wasn't always working: it seems to work.
I think it would be great to test it for few days more to be sure.

Unfortunately, this patch does not work well at all.

Quoted 8 lines

All that is happening is that the carrier offset is getting forced to 0, after it has been updated by the lock control register losing a 'good' lock.

The value is typically around ~f800+.

Perhaps the loop should be knocked down slightly to -9. The loop was probably intended for 22000 symbol rate.

The following patch provides wider carrier search.

As with existing code search starts at MSB aligned. The boundary is widened to start at -9. In order to save time, if no carrier is detected at the start it advances to the next alignment until carrier is found.

The stv0288 will detect a DVB-S2 carrier on all steps , a time out of 11 steps is introduced to drop out of the loop.

In stv0288_set_symbol carrier and timing loops are restored to default values (inittab) before setting the symbol rate on each tune. A slight drift was noticed with full scan in the higher IF frequencies of each band.

---
 drivers/media/dvb/frontends/stv0288.c |   29
+++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)
(quoted diff) +0 -0

b/drivers/media/dvb/frontends/stv0288.c
index 8e0cfad..0aa3962 100644

drivers/media/dvb/frontends/stv0288.c +0 -0
@@ -127,6 +127,11 @@ static int stv0288_set_symbolrate(struct

dvb_frontend *fe, u32 srate)
if ((srate < 1000000) || (srate > 45000000))
return -EINVAL;

+ stv0288_writeregI(state, 0x22, 0);
+ stv0288_writeregI(state, 0x23, 0);
+ stv0288_writeregI(state, 0x2b, 0xff);
+ stv0288_writeregI(state, 0x2c, 0xf7);
+
temp = (unsigned int)srate / 1000;

temp = temp * 32768;
@@ -461,6 +466,7 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,

char tm;
unsigned char tda[3];
+ u8 reg, time_out = 0;

dprintk("%s : FE_SET_FRONTEND\n", __func__);

@@ -488,22 +494,29 @@ static int stv0288_set_frontend(struct dvb_frontend *fe,
/* Carrier lock control register */ stv0288_writeregI(state, 0x15, 0xc5);

- tda[0] = 0x2b; /* CFRM */
tda[2] = 0x0; /* CFRL */
- for (tm = -6; tm < 7;) {
+ for (tm = -9; tm < 7;) {
/* Viterbi status */
- if (stv0288_readreg(state, 0x24) & 0x8)
- break;
-
- tda[2] += 40;
- if (tda[2] < 40)
+ reg = stv0288_readreg(state, 0x24);
+ if (reg & 0x8)
+ break;
+ if (reg & 0x80) {
+ time_out++;
+ if (time_out > 10)
+ break;
+ tda[2] += 40;
+ if (tda[2] < 40)
+ tm++;
+ } else {
tm++;
+ tda[2] = 0;
+ time_out = 0;
+ }
tda[1] = (unsigned char)tm; stv0288_writeregI(state, 0x2b, tda[1]); stv0288_writeregI(state, 0x2c, tda[2]); udelay(30);
}
-
state->tuner_frequency = c->frequency; state->fec_inner = FEC_AUTO; state->symbol_rate = c->symbol_rate;

Signature · 1 line
1.7.4.1