Skip to contentSkip to conversation

Add FEC rates, S2X params and 64K transmission

PATCH Superseded Daniel Scheller 2 participants 7 messages Jan 22, 2018 – Mar 6, 2018

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover Add FEC rates, S2X params and 64K transmission

From: Daniel Scheller <[email protected]>

dddvb brings a few additional FEC rates (1/4 and 1/3), 64/128/256APSK modulations and more rolloff factors (DVB-S2X), and 64K transmission mode (DVB-T2). These rather trivial patches bring them to mainline, and puts these missing bits into the stv0910's get_frontend() callback (FEC 1/4 and 1/3 are handled throughout the rest of the demod driver already). In addition (as suggestion from Richard Scobie), the stv0910 driver now reports it's active delivery system.

Changes from v1 to v2:
- DVB-S2X rolloff factors and reporting
- report of the active delivery system in stv0910:get_frontend()

Daniel Scheller (5):
media: dvb_frontend: add FEC modes, S2X modulations and 64K
transmission
media: dvb_frontend: add DVB-S2X rolloff factors
media: dvb-frontends/stv0910: report FEC 1/4 and 1/3 in get_frontend()
media: dvb-frontends/stv0910: report S2 rolloff in get_frontend()
media: dvb-frontends/stv0910: report active delsys in get_frontend()

 Documentation/media/frontend.h.rst.exceptions |  9 +++++++++
 drivers/media/dvb-core/dvb_frontend.c         |  9 +++++++++
 drivers/media/dvb-frontends/stv0910.c         | 16 ++++++++++-----
 include/uapi/linux/dvb/frontend.h             | 29 ++++++++++++++++++++++-----
 4 files changed, 53 insertions(+), 10 deletions(-)
Signature · 1 line
2.13.6
#1 lore raw

PATCH v2 1/5 media: dvb_frontend: add FEC modes, S2X modulations and 64K transmission

From: Daniel Scheller <[email protected]>

Add 1/4 and 1/3 FEC ratios, 64/128/256-APSK S2X modulations and 64K transmission mode. Update relevant doc items aswell.

---
 Documentation/media/frontend.h.rst.exceptions |  6 ++++++
 include/uapi/linux/dvb/frontend.h             | 13 +++++++++++++
 2 files changed, 19 insertions(+)
Documentation/media/frontend.h.rst.exceptions +6 -0
index f7c4df620a52..ae1148be0a39 100644
@@ -84,6 +84,9 @@ ignore symbol APSK_16
 ignore symbol APSK_32
 ignore symbol DQPSK
 ignore symbol QAM_4_NR
+ignore symbol APSK_64
+ignore symbol APSK_128
+ignore symbol APSK_256
 
 ignore symbol SEC_VOLTAGE_13
 ignore symbol SEC_VOLTAGE_18
@@ -117,6 +120,8 @@ ignore symbol FEC_AUTO
 ignore symbol FEC_3_5
 ignore symbol FEC_9_10
 ignore symbol FEC_2_5
+ignore symbol FEC_1_4
+ignore symbol FEC_1_3
 
 ignore symbol TRANSMISSION_MODE_AUTO
 ignore symbol TRANSMISSION_MODE_1K
@@ -129,6 +134,7 @@ ignore symbol TRANSMISSION_MODE_C1
 ignore symbol TRANSMISSION_MODE_C3780
 ignore symbol TRANSMISSION_MODE_2K
 ignore symbol TRANSMISSION_MODE_8K
+ignore symbol TRANSMISSION_MODE_64K
 
 ignore symbol GUARD_INTERVAL_AUTO
 ignore symbol GUARD_INTERVAL_1_128
include/uapi/linux/dvb/frontend.h +13 -0
index 4f9b4551c534..227268a657cd 100644
@@ -296,6 +296,8 @@ enum fe_spectral_inversion {
  * @FEC_3_5:  Forward Error Correction Code 3/5
  * @FEC_9_10: Forward Error Correction Code 9/10
  * @FEC_2_5:  Forward Error Correction Code 2/5
+ * @FEC_1_4:  Forward Error Correction Code 1/4
+ * @FEC_1_3:  Forward Error Correction Code 1/3
  *
  * Please note that not all FEC types are supported by a given standard.
  */
@@ -313,6 +315,8 @@ enum fe_code_rate {
 	FEC_3_5,
 	FEC_9_10,
 	FEC_2_5,
+	FEC_1_4,
+	FEC_1_3,
 };
 
 /**
@@ -331,6 +335,9 @@ enum fe_code_rate {
  * @APSK_32:	32-APSK modulation
  * @DQPSK:	DQPSK modulation
  * @QAM_4_NR:	4-QAM-NR modulation
+ * @APSK_64:	64-APSK modulation
+ * @APSK_128:	128-APSK modulation
+ * @APSK_256:	256-APSK modulation
  *
  * Please note that not all modulations are supported by a given standard.
  *
@@ -350,6 +357,9 @@ enum fe_modulation {
 	APSK_32,
 	DQPSK,
 	QAM_4_NR,
+	APSK_64,
+	APSK_128,
+	APSK_256,
 };
 
 /**
@@ -374,6 +384,8 @@ enum fe_modulation {
  *	Single Carrier (C=1) transmission mode (DTMB only)
  * @TRANSMISSION_MODE_C3780:
  *	Multi Carrier (C=3780) transmission mode (DTMB only)
+ * @TRANSMISSION_MODE_64K:
+ *	Transmission mode 64K
  *
  * Please note that not all transmission modes are supported by a given
  * standard.
@@ -388,6 +400,7 @@ enum fe_transmit_mode {
 	TRANSMISSION_MODE_32K,
 	TRANSMISSION_MODE_C1,
 	TRANSMISSION_MODE_C3780,
+	TRANSMISSION_MODE_64K,
 };
 
 /**
Signature · 1 line
2.13.6
#3 lore raw

PATCH v2 2/5 media: dvb_frontend: add DVB-S2X rolloff factors

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

Add 15%, 10% and 5% DVB-S2X rolloff factors. Also fix roloff typos.

---
 Documentation/media/frontend.h.rst.exceptions |  3 +++
 drivers/media/dvb-core/dvb_frontend.c         |  9 +++++++++
 include/uapi/linux/dvb/frontend.h             | 16 +++++++++++-----
 3 files changed, 23 insertions(+), 5 deletions(-)
Documentation/media/frontend.h.rst.exceptions +3 -0
index ae1148be0a39..c1643ce93426 100644
@@ -167,6 +167,9 @@ ignore symbol ROLLOFF_35
 ignore symbol ROLLOFF_20
 ignore symbol ROLLOFF_25
 ignore symbol ROLLOFF_AUTO
+ignore symbol ROLLOFF_15
+ignore symbol ROLLOFF_10
+ignore symbol ROLLOFF_5
 
 ignore symbol INVERSION_ON
 ignore symbol INVERSION_OFF
drivers/media/dvb-core/dvb_frontend.c +9 -0
index 722b86a43497..e5105c1783b8 100644
@@ -2183,6 +2183,15 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
 		break;
 	case SYS_DVBS2:
 		switch (c->rolloff) {
+		case ROLLOFF_5:
+			rolloff = 105;
+			break;
+		case ROLLOFF_10:
+			rolloff = 110;
+			break;
+		case ROLLOFF_15:
+			rolloff = 115;
+			break;
 		case ROLLOFF_20:
 			rolloff = 120;
 			break;
include/uapi/linux/dvb/frontend.h +11 -5
index 227268a657cd..8bf1c63627a2 100644
@@ -580,20 +580,26 @@ enum fe_pilot {
 
 /**
  * enum fe_rolloff - Rolloff factor
- * @ROLLOFF_35:		Roloff factor: α=35%
- * @ROLLOFF_20:		Roloff factor: α=20%
- * @ROLLOFF_25:		Roloff factor: α=25%
- * @ROLLOFF_AUTO:	Auto-detect the roloff factor.
+ * @ROLLOFF_35:		Rolloff factor: α=35%
+ * @ROLLOFF_20:		Rolloff factor: α=20%
+ * @ROLLOFF_25:		Rolloff factor: α=25%
+ * @ROLLOFF_AUTO:	Auto-detect the rolloff factor.
+ * @ROLLOFF_15:		Rolloff factor: α=15%
+ * @ROLLOFF_10:		Rolloff factor: α=10%
+ * @ROLLOFF_5:		Rolloff factor: α=5%
  *
  * .. note:
  *
- *    Roloff factor of 35% is implied on DVB-S. On DVB-S2, it is default.
+ *    Rolloff factor of 35% is implied on DVB-S. On DVB-S2, it is default.
  */
 enum fe_rolloff {
 	ROLLOFF_35,
 	ROLLOFF_20,
 	ROLLOFF_25,
 	ROLLOFF_AUTO,
+	ROLLOFF_15,
+	ROLLOFF_10,
+	ROLLOFF_5,
 };
 
 /**
Signature · 1 line
2.13.6
#4 lore raw

PATCH v2 3/5 media: dvb-frontends/stv0910: report FEC 1/4 and 1/3 in get_frontend()

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

The first two missing FECs in the modcod2fec fe_code_rate table were 1/4 and 1/3. Add them as they're now defined by the API.

---
 drivers/media/dvb-frontends/stv0910.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/dvb-frontends/stv0910.c +1 -1
index a2f7c0c1587f..de132a85e537 100644
@@ -1562,7 +1562,7 @@ static int get_frontend(struct dvb_frontend *fe,
 			APSK_32,
 		};
 		const enum fe_code_rate modcod2fec[0x20] = {
-			FEC_NONE, FEC_NONE, FEC_NONE, FEC_2_5,
+			FEC_NONE, FEC_1_4, FEC_1_3, FEC_2_5,
 			FEC_1_2, FEC_3_5, FEC_2_3, FEC_3_4,
 			FEC_4_5, FEC_5_6, FEC_8_9, FEC_9_10,
 			FEC_3_5, FEC_2_3, FEC_3_4, FEC_5_6,
Signature · 1 line
2.13.6
#5 lore raw

PATCH v2 4/5 media: dvb-frontends/stv0910: report S2 rolloff in get_frontend()

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

Report the currently used S2 rolloff factor in get_frontend(). For cosmetic reasons, also change all feroll_off occurences to fe_rolloff.

---
 drivers/media/dvb-frontends/stv0910.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/media/dvb-frontends/stv0910.c +8 -4
index de132a85e537..7ab014cec56c 100644
@@ -113,7 +113,7 @@ struct stv {
 	enum fe_stv0910_mod_cod  mod_cod;
 	enum dvbs2_fectype       fectype;
 	u32                      pilots;
-	enum fe_stv0910_roll_off feroll_off;
+	enum fe_stv0910_roll_off fe_rolloff;
 
 	int   is_standard_broadcast;
 	int   is_vcm;
@@ -541,7 +541,7 @@ static int get_signal_parameters(struct stv *state)
 		}
 		state->is_vcm = 0;
 		state->is_standard_broadcast = 1;
-		state->feroll_off = FE_SAT_35;
+		state->fe_rolloff = FE_SAT_35;
 	}
 	return 0;
 }
@@ -1300,14 +1300,14 @@ static int manage_matype_info(struct stv *state)
 
 		read_regs(state, RSTV0910_P2_MATSTR1 + state->regoff,
 			  bbheader, 2);
-		state->feroll_off =
+		state->fe_rolloff =
 			(enum fe_stv0910_roll_off)(bbheader[0] & 0x03);
 		state->is_vcm = (bbheader[0] & 0x10) == 0;
 		state->is_standard_broadcast = (bbheader[0] & 0xFC) == 0xF0;
 	} else if (state->receive_mode == RCVMODE_DVBS) {
 		state->is_vcm = 0;
 		state->is_standard_broadcast = 1;
-		state->feroll_off = FE_SAT_35;
+		state->fe_rolloff = FE_SAT_35;
 	}
 	return 0;
 }
@@ -1571,11 +1571,15 @@ static int get_frontend(struct dvb_frontend *fe,
 			FEC_3_4, FEC_4_5, FEC_5_6, FEC_8_9,
 			FEC_9_10
 		};
+		const enum fe_rolloff ro2ro[4] = {
+			ROLLOFF_35, ROLLOFF_25, ROLLOFF_20, ROLLOFF_15,
+		};
 		read_reg(state, RSTV0910_P2_DMDMODCOD + state->regoff, &tmp);
 		mc = ((tmp & 0x7c) >> 2);
 		p->pilot = (tmp & 0x01) ? PILOT_ON : PILOT_OFF;
 		p->modulation = modcod2mod[mc];
 		p->fec_inner = modcod2fec[mc];
+		p->rolloff = ro2ro[state->fe_rolloff];
 	} else if (state->receive_mode == RCVMODE_DVBS) {
 		read_reg(state, RSTV0910_P2_VITCURPUN + state->regoff, &tmp);
 		switch (tmp & 0x1F) {
Signature · 1 line
2.13.6
#6 lore raw

PATCH v2 5/5 media: dvb-frontends/stv0910: report active delsys in get_frontend()

In reply to Daniel Scheller

From: Daniel Scheller <[email protected]>

Report the active delivery system based on the receive_mode state of the demodulator.

---
 drivers/media/dvb-frontends/stv0910.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/media/dvb-frontends/stv0910.c +2 -0
index 7ab014cec56c..6e6a70ad7354 100644
@@ -1580,6 +1580,7 @@ static int get_frontend(struct dvb_frontend *fe,
 		p->modulation = modcod2mod[mc];
 		p->fec_inner = modcod2fec[mc];
 		p->rolloff = ro2ro[state->fe_rolloff];
+		p->delivery_system = SYS_DVBS2;
 	} else if (state->receive_mode == RCVMODE_DVBS) {
 		read_reg(state, RSTV0910_P2_VITCURPUN + state->regoff, &tmp);
 		switch (tmp & 0x1F) {
@@ -1603,6 +1604,7 @@ static int get_frontend(struct dvb_frontend *fe,
 			break;
 		}
 		p->rolloff = ROLLOFF_35;
+		p->delivery_system = SYS_DVBS;
 	}
 
 	if (state->receive_mode != RCVMODE_NONE) {
Signature · 1 line
2.13.6
#2 lore raw

Re: [PATCH v2 1/5] media: dvb_frontend: add FEC modes, S2X modulations and 64K transmission

In reply to Daniel Scheller

Hi Daniel,

Em Mon, 22 Jan 2018 18:13:42 +0100
Daniel Scheller <[email protected]> escreveu:

Quoted 4 lines

From: Daniel Scheller <[email protected]>

Add 1/4 and 1/3 FEC ratios, 64/128/256-APSK S2X modulations and 64K transmission mode. Update relevant doc items aswell.

Please properly document DVB-S2X. You need to add something at Documentation/media/uapi/dvb/fe_property_parameters.rst,
and Documentation/media/uapi/dvb/frontend-property-satellite-systems.rst in order to properly describe DVB-S2X.

Please take a look at:
https://linuxtv.org/downloads/v4l-dvb-apis-new/uapi/dvb/fe_property_parameters.html
and:
https://linuxtv.org/downloads/v4l-dvb-apis-new/uapi/dvb/frontend-property-satellite-systems.html

Basically, for each DVB-S2X parameter, you should say what values are valid.

Also, I'm not seeing a SYS_DVBS2X delivery system. If the idea is not to create it, the documentation should state that SYS_DVBS2 should be used, and the Kernel should provide some way to allow userspace to detect if the DVB-S2X parameters are valid or not.

As we're running out of DVB frontend caps flags, it means that you need to also add a patch to this series implementing a new way to query frontend capabilities.

Regards,
Mauro

Quoted 90 lines
---
 Documentation/media/frontend.h.rst.exceptions |  6 ++++++
 include/uapi/linux/dvb/frontend.h             | 13 +++++++++++++
 2 files changed, 19 insertions(+)
Documentation/media/frontend.h.rst.exceptions +6 -0
index f7c4df620a52..ae1148be0a39 100644
@@ -84,6 +84,9 @@ ignore symbol APSK_16
 ignore symbol APSK_32
 ignore symbol DQPSK
 ignore symbol QAM_4_NR
+ignore symbol APSK_64
+ignore symbol APSK_128
+ignore symbol APSK_256
 
 ignore symbol SEC_VOLTAGE_13
 ignore symbol SEC_VOLTAGE_18
@@ -117,6 +120,8 @@ ignore symbol FEC_AUTO
 ignore symbol FEC_3_5
 ignore symbol FEC_9_10
 ignore symbol FEC_2_5
+ignore symbol FEC_1_4
+ignore symbol FEC_1_3
 
 ignore symbol TRANSMISSION_MODE_AUTO
 ignore symbol TRANSMISSION_MODE_1K
@@ -129,6 +134,7 @@ ignore symbol TRANSMISSION_MODE_C1
 ignore symbol TRANSMISSION_MODE_C3780
 ignore symbol TRANSMISSION_MODE_2K
 ignore symbol TRANSMISSION_MODE_8K
+ignore symbol TRANSMISSION_MODE_64K
 
 ignore symbol GUARD_INTERVAL_AUTO
 ignore symbol GUARD_INTERVAL_1_128
include/uapi/linux/dvb/frontend.h +12 -0
index 4f9b4551c534..227268a657cd 100644
@@ -296,6 +296,8 @@ enum fe_spectral_inversion {
  * @FEC_3_5:  Forward Error Correction Code 3/5
  * @FEC_9_10: Forward Error Correction Code 9/10
  * @FEC_2_5:  Forward Error Correction Code 2/5
+ * @FEC_1_4:  Forward Error Correction Code 1/4
+ * @FEC_1_3:  Forward Error Correction Code 1/3
  *
  * Please note that not all FEC types are supported by a given standard.
  */
@@ -313,6 +315,8 @@ enum fe_code_rate {
 	FEC_3_5,
 	FEC_9_10,
 	FEC_2_5,
+	FEC_1_4,
+	FEC_1_3,
 };
 
 /**
@@ -331,6 +335,9 @@ enum fe_code_rate {
  * @APSK_32:	32-APSK modulation
  * @DQPSK:	DQPSK modulation
  * @QAM_4_NR:	4-QAM-NR modulation
+ * @APSK_64:	64-APSK modulation
+ * @APSK_128:	128-APSK modulation
+ * @APSK_256:	256-APSK modulation
  *
  * Please note that not all modulations are supported by a given standard.
  *
@@ -350,6 +357,9 @@ enum fe_modulation {
 	APSK_32,
 	DQPSK,
 	QAM_4_NR,
+	APSK_64,
+	APSK_128,
+	APSK_256,
 };
 
 /**
@@ -374,6 +384,8 @@ enum fe_modulation {
  *	Single Carrier (C=1) transmission mode (DTMB only)
  * @TRANSMISSION_MODE_C3780:
  *	Multi Carrier (C=3780) transmission mode (DTMB only)
+ * @TRANSMISSION_MODE_64K:
+ *	Transmission mode 64K
  *
  * Please note that not all transmission modes are supported by a given
  * standard.

include/uapi/linux/dvb/frontend.h enum fe_transmit_mode { · line 406

Quoted 7 lines
include/uapi/linux/dvb/frontend.h +1 -0
@@ -388,6 +400,7 @@ enum fe_transmit_mode {
 	TRANSMISSION_MODE_32K,
 	TRANSMISSION_MODE_C1,
 	TRANSMISSION_MODE_C3780,
+	TRANSMISSION_MODE_64K,
 };
 
 /**

Thanks,
Mauro