Skip to contentSkip to conversation

cx24116 DVB-S modulation fix

PATCH In review Christophe Thommeret 4 participants 9 messages Oct 14, 2008 – Oct 15, 2008 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cx24116 DVB-S modulation fix

Hi,

This patch makes cx24116 to behave like other dvb-s frontends. This is needed especially because QAM_AUTO is used in a lot of scan files.

Signature · 1 line
Christophe Thommeret
linux/drivers/media/dvb/frontends/cx24116.c +5 -14
diff -r 6b6e9be35963 linux/drivers/media/dvb/frontends/cx24116.c
@@ -1230,23 +1230,14 @@ static int cx24116_set_frontend(struct d
 	case SYS_DVBS:
 		dprintk("%s: DVB-S delivery system selected\n", __func__);
 
-		/* Only QPSK is supported for DVB-S */
-		if (c->modulation != QPSK) {
-			dprintk("%s: unsupported modulation selected (%d)\n",
-				__func__, c->modulation);
-			return -EOPNOTSUPP;
-		}
+		/* Only QPSK is supported for DVB-S,then .. */
+		state->dnxt.modulation = QPSK;
 
 		/* Pilot doesn't exist in DVB-S, turn bit off */
 		state->dnxt.pilot_val = CX24116_PILOT_OFF;
 		retune = 1;
 
-		/* DVB-S only supports 0.35 */
-		if (c->rolloff != ROLLOFF_35) {
-			dprintk("%s: unsupported rolloff selected (%d)\n",
-				__func__, c->rolloff);
-			return -EOPNOTSUPP;
-		}
+		/* DVB-S only supports 0.35, then .. */
 		state->dnxt.rolloff_val = CX24116_ROLLOFF_035;
 		break;
 
@@ -1262,6 +1253,7 @@ static int cx24116_set_frontend(struct d
 				__func__, c->modulation);
 			return -EOPNOTSUPP;
 		}
+		state->dnxt.modulation = c->modulation;
 
 		switch (c->pilot) {
 		case PILOT_AUTO:	/* Not supported but emulated */
@@ -1301,7 +1293,6 @@ static int cx24116_set_frontend(struct d
 			__func__, c->delivery_system);
 		return -EOPNOTSUPP;
 	}
-	state->dnxt.modulation = c->modulation;
 	state->dnxt.frequency = c->frequency;
 	state->dnxt.pilot = c->pilot;
 	state->dnxt.rolloff = c->rolloff;
@@ -1311,7 +1302,7 @@ static int cx24116_set_frontend(struct d
 		return ret;
 
 	/* FEC_NONE/AUTO for DVB-S2 is not supported and detected here */
-	ret = cx24116_set_fec(state, c->modulation, c->fec_inner);
+	ret = cx24116_set_fec(state, state->dnxt.modulation, c->fec_inner);
 	if (ret !=  0)
 		return ret;
 

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#1 lore raw

In message <[email protected]>, Christophe Thommeret wrote:

hi

Quoted 3 lines

Hi,

This patch makes cx24116 to behave like other dvb-s frontends.

Unlike most DVB-S cards the those with a cx24116 use S2API this makes them somewhat different.

Quoted 1 line

This is needed especially because QAM_AUTO is used in a lot of scan files.

What scan files are you referring to? The
cx24116 only does PSK, not AM. QAM_AUTO
doesn't sound right. the cx24116 can't
auto detect anything, but that's another
story...

if you are seeing problems with the S2API then ensure that you issue a DTV_CLEAR prior to programming the correct parameters for a particular delivery system.

if you are seeing problems with the legacy API then there could be a problem with the legacy to S2API cache sync, you need to give more details for this to be investigated.

cya!

--

// /
{:)==={ Darron Broad <[email protected]>
\\ \

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#2 lore raw

Le Tuesday 14 October 2008 12:29:49 Darron Broad, vous avez écrit :

Quoted 11 lines

In message <[email protected]>, Christophe Thommeret wrote:

hi

Quoted 3 lines

Hi,

This patch makes cx24116 to behave like other dvb-s frontends.

Unlike most DVB-S cards the those with a cx24116 use S2API this makes them somewhat different.

Quoted 7 lines
Quoted 1 line

This is needed especially because QAM_AUTO is used in a lot of scan files.

What scan files are you referring to? The
cx24116 only does PSK, not AM. QAM_AUTO
doesn't sound right. the cx24116 can't
auto detect anything, but that's another
story...

dvbscan initial tuning data files for DVB-S don't have an entry for modulation. So an app like kaffeine simply set modulation to QAM_AUTO. Why not QPSK, you ask? Simply because DVB-S standard allows QPSK and 16QAM. Maybe there is not a single 16QAM TP all over the world, but it's still a valid modulation for DVB-S.
So, we set modulation to QAM_AUTO when it's unknown/unspecified, like in dvbscan files (those being also used by kaffeine). And it works pretty well, just because most dvb-s can only do QPSK and so force modulation to QPSK instead of returning a notsup.
See this as software QAM_AUTO :)

P.S.
This is with s2api.

Signature · 7 lines
Christophe Thommeret


_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
#3 lore raw
Quoted 18 lines · Christophe Thommeret

Le Tuesday 14 October 2008 12:29:49 Darron Broad, vous avez écrit :

Quoted 10 lines

In message <[email protected]>, Christophe Thommeret wrote:

hi

Quoted 3 lines

Hi,

This patch makes cx24116 to behave like other dvb-s frontends.

Unlike most DVB-S cards the those with a cx24116 use S2API this makes them somewhat different.

Quoted 6 lines
Quoted 1 line

This is needed especially because QAM_AUTO is used in a lot of scan files.

What scan files are you referring to? The
cx24116 only does PSK, not AM. QAM_AUTO
doesn't sound right. the cx24116 can't
auto detect anything, but that's another
story...

Quoted 10 lines

dvbscan initial tuning data files for DVB-S don't have an entry for modulation. So an app like kaffeine simply set modulation to QAM_AUTO. Why not QPSK, you ask? Simply because DVB-S standard allows QPSK and 16QAM. Maybe there is not a single 16QAM TP all over the world, but it's still a valid modulation for DVB-S.
So, we set modulation to QAM_AUTO when it's unknown/unspecified, like in dvbscan files (those being also used by kaffeine). And it works pretty well, just because most dvb-s can only do QPSK and so force modulation to QPSK instead of returning a notsup.
See this as software QAM_AUTO :)

I've only glanced briefly at the patch but setting the modulation type to QAM_AUTO, and expecting the card to support it I think is a bad idea.

I can accept the argument that the current driver will not accept 16QAM, but that's not the problem being discussed. (I'll address this in a separate patch)

Call DTV_CLEAR should also default your rolloff to 3.5.

Let's investigate a better approach.

kaffeine should be working well already, with the current code. Unless it was recently broken - in which case please discuss.

- Steve

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#4 lore raw
In reply to Christophe Thommeret

In message <[email protected]>, Christophe Thommeret wrote:

LO

Quoted 21 lines

Le Tuesday 14 October 2008 12:29:49 Darron Broad, vous avez =E9crit=A0:

Quoted 12 lines

In message <[email protected]>, Christophe Thommeret wrote:

hi

Quoted 3 lines

Hi,

This patch makes cx24116 to behave like other dvb-s frontends.

Unlike most DVB-S cards the those with a cx24116 use S2API this makes them somewhat different.

Quoted 1 line

This is needed especially because QAM_AUTO is used in a lot of scan file=

s.

Quoted 6 lines

What scan files are you referring to? The
cx24116 only does PSK, not AM. QAM_AUTO
doesn't sound right. the cx24116 can't
auto detect anything, but that's another
story...

Quoted 4 lines

dvbscan initial tuning data files for DVB-S don't have an entry for=20 modulation. So an app like kaffeine simply set modulation to QAM_AUTO. Why not QPSK, you ask? Simply because DVB-S standard allows QPSK and 16QAM.=

It doesn't include modulation because QPSK is implied.

Quoted 2 lines

Maybe there is not a single 16QAM TP all over the world, but it's still a=20 valid modulation for DVB-S.

As is said, the cx24116 only does PSK.

The driver should return unsupported for anything it can't do.

If someone out there actually uses 16-QAM (who are you?) and that person switches to an adapter with a cx24116 they should be informed of error when tuning 16-QAM, not acceptance of something it doesn't support.

Quoted 9 lines

So, we set modulation to QAM_AUTO when it's unknown/unspecified, like in=20 dvbscan files (those being also used by kaffeine). And it works pretty well= ,=20
just because most dvb-s can only do QPSK and so force modulation to QPSK=20 instead of returning a notsup.
See this as software QAM_AUTO :)

P.S.
This is with s2api.

When you use DVB-S delivery you should set the modulation to QPSK. If an end-user out there really needs 16-QAM then you should allow them the option to change it to QAM_16. I do not think this is going inconvenience many people.

cya

--

// /
{:)==={ Darron Broad <[email protected]>
\\ \

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#5 lore raw

Le Tuesday 14 October 2008 19:02:03 Darron Broad, vous avez écrit :

Quoted 53 lines

In message <[email protected]>, Christophe Thommeret wrote:

LO

Quoted 24 lines

Le Tuesday 14 October 2008 12:29:49 Darron Broad, vous avez =E9crit=A0:

Quoted 14 lines

In message <[email protected]>, Christophe Thommeret wrote:

hi

Quoted 3 lines

Hi,

This patch makes cx24116 to behave like other dvb-s frontends.

Unlike most DVB-S cards the those with a cx24116 use S2API this makes them somewhat different.

Quoted 2 lines

This is needed especially because QAM_AUTO is used in a lot of scan file=

s.

Quoted 5 lines

What scan files are you referring to? The
cx24116 only does PSK, not AM. QAM_AUTO
doesn't sound right. the cx24116 can't
auto detect anything, but that's another
story...

Quoted 4 lines

dvbscan initial tuning data files for DVB-S don't have an entry for=20 modulation. So an app like kaffeine simply set modulation to QAM_AUTO. Why not QPSK, you ask? Simply because DVB-S standard allows QPSK and 16QAM.=

It doesn't include modulation because QPSK is implied.

Quoted 2 lines

Maybe there is not a single 16QAM TP all over the world, but it's still a=20 valid modulation for DVB-S.

As is said, the cx24116 only does PSK.

The driver should return unsupported for anything it can't do.

If someone out there actually uses 16-QAM (who are you?) and that person switches to an adapter with a cx24116 they should be informed of error when tuning 16-QAM, not acceptance of something it doesn't support.

Quoted 7 lines

So, we set modulation to QAM_AUTO when it's unknown/unspecified, like in=20 dvbscan files (those being also used by kaffeine). And it works pretty well= ,=20
just because most dvb-s can only do QPSK and so force modulation to QPSK=20 instead of returning a notsup.
See this as software QAM_AUTO :)

Quoted 7 lines
Quoted 2 lines

P.S.
This is with s2api.

When you use DVB-S delivery you should set the modulation to QPSK. If an end-user out there really needs 16-QAM then you should allow them the option to change it to QAM_16. I do not think this is going inconvenience many people.

Ok, you win :)

Other subject:
Would you accept some patch to enhance cx24116 pilot_auto emulation?

Signature · 7 lines
Christophe Thommeret


_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
#6 lore raw

In message <[email protected]>, Christophe Thommeret wrote:

hi.

<snip>

Quoted 2 lines

Other subject:
Would you accept some patch to enhance cx24116 pilot_auto emulation?

If you present your patch and it enhances or fixes something then I am sure people will support it.

good luck.

cya!

--

// /
{:)==={ Darron Broad <[email protected]>
\\ \

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

#7 lore raw

Le Wednesday 15 October 2008 19:22:35 Darron Broad, vous avez écrit :

Quoted 11 lines

In message <[email protected]>, Christophe Thommeret wrote:

hi.

<snip>

Quoted 2 lines

Other subject:
Would you accept some patch to enhance cx24116 pilot_auto emulation?

If you present your patch and it enhances or fixes something then I am sure people will support it.

I don't know to which tree to apply, so i give the code as is (it's pretty simple):

Since 8PSK (and higher mod) signals are very likely to have pilot symbols, pilot_auto should start with pilot_on for 8PSK.
And since QPSK signals are unlikely to have pilot, pilot_auto should start with pilot_off for QPSK.

Without the patch:
QPSK tuning delay: ~100ms
8PSK tuning delay: ~900ms
with patch:
QPSK tuning delay: ~100ms
8PSK tuning delay: ~100ms

static int cx24116_set_frontend(struct dvb_frontend* fe, struct dvb_frontend_parameters *p)
....
....
case SYS_DVBS2:
...
...

switch(c->pilot) {
				case PILOT_AUTO:	/* Not supported but emulated */
					retune = 2;	/* Fall-through */
					if ( c->modulation==QPSK )
						state->dnxt.pilot_val = CX24116_PILOT_OFF;
					else
						state->dnxt.pilot_val = CX24116_PILOT_ON;
					break;
...
...
/* Toggle pilot bit when in auto-pilot */
		if(state->dcur.pilot == PILOT_AUTO) {
			if ( state->dnxt.pilot_val== CX24116_PILOT_OFF )
				cmd.args[0x07] ^= CX24116_PILOT_ON;
			else
				cmd.args[0x07] ^= CX24116_PILOT_OFF;
		}

....
...

Signature · 7 lines
Christophe Thommeret


_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
#8 lore raw
In reply to Christophe Thommeret
Quoted 10 lines · Christophe Thommeret

dvbscan initial tuning data files for DVB-S don't have an entry for modulation. So an app like kaffeine simply set modulation to QAM_AUTO. Why not QPSK, you ask? Simply because DVB-S standard allows QPSK and 16QAM. Maybe there is not a single 16QAM TP all over the world, but it's still a valid modulation for DVB-S.
So, we set modulation to QAM_AUTO when it's unknown/unspecified, like in dvbscan files (those being also used by kaffeine). And it works pretty well, just because most dvb-s can only do QPSK and so force modulation to QPSK instead of returning a notsup.
See this as software QAM_AUTO :)

It simply doesn't make sense to specify QAM_AUTO if dvb_frontend_info.caps doesn't contain FE_CAN_QAM_AUTO (or FE_CAN_QAM_16 for that matter).

Regards,
Andreas

_______________________________________________
linux-dvb mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb