* [linux-dvb] DVBv5 (S2API) API for DVB-T
@ 2008-10-19 18:31 Patrick Boettcher
2008-12-06 11:07 ` Klaus Schmidinger
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Boettcher @ 2008-10-19 18:31 UTC (permalink / raw)
To: Steven Toth; +Cc: v4l-dvb maintainer list, linux-dvb
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1005 bytes --]
Hi Steve and others,
I was quite busy recently and only found now the time to do what I should
have done some time ago as it turned out. I could beat myself.
When I checked how DVB-T is now implemented I saw that there is one thing
which was wrong in the DVBv3 API already and is still in DVBv5.
It is regarding hierarchical transmissions and the selection of
high-priority and low-priority streams. This was not possible with DVBv3.
I quickly changed how I think it should be done and the resulting patch
can be found attached.
The worst is, that this patch changes the frontend.h and thus the user
interface. I put some comments in the code I wrote which hopefully helps
to understand why I think this is necessary.
I hope it is not too late to apply this and to go for 2.6.28 . If it is,
my bad and everyone can blame me for not having a proper hierarchical mode
implemented.
Sorry again,
Patrick.
--
Mail: patrick.boettcher@desy.de
WWW: http://www.wi-bw.tfh-wildau.de/~pboettch/
[-- Attachment #2: Type: TEXT/PLAIN, Size: 7151 bytes --]
diff -r e2a8b9b9c294 linux/drivers/media/dvb/dvb-core/dvb_frontend.c
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Fri Oct 17 19:45:55 2008 +0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.c Sun Oct 19 18:42:53 2008 +0200
@@ -845,6 +845,7 @@
.cmd = DTV_DELIVERY_SYSTEM,
.set = 1,
},
+
[DTV_HIERARCHY] = {
.name = "DTV_HIERARCHY",
.cmd = DTV_HIERARCHY,
@@ -862,16 +863,6 @@
.set = 1,
},
#endif
- [DTV_CODE_RATE_HP] = {
- .name = "DTV_CODE_RATE_HP",
- .cmd = DTV_CODE_RATE_HP,
- .set = 1,
- },
- [DTV_CODE_RATE_LP] = {
- .name = "DTV_CODE_RATE_LP",
- .cmd = DTV_CODE_RATE_LP,
- .set = 1,
- },
[DTV_GUARD_INTERVAL] = {
.name = "DTV_GUARD_INTERVAL",
.cmd = DTV_GUARD_INTERVAL,
@@ -882,6 +873,7 @@
.cmd = DTV_TRANSMISSION_MODE,
.set = 1,
},
+
/* Get */
[DTV_DISEQC_SLAVE_REPLY] = {
.name = "DTV_DISEQC_SLAVE_REPLY",
@@ -961,10 +953,15 @@
.cmd = DTV_TRANSMISSION_MODE,
.set = 0,
},
- [DTV_HIERARCHY] = {
+ [DTV_HIERARCHY] = { /* is this a hierarchical transmission - boolean*/
.name = "DTV_HIERARCHY",
.cmd = DTV_HIERARCHY,
.set = 0,
+ },
+ [DTV_ALPHA] = {
+ .name = "DTV_ALPHA",
+ .cmd = DTV_ALPHA,
+ .set = 0,
},
};
@@ -1043,14 +1040,49 @@
else
/* Including BANDWIDTH_AUTO */
c->bandwidth_hz = 0;
- c->code_rate_HP = p->u.ofdm.code_rate_HP;
- c->code_rate_LP = p->u.ofdm.code_rate_LP;
+
c->modulation = p->u.ofdm.constellation;
c->transmission_mode = p->u.ofdm.transmission_mode;
c->guard_interval = p->u.ofdm.guard_interval;
- c->hierarchy = p->u.ofdm.hierarchy_information;
+
+ if (p->u.ofdm.hierarchy_information== HIERARCHY_AUTO ||
+ p->u.ofdm.hierarchy_information == HIERARCHY_NONE) {
+ c->fec_inner = p->u.ofdm.code_rate_HP;
+ c->hierarchy = 0;
+ c->stream_selection = 1;
+ c->alpha = 1;
+ } else {
+
+ /* the previous channel descriptor does not
+ * really support hierarchy, that's why we can
+ * assume HP as selected here - closest to
+ * previous behaviour */
+ c->fec_inner = p->u.ofdm.code_rate_HP;
+
+ c->hierarchy = 1;
+ c->stream_selection = 1;
+ switch (p->u.ofdm.hierarchy_information) {
+ default: /* just to inhibit a compiler warning, both cases have been handled above */
+ case HIERARCHY_1:
+ c->alpha = 1;
+ break;
+ case HIERARCHY_2:
+ c->alpha = 2;
+ break;
+ case HIERARCHY_4:
+ c->alpha = 4;
+ break;
+ }
+ }
+
+ /* to report back the correct information to the user
+ * after a auto scan - not used for tuning */
+ c->code_rate_HP = p->u.ofdm.code_rate_HP;
+ c->code_rate_LP = p->u.ofdm.code_rate_LP;
+
c->delivery_system = SYS_DVBT;
break;
+
case FE_ATSC:
c->modulation = p->u.vsb.modulation;
if ((c->modulation == VSB_8) || (c->modulation == VSB_16))
@@ -1097,12 +1129,28 @@
p->u.ofdm.bandwidth = BANDWIDTH_8_MHZ;
else
p->u.ofdm.bandwidth = BANDWIDTH_AUTO;
- p->u.ofdm.code_rate_HP = c->code_rate_HP;
- p->u.ofdm.code_rate_LP = c->code_rate_LP;
+
+ p->u.ofdm.code_rate_HP = c->fec_inner;
+ p->u.ofdm.code_rate_LP = FEC_1_2; /* never used correctly by any frontend driver so far */
+ if (c->hierarchy) {
+ switch (c->alpha) {
+ default:
+ case 1:
+ p->u.ofdm.hierarchy_information = HIERARCHY_1;
+ break;
+ case 2:
+ p->u.ofdm.hierarchy_information = HIERARCHY_2;
+ break;
+ case 4:
+ p->u.ofdm.hierarchy_information = HIERARCHY_4;
+ break;
+ }
+ } else
+ p->u.ofdm.hierarchy_information = HIERARCHY_NONE;
+
p->u.ofdm.constellation = c->modulation;
p->u.ofdm.transmission_mode = c->transmission_mode;
p->u.ofdm.guard_interval = c->guard_interval;
- p->u.ofdm.hierarchy_information = c->hierarchy;
c->delivery_system = SYS_DVBT;
break;
case FE_ATSC:
@@ -1287,6 +1335,16 @@
case DTV_HIERARCHY:
tvp->u.data = fe->dtv_property_cache.hierarchy;
break;
+ case DTV_ALPHA:
+ tvp->u.data = fe->dtv_property_cache.alpha;
+ break;
+ case DTV_STREAM_SELECTION:
+ tvp->u.data = fe->dtv_property_cache.stream_selection;
+ break;
+ case DTV_TRANSMITTER_ID:
+ tvp->u.data = fe->dtv_property_cache.transmitter_id;
+ break;
+
default:
r = -1;
}
@@ -1376,21 +1434,20 @@
r = dvb_frontend_ioctl_legacy(inode, file, FE_SET_TONE,
(void *)fe->dtv_property_cache.sectone);
break;
- case DTV_CODE_RATE_HP:
- fe->dtv_property_cache.code_rate_HP = tvp->u.data;
- break;
- case DTV_CODE_RATE_LP:
- fe->dtv_property_cache.code_rate_LP = tvp->u.data;
- break;
case DTV_GUARD_INTERVAL:
fe->dtv_property_cache.guard_interval = tvp->u.data;
break;
case DTV_TRANSMISSION_MODE:
fe->dtv_property_cache.transmission_mode = tvp->u.data;
break;
- case DTV_HIERARCHY:
- fe->dtv_property_cache.hierarchy = tvp->u.data;
+
+ case DTV_ALPHA:
+ fe->dtv_property_cache.alpha = tvp->u.data;
break;
+ case DTV_STREAM_SELECTION:
+ fe->dtv_property_cache.stream_selection = tvp->u.data;
+ break;
+
default:
r = -1;
}
diff -r e2a8b9b9c294 linux/drivers/media/dvb/dvb-core/dvb_frontend.h
--- a/linux/drivers/media/dvb/dvb-core/dvb_frontend.h Fri Oct 17 19:45:55 2008 +0300
+++ b/linux/drivers/media/dvb/dvb-core/dvb_frontend.h Sun Oct 19 18:42:53 2008 +0200
@@ -200,7 +200,9 @@
fe_transmit_mode_t transmission_mode;
u32 bandwidth_hz; /* 0 = AUTO */
fe_guard_interval_t guard_interval;
- fe_hierarchy_t hierarchy;
+ u8 hierarchy;
+ u8 alpha;
+ u8 stream_selection;
u32 symbol_rate;
fe_code_rate_t code_rate_HP;
fe_code_rate_t code_rate_LP;
@@ -209,6 +211,8 @@
fe_rolloff_t rolloff;
fe_delivery_system_t delivery_system;
+
+ u32 transmitter_id;
#if 0
/* ISDB-T specifics */
u32 isdb_segment_idx;
diff -r e2a8b9b9c294 linux/include/linux/dvb/frontend.h
--- a/linux/include/linux/dvb/frontend.h Fri Oct 17 19:45:55 2008 +0300
+++ b/linux/include/linux/dvb/frontend.h Sun Oct 19 18:42:54 2008 +0200
@@ -300,12 +300,29 @@
#define DTV_ISDB_LAYERC_TIME_INTERLEAVING 34
#endif
#define DTV_API_VERSION 35
-#define DTV_API_VERSION 35
+
+/* FEC code rate for the two streams coded (ro), in case of no hierarchy: CODE_RATE_HP is the one */
#define DTV_CODE_RATE_HP 36
#define DTV_CODE_RATE_LP 37
+
+/* all OFDM standard have that (rw) */
#define DTV_GUARD_INTERVAL 38
+/* FFT size (rw) */
#define DTV_TRANSMISSION_MODE 39
+
+/* DVB-T hierarchical stream information and selection */
+/* hierarchical transmission in DVB-T is in fact two independent transport streams
+ * one low-priority stream and a high priority one - see code_rate above (ro) */
#define DTV_HIERARCHY 40
+/* alpha is signalled by TPS, for HIERARCHY = 0, ALPHA is 1 */
+#define DTV_ALPHA 41
+
+/* 1 = HP (default) , 0 = LP */
+#define DTV_STREAM_SELECTION 42
+/* use DTV_INNER_FEC to to tune with the DTV_STREAM_SELECTION correctly set */
+
+/* tps cell id in DVB-T - (ro) */
+#define DTV_TRANSMITTER_ID 43
#define DTV_MAX_COMMAND DTV_HIERARCHY
[-- Attachment #3: Type: text/plain, Size: 150 bytes --]
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-dvb] DVBv5 (S2API) API for DVB-T
2008-10-19 18:31 [linux-dvb] DVBv5 (S2API) API for DVB-T Patrick Boettcher
@ 2008-12-06 11:07 ` Klaus Schmidinger
2008-12-08 10:18 ` Patrick Boettcher
0 siblings, 1 reply; 3+ messages in thread
From: Klaus Schmidinger @ 2008-12-06 11:07 UTC (permalink / raw)
To: linux-dvb
On 19.10.2008 20:31, Patrick Boettcher wrote:
> Hi Steve and others,
>
> I was quite busy recently and only found now the time to do what I
> should have done some time ago as it turned out. I could beat myself.
>
> When I checked how DVB-T is now implemented I saw that there is one
> thing which was wrong in the DVBv3 API already and is still in DVBv5.
>
> It is regarding hierarchical transmissions and the selection of
> high-priority and low-priority streams. This was not possible with DVBv3.
>
> I quickly changed how I think it should be done and the resulting patch
> can be found attached.
>
> The worst is, that this patch changes the frontend.h and thus the user
> interface. I put some comments in the code I wrote which hopefully helps
> to understand why I think this is necessary.
>
> I hope it is not too late to apply this and to go for 2.6.28 . If it is,
> my bad and everyone can blame me for not having a proper hierarchical
> mode implemented.
>
> Sorry again,
> Patrick.
[ see http://linuxtv.org/pipermail/linux-dvb/2008-October/029852.html for the patch ]
I'm at the "final approach" of releasing an S2API adapted version of
VDR 1.7.2, so I'm wondering if this change is going to be adopted in the
driver or not, or whether it is at all feasible. There haven't been any
comments in almost two months...
Klaus
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [linux-dvb] DVBv5 (S2API) API for DVB-T
2008-12-06 11:07 ` Klaus Schmidinger
@ 2008-12-08 10:18 ` Patrick Boettcher
0 siblings, 0 replies; 3+ messages in thread
From: Patrick Boettcher @ 2008-12-08 10:18 UTC (permalink / raw)
To: Klaus Schmidinger; +Cc: linux-dvb
Hi,
On Sat, 6 Dec 2008, Klaus Schmidinger wrote:
>> I hope it is not too late to apply this and to go for 2.6.28 . If it is,
>> my bad and everyone can blame me for not having a proper hierarchical
>> mode implemented.
>
> [ see http://linuxtv.org/pipermail/linux-dvb/2008-October/029852.html for the patch ]
>
> I'm at the "final approach" of releasing an S2API adapted version of
> VDR 1.7.2, so I'm wondering if this change is going to be adopted in the
> driver or not, or whether it is at all feasible. There haven't been any
> comments in almost two months...
It was not merged and there was no reaction.
As it is now too late (it is, right?), the only solution to fix a possible
hierarchical transmission will be to add the "select_stream" command. Like
that it will be possible to select high or low priority. It is not as
clean as by patch, but it will work and is backward compatible. For that I
don't have a patch ready, but at the same time there is also no
hierarchical transmission (afaik) in the air nowhere on the world. Only in
labs.
best regards,
Patrick.
_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-12-08 10:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-10-19 18:31 [linux-dvb] DVBv5 (S2API) API for DVB-T Patrick Boettcher
2008-12-06 11:07 ` Klaus Schmidinger
2008-12-08 10:18 ` Patrick Boettcher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox