Skip to contentSkip to conversation

tda18271-fe: Fix dvb-c standard selection

PATCH In review CrazyCat 2 participants 3 messages Nov 2, 2013 – Nov 3, 2013 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

CrazyCat

author
#0 lore raw

PATCH 1/1 tda18271-fe: Fix dvb-c standard selection

Fix dvb-c standard selection - qam8 for ANNEX_AC

drivers/media/tuners/tda18271-fe.c +4 -8
index 4995b89..6a385c8 100644
@@ -960,16 +960,12 @@ static int tda18271_set_params(struct dvb_frontend *fe)
 		break;
 	case SYS_DVBC_ANNEX_B:
 		bw = 6000000;
-		/* falltrough */
+		map = &std_map->qam_6;
+		break;
 	case SYS_DVBC_ANNEX_A:
 	case SYS_DVBC_ANNEX_C:
-		if (bw <= 6000000) {
-			map = &std_map->qam_6;
-		} else if (bw <= 7000000) {
-			map = &std_map->qam_7;
-		} else {
-			map = &std_map->qam_8;
-		}
+		bw = 8000000;
+		map = &std_map->qam_8;
 		break;
 	default:
 		tda_warn("modulation type not supported!\n");
#1 lore raw

Em Sat, 02 Nov 2013 23:05:14 +0200
CrazyCat <[email protected]> escreveu:

Quoted 15 lines

Fix dvb-c standard selection - qam8 for ANNEX_AC

drivers/media/tuners/tda18271-fe.c +2 -1
index 4995b89..6a385c8 100644
@@ -960,16 +960,12 @@ static int tda18271_set_params(struct dvb_frontend *fe)
  		break;
  	case SYS_DVBC_ANNEX_B:
  		bw = 6000000;
-		/* falltrough */
+		map = &std_map->qam_6;
+		break;
  	case SYS_DVBC_ANNEX_A:

drivers/media/tuners/tda18271-fe.c static int tda18271_set_params(struct dvb_frontend *fe) · line 968

Quoted 10 lines
drivers/media/tuners/tda18271-fe.c +2 -7
  	case SYS_DVBC_ANNEX_C:
-		if (bw <= 6000000) {
-			map = &std_map->qam_6;
-		} else if (bw <= 7000000) {
-			map = &std_map->qam_7;
-		} else {
-			map = &std_map->qam_8;
-		}
+		bw = 8000000;
+		map = &std_map->qam_8;

This is wrong, as it breaks for 6MHz-spaced channels, like what's used in Brazil and Japan.

What happens here is that, if the tuner uses a too wide lowpass filter, the interference will be higher at the demod, and it may not be able to decode.

As the bandwidth is already estimated by the DVB frontend core, the tuners should be adjusted to get the closest filter for a given bandwidth.

So, the driver is correct (and it is tested under 6MHz spaced channels).

Quoted 8 lines
drivers/media/tuners/tda18271-fe.c +0 -1
  		break;
  	default:
  		tda_warn("modulation type not supported!\n");
 
--

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

Signature · 2 lines
Cheers,
Mauro

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

Em Sat, 02 Nov 2013 23:31:58 +0200
CrazyCat <[email protected]> escreveu:

Quoted 8 lines

Mauro Carvalho Chehab пишет:

Quoted 7 lines

This is wrong, as it breaks for 6MHz-spaced channels, like what's used in Brazil and Japan.

What happens here is that, if the tuner uses a too wide lowpass filter, the interference will be higher at the demod, and it may not be able to decode.

Quoted 7 lines
Quoted 5 lines

As the bandwidth is already estimated by the DVB frontend core, the tuners should be adjusted to get the closest filter for a given bandwidth.

So, the driver is correct (and it is tested under 6MHz spaced channels).

But usual applications only set cable standard (Annex A/C or B) and not set bandwidth. So for annex A/C default selected 6MHz ?

Usual applications set the symbol rate, and symbol rate is easily converted into bandwidth. The DVB core does that. see dtv_set_frontend():

	switch (c->delivery_system) {
	case SYS_ATSC:
	case SYS_DVBC_ANNEX_B:
		c->bandwidth_hz = 6000000;
		break;
	case SYS_DVBC_ANNEX_A:
		rolloff = 115;
		break;
	case SYS_DVBC_ANNEX_C:
		rolloff = 113;
		break;
	default:
		break;
	}
	if (rolloff)
		c->bandwidth_hz = (c->symbol_rate * rolloff) / 100;
Signature · 2 lines
Cheers,
Mauro