DVB-S2 multistream support
PATCH 1/1 DVB-S2 multistream support
Now present DTV_DVBT2_PLP_ID property for DVB-T2, so i add alias DTV_DVBS2_MIS_ID (same feature for advanced DVB-S2). Now DVB-S2 multistream filtration supported for current STV090x demod cut 3.0, so i implement support for stv090x demod driver. Additional fe-caps FE_CAN_MULTISTREAM also added.
include/linux/dvb/frontend.h +2 -0
@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ +FE_CAN_MULTISTREAM =0x4000000 ,/* frontend supports DVB-S2 multistream filtering */ FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
@@ -317,6 +318,7 @@ struct dvb_frontend_event {#define DTV_ISDBS_TS_ID 42#define DTV_DVBT2_PLP_ID 43 +#define DTV_DVBS2_MIS_ID 43#define DTV_ENUM_DELSYS 44
drivers/media/dvb/dvb-core/dvb_frontend.c +1 -1
@@ -947,7 +947,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) } c->isdbs_ts_id =0 ; - c->dvbt2_plp_id =0 ; + c->dvbt2_plp_id =-1 ;switch (c->delivery_system) {case SYS_DVBS :
drivers/media/dvb/frontends/stv090x.c +34 -0
@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis<0 || mis>255 ) { +dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;
@@ -3433,6 +3460,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)if (props->frequency ==0 )return DVBFE_ALGO_SEARCH_INVALID ; +stv090x_set_mis (state,props->dvbt2_plp_id); + state->delsys = props->delivery_system; state->frequency = props->frequency; state->srate = props->symbol_rate;
@@ -3447,6 +3476,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state,props->dvbt2_plp_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;
@@ -4798,6 +4829,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver>=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );
Em 13-07-2012 20:15, CrazyCat escreveu:
Quoted 4 lines
Now present
DTV_DVBT2_PLP_IDproperty for DVB-T2, so i add aliasDTV_DVBS2_MIS_ID(same feature for advanced DVB-S2). Now DVB-S2 multistream filtration supported for current STV090x demod cut 3.0, so i implement support for stv090x demod driver. Additional fe-capsFE_CAN_MULTISTREAMalso added.frontend-mis.patch
Please provide your Signed-off-by: (with your real name).
include/linux/dvb/frontend.h typedef enum fe_caps { · line 65
Quoted 11 lines
include/linux/dvb/frontend.h +1
-0@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ + FE_CAN_MULTISTREAM = 0x4000000, /* frontend supports DVB-S2 multistream filtering */
Not sure if this is really needed. Are there any DVB-S2 frontends that don't support MIS, or they don't implement it just because this weren't defined yet? In the latter case, it would be better to not adding an special flag for it.
include/linux/dvb/frontend.h struct dvb_frontend_event { · line 321
Quoted 8 lines
include/linux/dvb/frontend.h +1
-0FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */@@ -317,6 +318,7 @@ struct dvb_frontend_event {#define DTV_ISDBS_TS_ID 42#define DTV_DVBT2_PLP_ID 43 +#define DTV_DVBS2_MIS_ID 43
It would be better to define it as:
#define DTV_DVBS2_MIS_ID DTV_DVBT2_PLP_ID
Even better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
#define DTV_DVB_MULT 43
#define DTV_DVBT2_PLP_ID DTV_DVB_MULT
And use the new symbol for both DVB-S2 and DVB-T2, deprecating the legacy symbol.
Also, DocBook needs to be changed to reflect this change.
Quoted 21 lines
include/linux/dvb/frontend.h +0
-0#define DTV_ENUM_DELSYS 44drivers/media/dvb/dvb-core/dvb_frontend.c +1
-1@@ -947,7 +947,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) } c->isdbs_ts_id =0 ; - c->dvbt2_plp_id =0 ; + c->dvbt2_plp_id =-1 ;switch (c->delivery_system) {case SYS_DVBS :drivers/media/dvb/frontends/stv090x.c +0
-0
drivers/media/dvb/frontends/stv090x.c err: · line 3432
Quoted 8 lines
drivers/media/dvb/frontends/stv090x.c +5
-0@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis<0 || mis>255 ) {
You should be checking your patch using scripts/checkpatch.pl. Due to Documentation/CodingStyle, the above should be written, instead, as:
if (mis < 0 || mis > 255) {Quoted 45 lines
drivers/media/dvb/frontends/stv090x.c +26
-0+dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;@@ -3433,6 +3460,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)if (props->frequency ==0 )return DVBFE_ALGO_SEARCH_INVALID ; +stv090x_set_mis (state,props->dvbt2_plp_id); + state->delsys = props->delivery_system; state->frequency = props->frequency; state->srate = props->symbol_rate;@@ -3447,6 +3476,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state,props->dvbt2_plp_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;
drivers/media/dvb/frontends/stv090x.c struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, · line 4837
Quoted 9 lines
drivers/media/dvb/frontends/stv090x.c +3
-0@@ -4798,6 +4829,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver>=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );
Regards,
Mauro
Quoted 10 lines · Mauro Carvalho Chehab
Em 13-07-2012 20:15, CrazyCat escreveu:
Quoted 4 lines
Now present
DTV_DVBT2_PLP_IDproperty for DVB-T2, so i add aliasDTV_DVBS2_MIS_ID(same feature for advanced DVB-S2). Now DVB-S2 multistream filtration supported for current STV090x demod cut 3.0, so i implement support for stv090x demod driver. Additional fe-capsFE_CAN_MULTISTREAMalso added.frontend-mis.patch
Please provide your Signed-off-by: (with your real name).
Quoted 2 lines
Quoted 14 lines
include/linux/dvb/frontend.h typedef enum fe_caps { · line 65
Quoted 9 lines
include/linux/dvb/frontend.h +1
-0@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ + FE_CAN_MULTISTREAM = 0x4000000, /* frontend supports DVB-S2 multistream filtering */Not sure if this is really needed. Are there any DVB-S2 frontends that don't support MIS, or they don't implement it just because this weren't defined yet? In the latter case, it would be better to not adding an special flag for it.
There are some demods that do not support Advanced Modes ..
Quoted 12 lines
include/linux/dvb/frontend.h struct dvb_frontend_event { · line 321
Quoted 9 lines
include/linux/dvb/frontend.h +1
-0FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */@@ -317,6 +318,7 @@ struct dvb_frontend_event {#define DTV_ISDBS_TS_ID 42#define DTV_DVBT2_PLP_ID 43 +#define DTV_DVBS2_MIS_ID 43It would be better to define it as:
Quoted 7 lines
#define
DTV_DVBS2_MIS_IDDTV_DVBT2_PLP_IDEven better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
#define
DTV_DVB_MULT43
#defineDTV_DVBT2_PLP_IDDTV_DVB_MULT
In fact that is also incorrect.
DVB-S2 uses TS ID at Link Layer
at Physical layer there is BBHEADER.
DVB-T2 uses PLP ID at Physical Layer
ISDB-S uses Stream ID
ISDB-T uses Layer A, LayerB, Layer C
Quoted 88 lines
And use the new symbol for both DVB-S2 and DVB-T2, deprecating the legacy symbol.
Also, DocBook needs to be changed to reflect this change.
Quoted 21 lines
include/linux/dvb/frontend.h +0
-0#define DTV_ENUM_DELSYS 44drivers/media/dvb/dvb-core/dvb_frontend.c +1
-1@@ -947,7 +947,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) } c->isdbs_ts_id =0 ; - c->dvbt2_plp_id =0 ; + c->dvbt2_plp_id =-1 ;switch (c->delivery_system) {case SYS_DVBS :drivers/media/dvb/frontends/stv090x.c +0
-0drivers/media/dvb/frontends/stv090x.c err: · line 3432
Quoted 8 lines
drivers/media/dvb/frontends/stv090x.c +5
-0@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis<0 || mis>255 ) {You should be checking your patch using
scripts/checkpatch.pl. Due toDocumentation/CodingStyle, the above should be written, instead, as:if (mis < 0 || mis > 255) {Quoted 47 lines
drivers/media/dvb/frontends/stv090x.c +26
-0+dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;@@ -3433,6 +3460,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe)if (props->frequency ==0 )return DVBFE_ALGO_SEARCH_INVALID ; +stv090x_set_mis (state,props->dvbt2_plp_id); + state->delsys = props->delivery_system; state->frequency = props->frequency; state->srate = props->symbol_rate;@@ -3447,6 +3476,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state,props->dvbt2_plp_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;@@ -4798,6 +4829,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } }
Quoted 3 lines
drivers/media/dvb/frontends/stv090x.c struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, · line 4834
Quoted 3 lines
drivers/media/dvb/frontends/stv090x.c +3
-0+if (state->internal->dev_ver>=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +
Which chipset have you tested it on ? The AAC or the BAC and what silicon cut version, 3 or 4 ?
Additionally, support is needed at the demuxer for handling GS (Generic Streams),
MS (Multiple Streams additionally) and BBHEADER. We don't have that yet in here.
Did you try the MIS with a saa716x based bridge ?
Regards,
Manu
Quoted 11 lines · Mauro Carvalho Chehab
Em 13-07-2012 20:15, CrazyCat escreveu:
Quoted 4 lines
#define DTV_ISDBS_TS_ID 42#define
DTV_DVBT2_PLP_ID43
+#defineDTV_DVBS2_MIS_ID43It would be better to define it as:
#define
DTV_DVBS2_MIS_IDDTV_DVBT2_PLP_ID
Quoted 8 lines
Even better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
#define
DTV_DVB_MULT43
#defineDTV_DVBT2_PLP_IDDTV_DVB_MULTAnd use the new symbol for both DVB-S2 and DVB-T2, deprecating the legacy symbol.
Also DTV_ISDBS_TS_ID means same. All these three DTV_ISDBS_TS_ID, DTV_DVBT2_PLP_ID and DTV_DVBS2_MIS_ID are same thing - just named differently between standards. I vote for common name TS ID (I have said that already enough many times...).
Research paper [1] ISDB-S says:
"
New technologies like the trellis-coded 8PSK (TC8PSK) modulation scheme were adopted for this section to improve transmission capacity as much as possible and to enable multiple transport streams (TSs) to be handled by one carrier. This channel coding system has consequently become a system standard known for its flexibility and extendibility. "
"
It enables multiple MPEG-TSs to be transmitted with one transponder, and because transmission systems can be switched for each TS signal, it enables TS signals produced by each broadcaster to be transmitted independently.
"
[1] http://www.tijbc.com/pruebas-7419/I0782925.pdf
regards
Antti
Signature · 1 line
http://palosaari.fi/
Quoted 21 lines · Antti Palosaari
Quoted 20 lines · Mauro Carvalho Chehab
Em 13-07-2012 20:15, CrazyCat escreveu:
Quoted 4 lines
#define DTV_ISDBS_TS_ID 42#define
DTV_DVBT2_PLP_ID43
+#defineDTV_DVBS2_MIS_ID43It would be better to define it as:
#define
DTV_DVBS2_MIS_IDDTV_DVBT2_PLP_IDEven better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
#define
DTV_DVB_MULT43
#defineDTV_DVBT2_PLP_IDDTV_DVB_MULT
Quoted 8 lines
Quoted 2 lines
And use the new symbol for both DVB-S2 and DVB-T2, deprecating the legacy symbol.
Also
DTV_ISDBS_TS_IDmeans same. All these threeDTV_ISDBS_TS_ID,DTV_DVBT2_PLP_IDandDTV_DVBS2_MIS_IDare same thing - just named differently between standards. I vote for common name TS ID (I have said that already enough many times...).
I agree, but a still more generic term like STREAM_ID would be more appropriate,
as it happens at different layers for different delivery systems.DVB-S2 additionally
provides BBHEADER at Physical Layer. In any case setting PLP_ID for DVB-S2 is completely confusing.
Anyway, the demuxer part is also missing ..
If you look a bit more deeper, you will see that the framing structure with ISDB-T
is exactly the same as with ISDB-S, which makes ISDB-T also no different, just that the frontend userspace header is just fucked up with junk.
The major chunk for the ISDB-T stuff in the frontend header is completely redundant.
Regards,
Manu
Quoted 26 lines · Manu Abraham
Quoted 25 lines · Antti Palosaari
Quoted 22 lines · Mauro Carvalho Chehab
Em 13-07-2012 20:15, CrazyCat escreveu:
Quoted 4 lines
#define DTV_ISDBS_TS_ID 42#define DTV_DVBT2_PLP_ID 43+#define
DTV_DVBS2_MIS_ID43It would be better to define it as:
#define
DTV_DVBS2_MIS_IDDTV_DVBT2_PLP_IDEven better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
#define
DTV_DVB_MULT43
#defineDTV_DVBT2_PLP_IDDTV_DVB_MULTAnd use the new symbol for both DVB-S2 and DVB-T2, deprecating the legacy symbol.
Quoted 7 lines
Quoted 4 lines
Also
DTV_ISDBS_TS_IDmeans same. All these threeDTV_ISDBS_TS_ID,DTV_DVBT2_PLP_IDandDTV_DVBS2_MIS_IDare same thing - just named differently between standards. I vote for common name TS ID (I have said that already enough many times...).I agree, but a still more generic term like
STREAM_IDwould be more appropriate,
Ack. Since this stream could be something else than MPEG2-TS better to give more generic name.
Quoted 6 lines
as it happens at different layers for different delivery systems.DVB-S2 additionally
provides BBHEADER at Physical Layer. In any case settingPLP_IDfor DVB-S2 is completely confusing.Anyway, the demuxer part is also missing ..
Demuxer for MIS? I am not any familiar with MIS but I know there is "raw" demux payload used already for ATSC-M/H. It just passes all the data coming from demod "TS".
Quoted 11 lines
If you look a bit more deeper, you will see that the framing structure with ISDB-T
is exactly the same as with ISDB-S, which makes ISDB-T also no different, just that the frontend userspace header is just fucked up with junk.The major chunk for the ISDB-T stuff in the frontend header is completely redundant.
Regards,
Manu
regards
Antti
Signature · 1 line
http://palosaari.fi/
Quoted 52 lines · Antti Palosaari
Quoted 32 lines · Manu Abraham
Quoted 30 lines · Antti Palosaari
Quoted 25 lines · Mauro Carvalho Chehab
Em 13-07-2012 20:15, CrazyCat escreveu:
Quoted 4 lines
#define DTV_ISDBS_TS_ID 42#define DTV_DVBT2_PLP_ID 43+#define
DTV_DVBS2_MIS_ID43It would be better to define it as:
#define
DTV_DVBS2_MIS_IDDTV_DVBT2_PLP_IDEven better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
#define
DTV_DVB_MULT43
#defineDTV_DVBT2_PLP_IDDTV_DVB_MULTAnd use the new symbol for both DVB-S2 and DVB-T2, deprecating the legacy symbol.
Quoted 8 lines
Quoted 4 lines
Also
DTV_ISDBS_TS_IDmeans same. All these threeDTV_ISDBS_TS_ID,DTV_DVBT2_PLP_IDandDTV_DVBS2_MIS_IDare same thing - just named differently between standards. I vote for common name TS ID (I have said that already enough many times...).I agree, but a still more generic term like
STREAM_IDwould be more appropriate,Ack. Since this stream could be something else than MPEG2-TS better to give more generic name.
Quoted 5 lines
as it happens at different layers for different delivery systems.DVB-S2 additionally
provides BBHEADER at Physical Layer. In any case settingPLP_IDfor DVB-S2 is completely confusing.
Quoted 6 lines
Quoted 1 line
Anyway, the demuxer part is also missing ..
Demuxer for MIS? I am not any familiar with MIS but I know there is "raw" demux payload used already for ATSC-M/H. It just passes all the data coming from demod "TS".
Just grabbing and sending the DMA'd data to userspace is not nice.
With ATSC-M/H you don't simply have a TS. With an ATSC-M/H capable demod, which supports ATSC (standard) outputs a TS. the M/H part is not a TS at all.
Even with ATSC-M/H passing raw data causes all the IP (network) packets to be parsed in userspace, which should have been properly done in kernel space as a filter. If we were to do everything similarly, then we don't need any API at all, just a simple read and let each application do whatever it wants.
Regards,
Manu
Stream can be anything :) But for DVB standards this anyway DVBS transport stream 188 byte. Most media-bridges can handle only this stream. Specific generic-continous DVB-S2/T2/C2 streams require extended bus for passing frame-based stream, so this out of V4L DVB.
Now MIS used often for distribution multiple digital terrestial muxes over one satellite carrier (implemented in my patch, now i make patches for VDR and TVHeadend for MIS). DVB-T2 PLP is same, but i not see any real-life implementation (have some tda18712/cxd2820r-based hardware and T2/256QAM-in-air, but only one PLP). Don't know anything about ISDB :)
11.08.2012, 04:07, "Antti Palosaari" <[email protected]>:
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 9 lines
Quoted 3 lines
#define
DTV_ISDBS_TS_ID42
#defineDTV_DVBT2_PLP_ID43
+#defineDTV_DVBS2_MIS_ID43It would be better to define it as:
#define
DTV_DVBS2_MIS_IDDTV_DVBT2_PLP_IDEven better, we should instead find a better name that would cover both DVB-T2 and DVB-S2 program ID fields, like:
Fixed patch.
drivers/media/dvb/dvb-core/dvb_frontend.c +11 -0
@@ -948,6 +948,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) c->isdbs_ts_id =0 ; c->dvbt2_plp_id =0 ; + c->dvbs2_mis_id =-1 ;switch (c->delivery_system) {case SYS_DVBS :
@@ -1049,6 +1050,8 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {_DTV_CMD (DTV_ATSCMH_SCCC_CODE_MODE_B ,0 ,0 ),_DTV_CMD (DTV_ATSCMH_SCCC_CODE_MODE_C ,0 ,0 ),_DTV_CMD (DTV_ATSCMH_SCCC_CODE_MODE_D ,0 ,0 ), + + _DTV_CMD(DTV_DVBS2_MIS_ID, 1, 0), };static void dtv_property_dump (struct dtv_property *tvp)
@@ -1436,6 +1439,10 @@ static int dtv_property_process_get(struct dvb_frontend *fe, tvp->u.data = fe->dtv_property_cache.atscmh_sccc_code_mode_d;break ; +case DTV_DVBS2_MIS_ID : + tvp->u.data = c->dvbs2_mis_id; +break ; +default :return -EINVAL ; }
@@ -1786,6 +1793,10 @@ static int dtv_property_process_set(struct dvb_frontend *fe, fe->dtv_property_cache.atscmh_rs_frame_ensemble = tvp->u.data;break ; +case DTV_DVBS2_MIS_ID : + c->dvbs2_mis_id = tvp->u.data; +break ; +default :return -EINVAL ; }
drivers/media/dvb/dvb-core/dvb_frontend.h +3 -0
@@ -374,6 +374,9 @@ struct dtv_frontend_properties {/* DVB-T2 specifics */ u32 dvbt2_plp_id; +/* DVB-S2 specifics */ +u32 dvbs2_mis_id; +/* ATSC-MH specifics */ u8 atscmh_fic_ver;u8 atscmh_parade_id;
drivers/media/dvb/frontends/stv090x.c +32 -0
@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis <0 || mis >255 ) { +dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;
@@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state, props->dvbs2_mis_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;
@@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver >=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );
include/linux/dvb/frontend.h +4 -1
@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ +FE_CAN_MULTISTREAM =0x4000000 ,/* frontend supports DVB-S2 multistream filtering */ FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
@@ -337,7 +338,9 @@ struct dvb_frontend_event {#define DTV_ATSCMH_SCCC_CODE_MODE_C 58#define DTV_ATSCMH_SCCC_CODE_MODE_D 59 -#define DTV_MAX_COMMAND DTV_ATSCMH_SCCC_CODE_MODE_D +#define DTV_DVBS2_MIS_ID 60 + +#define DTV_MAX_COMMAND DTV_DVBS2_MIS_ID typedef enum fe_pilot { PILOT_ON,
Quoted 1 line · CrazyCat
Fixed patch.
We asked you to merge isdbs_ts_id, dvbt2_plp_id and dvbs2_mis_id to one as those are logically same thing from the user-point of view. Technically those differs, but that is userspace API so underlying technique should not matter.
It is some more work for you, but it should not be such big issue you cannot do. So please use few hours and merge all those. I think correct name is DTV_STREAM_ID. So remove isdbs_ts_id, dvbt2_plp_id and dvbs2_mis_id. Add new variable stream_id. As DTV_ISDBS_TS_ID and DTV_DVBT2_PLP_ID already exists you should make some logic those could be still used.
regards
Antti
Quoted 144 lines
Signed-off-by Evgeny Plehov <[email protected]>drivers/media/dvb/dvb-core/dvb_frontend.c +11
-0@@ -948,6 +948,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) c->isdbs_ts_id =0 ; c->dvbt2_plp_id =0 ; + c->dvbs2_mis_id =-1 ;switch (c->delivery_system) {case SYS_DVBS :@@ -1049,6 +1050,8 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {_DTV_CMD (DTV_ATSCMH_SCCC_CODE_MODE_B ,0 ,0 ),_DTV_CMD (DTV_ATSCMH_SCCC_CODE_MODE_C ,0 ,0 ),_DTV_CMD (DTV_ATSCMH_SCCC_CODE_MODE_D ,0 ,0 ), + + _DTV_CMD(DTV_DVBS2_MIS_ID, 1, 0), };static void dtv_property_dump (struct dtv_property *tvp)@@ -1436,6 +1439,10 @@ static int dtv_property_process_get(struct dvb_frontend *fe, tvp->u.data = fe->dtv_property_cache.atscmh_sccc_code_mode_d;break ; +case DTV_DVBS2_MIS_ID : + tvp->u.data = c->dvbs2_mis_id; +break ; +default :return -EINVAL ; }@@ -1786,6 +1793,10 @@ static int dtv_property_process_set(struct dvb_frontend *fe, fe->dtv_property_cache.atscmh_rs_frame_ensemble = tvp->u.data;break ; +case DTV_DVBS2_MIS_ID : + c->dvbs2_mis_id = tvp->u.data; +break ; +default :return -EINVAL ; }drivers/media/dvb/dvb-core/dvb_frontend.h +3
-0@@ -374,6 +374,9 @@ struct dtv_frontend_properties {/* DVB-T2 specifics */ u32 dvbt2_plp_id; +/* DVB-S2 specifics */ +u32 dvbs2_mis_id; +/* ATSC-MH specifics */ u8 atscmh_fic_ver;u8 atscmh_parade_id;drivers/media/dvb/frontends/stv090x.c +32
-0@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis <0 || mis >255 ) { +dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;@@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state, props->dvbs2_mis_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;@@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver >=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );include/linux/dvb/frontend.h +4
-2@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ +FE_CAN_MULTISTREAM =0x4000000 ,/* frontend supports DVB-S2 multistream filtering */ FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */@@ -337,7 +338,9 @@ struct dvb_frontend_event {#define DTV_ATSCMH_SCCC_CODE_MODE_C 58#define DTV_ATSCMH_SCCC_CODE_MODE_D 59 -#define DTV_MAX_COMMAND DTV_ATSCMH_SCCC_CODE_MODE_D +#define DTV_DVBS2_MIS_ID 60 + +#define DTV_MAX_COMMAND DTV_DVBS2_MIS_ID typedef enum fe_pilot { PILOT_ON, --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 · 1 line
http://palosaari.fi/
Ok, done :) Look like DTV_DVBT2_PLP_ID not implemented for CXD2820r ?
12.08.2012, 03:00, "Antti Palosaari" <[email protected]>:
Quoted 11 lines
We asked you to merge
isdbs_ts_id,dvbt2_plp_idanddvbs2_mis_idto one as those are logically same thing from the user-point of view. Technically those differs, but that is userspace API so underlying technique should not matter.It is some more work for you, but it should not be such big issue you cannot do. So please use few hours and merge all those. I think correct name is
DTV_STREAM_ID. So removeisdbs_ts_id,dvbt2_plp_idanddvbs2_mis_id. Add new variablestream_id. AsDTV_ISDBS_TS_IDandDTV_DVBT2_PLP_IDalready exists you should make some logic those could be still used.
include/linux/dvb/frontend.h +5 -3
@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ +FE_CAN_MULTISTREAM =0x4000000 ,/* frontend supports DVB-S2 multistream filtering */ FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
@@ -314,9 +315,10 @@ struct dvb_frontend_event {#define DTV_ISDBT_LAYER_ENABLED 41 -#define DTV_ISDBS_TS_ID 42 - -#define DTV_DVBT2_PLP_ID 43 +#define DTV_STREAM_ID 42 +#define DTV_ISDBS_TS_ID DTV_STREAM_ID +#define DTV_DVBT2_PLP_ID DTV_STREAM_ID +#define DTV_DVBS2_MIS_ID DTV_STREAM_ID#define DTV_ENUM_DELSYS 44
drivers/media/dvb/dvb-core/dvb_frontend.c +7 -14
@@ -946,8 +946,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) c->layer[i].segment_count =0 ; } - c->isdbs_ts_id =0 ; - c->dvbt2_plp_id =0 ; + c->stream_id =-1 ;switch (c->delivery_system) {case SYS_DVBS :
@@ -1017,8 +1016,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {_DTV_CMD (DTV_ISDBT_LAYERC_SEGMENT_COUNT ,1 ,0 ),_DTV_CMD (DTV_ISDBT_LAYERC_TIME_INTERLEAVING ,1 ,0 ), -_DTV_CMD (DTV_ISDBS_TS_ID ,1 ,0 ), -_DTV_CMD (DTV_DVBT2_PLP_ID ,1 ,0 ), +_DTV_CMD (DTV_STREAM_ID ,1 ,0 ),/* Get */ _DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1),
@@ -1382,11 +1380,9 @@ static int dtv_property_process_get(struct dvb_frontend *fe,case DTV_ISDBT_LAYERC_TIME_INTERLEAVING : tvp->u.data = c->layer[2 ].interleaving;break ; -case DTV_ISDBS_TS_ID : - tvp->u.data = c->isdbs_ts_id; -break ; -case DTV_DVBT2_PLP_ID : - tvp->u.data = c->dvbt2_plp_id; + +case DTV_STREAM_ID : + tvp->u.data = c->stream_id;break ;/* ATSC-MH */
@@ -1771,11 +1767,8 @@ static int dtv_property_process_set(struct dvb_frontend *fe,case DTV_ISDBT_LAYERC_TIME_INTERLEAVING : c->layer[2 ].interleaving = tvp->u.data;break ; -case DTV_ISDBS_TS_ID : - c->isdbs_ts_id = tvp->u.data; -break ; -case DTV_DVBT2_PLP_ID : - c->dvbt2_plp_id = tvp->u.data; +case DTV_STREAM_ID : + c->stream_id = tvp->u.data;break ;/* ATSC-MH */
drivers/media/dvb/dvb-core/dvb_frontend.h +2 -5
@@ -368,11 +368,8 @@ struct dtv_frontend_properties {u8 interleaving; } layer[3 ]; -/* ISDB-T specifics */ -u32 isdbs_ts_id; - -/* DVB-T2 specifics */ -u32 dvbt2_plp_id; +/* Multistream specifics */ +u32 stream_id;/* ATSC-MH specifics */ u8 atscmh_fic_ver;
drivers/media/dvb/frontends/stv090x.c +32 -0
@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis <0 || mis >255 ) { +dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;
@@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state, props->stream_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;
@@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver >=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );
Quoted 1 line · CrazyCat
Ok, done :) Look like
DTV_DVBT2_PLP_IDnot implemented for CXD2820r ?
yes, true. It uses always PLP 0. I didn't have signal source that uses multiple PLPs. I didn't even add that PLP ID to API.
Quoted 27 lines
12.08.2012, 03:00, "Antti Palosaari" <[email protected]>:
Quoted 11 lines
We asked you to merge
isdbs_ts_id,dvbt2_plp_idanddvbs2_mis_idto one as those are logically same thing from the user-point of view. Technically those differs, but that is userspace API so underlying technique should not matter.It is some more work for you, but it should not be such big issue you cannot do. So please use few hours and merge all those. I think correct name is
DTV_STREAM_ID. So removeisdbs_ts_id,dvbt2_plp_idanddvbs2_mis_id. Add new variablestream_id. AsDTV_ISDBS_TS_IDandDTV_DVBT2_PLP_IDalready exists you should make some logic those could be still used.Signed-off-by Evgeny Plehov <[email protected]>include/linux/dvb/frontend.h +1
-0@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ +FE_CAN_MULTISTREAM =0x4000000 ,/* frontend supports DVB-S2 multistream filtering */ FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */
include/linux/dvb/frontend.h struct dvb_frontend_event { · line 321
Quoted 10 lines
include/linux/dvb/frontend.h +4
-3@@ -314,9 +315,10 @@ struct dvb_frontend_event {#define DTV_ISDBT_LAYER_ENABLED 41 -#define DTV_ISDBS_TS_ID 42 - -#define DTV_DVBT2_PLP_ID 43 +#define DTV_STREAM_ID 42 +#define DTV_ISDBS_TS_ID DTV_STREAM_ID +#define DTV_DVBT2_PLP_ID DTV_STREAM_ID +#define DTV_DVBS2_MIS_ID DTV_STREAM_ID
Do not define command DTV_DVBS2_MIS_ID at all. It is not never released thus no need to support.
I suspect DTV_DVBT2_PLP_ID is never used by any application, but still it is not possible to change command number from 43 to 42 as this does.
I am not sure what kind of procedures are needed to remove existing API command number, but surely it is not possible like that. So you have to reserve command 43. Both commands 42 and 43 should continue working.
DTV_DVBT2_PLP_ID should be marked as deprecated and after that it could be removed somewhere in future.
Quoted 8 lines
include/linux/dvb/frontend.h +0
-0#define DTV_ENUM_DELSYS 44drivers/media/dvb/dvb-core/dvb_frontend.c +0
-0
drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_clear_cache(struct dvb_frontend *fe) · line 949
Quoted 6 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +1
-2@@ -946,8 +946,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) c->layer[i].segment_count =0 ; } - c->isdbs_ts_id =0 ; - c->dvbt2_plp_id =0 ; + c->stream_id =-1 ;
You have defined it as a unsigned 32 thus -1 is not possible value. Maybe 0 is still good default choice.
drivers/media/dvb/dvb-core/dvb_frontend.c static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = { · line 1021
Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +0
-2switch (c->delivery_system) {case SYS_DVBS :@@ -1017,8 +1016,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {_DTV_CMD (DTV_ISDBT_LAYERC_SEGMENT_COUNT ,1 ,0 ), _DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 1, 0), -_DTV_CMD (DTV_ISDBS_TS_ID ,1 ,0 ), - _DTV_CMD(DTV_DVBT2_PLP_ID, 1, 0),
DTV_DVBT2_PLP_ID cannot be removed yet (but DTV_ISDBS_TS_ID can be as it is renamed, it is OK).
drivers/media/dvb/dvb-core/dvb_frontend.c static int dtv_property_process_get(struct dvb_frontend *fe, · line 1389
Quoted 13 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +1
-5+_DTV_CMD (DTV_STREAM_ID ,1 ,0 ),/* Get */ _DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1),@@ -1382,11 +1380,9 @@ static int dtv_property_process_get(struct dvb_frontend *fe,case DTV_ISDBT_LAYERC_TIME_INTERLEAVING : tvp->u.data = c->layer[2 ].interleaving;break ; -case DTV_ISDBS_TS_ID : - tvp->u.data = c->isdbs_ts_id; -break ; -case DTV_DVBT2_PLP_ID : - tvp->u.data = c->dvbt2_plp_id;
DTV_DVBT2_PLP_ID cannot be removed yet (but DTV_ISDBS_TS_ID can be as it is renamed, it is OK).
Quoted 7 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +3
-0+ +case DTV_STREAM_ID : + tvp->u.data = c->stream_id;break ;/* ATSC-MH */
drivers/media/dvb/dvb-core/dvb_frontend.c static int dtv_property_process_set(struct dvb_frontend *fe, · line 1778
Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +0
-5@@ -1771,11 +1767,8 @@ static int dtv_property_process_set(struct dvb_frontend *fe,case DTV_ISDBT_LAYERC_TIME_INTERLEAVING : c->layer[2 ].interleaving = tvp->u.data;break ; -case DTV_ISDBS_TS_ID : - c->isdbs_ts_id = tvp->u.data; -break ; -case DTV_DVBT2_PLP_ID : - c->dvbt2_plp_id = tvp->u.data;
DTV_DVBT2_PLP_ID cannot be removed yet (but DTV_ISDBS_TS_ID can be as it is renamed, it is OK).
Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +2
-0+case DTV_STREAM_ID : + c->stream_id = tvp->u.data;break ;/* ATSC-MH */ drivers/media/dvb/dvb-core/dvb_frontend.h +0
-0
drivers/media/dvb/dvb-core/dvb_frontend.h struct dtv_frontend_properties { · line 372
Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.h +2
-5@@ -368,11 +368,8 @@ struct dtv_frontend_properties {u8 interleaving; } layer[3 ]; -/* ISDB-T specifics */ -u32 isdbs_ts_id; - -/* DVB-T2 specifics */ -u32 dvbt2_plp_id; +/* Multistream specifics */ +u32 stream_id;
These are correct!
Quoted 52 lines
drivers/media/dvb/dvb-core/dvb_frontend.h +0
-0/* ATSC-MH specifics */ u8 atscmh_fic_ver;drivers/media/dvb/frontends/stv090x.c +29
-0@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis <0 || mis >255 ) { +dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;@@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state, props->stream_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;
drivers/media/dvb/frontends/stv090x.c struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, · line 4835
Quoted 9 lines
drivers/media/dvb/frontends/stv090x.c +3
-0@@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver >=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );
Only functional problem is here that it removes DTV_DVBT2_PLP_ID command 43 from the API whilst there could be some applications using that. It should be deprecated (marked as do not use or like that) and then removed in future.
regards
Antti
Signature · 1 line
http://palosaari.fi/
Quoted 7 lines · Antti Palosaari
Quoted 2 lines · CrazyCat
Ok, done :) Look like
DTV_DVBT2_PLP_IDnot implemented for CXD2820r ?yes, true. It uses always PLP 0. I didn't have signal source that uses multiple PLPs. I didn't even add that PLP ID to API.
CXD2820 works only with PLP Type 1 or Type A in some other terminology. PLP Type Common and PLP Type 2 are not supported by the hardware. ie, it fails to acquire a LOCK with anything else.
Issue confirmed by Sony as well.
Regards,
Manu
Em 12-08-2012 15:50, Antti Palosaari escreveu:
Quoted 18 lines · CrazyCat
Quoted 17 lines
include/linux/dvb/frontend.h +1
-0@@ -62,6 +62,7 @@ typedef enum fe_caps {FE_CAN_8VSB =0x200000 ,FE_CAN_16VSB =0x400000 ,FE_HAS_EXTENDED_CAPS =0x800000 ,/* We need more bitspace for newer APIs, indicate this. */ +FE_CAN_MULTISTREAM =0x4000000 ,/* frontend supports DVB-S2 multistream filtering */ FE_CAN_TURBO_FEC =0x8000000 ,/* frontend supports "turbo fec modulation" */ FE_CAN_2G_MODULATION =0x10000000 ,/* frontend supports "2nd generation modulation" (DVB-S2) */ FE_NEEDS_BENDING = 0x20000000, /* not supported anymore, don't use (frontend requires frequency bending) */@@ -314,9 +315,10 @@ struct dvb_frontend_event {#define DTV_ISDBT_LAYER_ENABLED 41
Quoted 9 lines
include/linux/dvb/frontend.h struct dvb_frontend_event { · line 321
Quoted 7 lines
include/linux/dvb/frontend.h +4
-3-#define DTV_ISDBS_TS_ID 42 - -#define DTV_DVBT2_PLP_ID 43 +#define DTV_STREAM_ID 42 +#define DTV_ISDBS_TS_ID DTV_STREAM_ID +#define DTV_DVBT2_PLP_ID DTV_STREAM_ID +#define DTV_DVBS2_MIS_ID DTV_STREAM_IDDo not define command
DTV_DVBS2_MIS_IDat all. It is not never released thus no need to support.
I'd say we need compatibility bits only for the ID's that are already there (ISDBS_TS_ID and DTV_DVBT2_PLP_ID).
Quoted 4 lines
I suspect
DTV_DVBT2_PLP_IDis never used by any application, but still it is not possible to change command number from 43 to 42 as this does.I am not sure what kind of procedures are needed to remove existing API command number, but surely it is not possible like that. So you have to reserve command 43. Both commands 42 and 43 should continue working.
Rename the one that will be obsoleted with _LEGACY:
#define DTV_DVBT2_PLP_ID_LEGACY 43
and keep accepting it inside the dvb_frontend, like:
switch (...) {
case DTV_DVBT2_PLP_ID_LEGACY:
case DTV_STREAM_ID:
...
}This way, app developers will notice that this got removed and binary code will keep working.
Quoted 89 lines
DTV_DVBT2_PLP_IDshould be marked as deprecated and after that it could be removed somewhere in future.Quoted 8 lines
include/linux/dvb/frontend.h +0
-0#define DTV_ENUM_DELSYS 44drivers/media/dvb/dvb-core/dvb_frontend.c +0
-0drivers/media/dvb/dvb-core/dvb_frontend.c static int dvb_frontend_clear_cache(struct dvb_frontend *fe) · line 949
Quoted 6 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +1
-2@@ -946,8 +946,7 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe) c->layer[i].segment_count =0 ; } - c->isdbs_ts_id =0 ; - c->dvbt2_plp_id =0 ; + c->stream_id =-1 ;You have defined it as a unsigned 32 thus -1 is not possible value. Maybe 0 is still good default choice.
drivers/media/dvb/dvb-core/dvb_frontend.c static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = { · line 1021
Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +0
-2switch (c->delivery_system) {case SYS_DVBS :@@ -1017,8 +1016,7 @@ static struct dtv_cmds_h dtv_cmds[DTV_MAX_COMMAND + 1] = {_DTV_CMD (DTV_ISDBT_LAYERC_SEGMENT_COUNT ,1 ,0 ), _DTV_CMD(DTV_ISDBT_LAYERC_TIME_INTERLEAVING, 1, 0), -_DTV_CMD (DTV_ISDBS_TS_ID ,1 ,0 ), - _DTV_CMD(DTV_DVBT2_PLP_ID, 1, 0),
DTV_DVBT2_PLP_IDcannot be removed yet (butDTV_ISDBS_TS_IDcan be as it is renamed, it is OK).drivers/media/dvb/dvb-core/dvb_frontend.c static int dtv_property_process_get(struct dvb_frontend *fe, · line 1389
Quoted 13 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +1
-5+_DTV_CMD (DTV_STREAM_ID ,1 ,0 ),/* Get */ _DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1),@@ -1382,11 +1380,9 @@ static int dtv_property_process_get(struct dvb_frontend *fe,case DTV_ISDBT_LAYERC_TIME_INTERLEAVING : tvp->u.data = c->layer[2 ].interleaving;break ; -case DTV_ISDBS_TS_ID : - tvp->u.data = c->isdbs_ts_id; -break ; -case DTV_DVBT2_PLP_ID : - tvp->u.data = c->dvbt2_plp_id;
DTV_DVBT2_PLP_IDcannot be removed yet (butDTV_ISDBS_TS_IDcan be as it is renamed, it is OK).Quoted 7 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +3
-0+ +case DTV_STREAM_ID : + tvp->u.data = c->stream_id;break ;/* ATSC-MH */ drivers/media/dvb/dvb-core/dvb_frontend.c static int dtv_property_process_set(struct dvb_frontend *fe, · line 1778
Quoted 8 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +0
-5@@ -1771,11 +1767,8 @@ static int dtv_property_process_set(struct dvb_frontend *fe,case DTV_ISDBT_LAYERC_TIME_INTERLEAVING : c->layer[2 ].interleaving = tvp->u.data;break ; -case DTV_ISDBS_TS_ID : - c->isdbs_ts_id = tvp->u.data; -break ; -case DTV_DVBT2_PLP_ID : - c->dvbt2_plp_id = tvp->u.data;
DTV_DVBT2_PLP_IDcannot be removed yet (butDTV_ISDBS_TS_IDcan be as it is renamed, it is OK).Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.c +2
-0+case DTV_STREAM_ID : + c->stream_id = tvp->u.data;break ;/* ATSC-MH */ drivers/media/dvb/dvb-core/dvb_frontend.h +0
-0drivers/media/dvb/dvb-core/dvb_frontend.h struct dtv_frontend_properties { · line 372
Quoted 10 lines
drivers/media/dvb/dvb-core/dvb_frontend.h +2
-5@@ -368,11 +368,8 @@ struct dtv_frontend_properties {u8 interleaving; } layer[3 ]; -/* ISDB-T specifics */ -u32 isdbs_ts_id; - -/* DVB-T2 specifics */ -u32 dvbt2_plp_id; +/* Multistream specifics */ +u32 stream_id;These are correct!
Quoted 1 line
Quoted 6 lines
drivers/media/dvb/frontends/stv090x.c
Quoted 6 lines
/* ATSC-MH specifics */ u8 atscmh_fic_ver;drivers/media/dvb/frontends/stv090x.c +0
-0
I prefer if you could split the DVB API changes from the driver changes.
Also, you'll need to patch Documentation/DocBook, in order to reflect those API changes.
Regards,
Mauro
Quoted 61 lines
Quoted 45 lines
drivers/media/dvb/frontends/stv090x.c +29
-0@@ -3425,6 +3425,33 @@ err:return -1 ; } +static int stv090x_set_mis (struct stv090x_state *state,int mis) +{ +u32 reg; + +if (mis <0 || mis >255 ) { +dprintk (FE_DEBUG ,1 ,"Disable MIS filtering" ); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x00 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; + }else { +dprintk (FE_DEBUG ,1 ,"Enable MIS filtering - %d" , mis); + reg =STV090x_READ_DEMOD (state,PDELCTRL1 ); +STV090x_SETFIELD_Px (reg,FILTER_EN_FIELD ,0x01 ); +if (STV090x_WRITE_DEMOD (state,PDELCTRL1 , reg) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIENTRY , mis) <0 ) + goto err; +if (STV090x_WRITE_DEMOD (state,ISIBITENA ,0xff ) <0 ) + goto err; + } +return 0 ; +err: +dprintk (FE_ERROR ,1 ,"I/O error" ); +return -1 ; +} +static enum dvbfe_search stv090x_search (struct dvb_frontend *fe) {struct stv090x_state *state = fe->demodulator_priv;@@ -3447,6 +3474,8 @@ static enum dvbfe_search stv090x_search(struct dvb_frontend *fe) state->search_range =5000000 ; } +stv090x_set_mis (state, props->stream_id); +if (stv090x_algo (state) == STV090x_RANGEOK) {dprintk (FE_DEBUG ,1 ,"Search success!" );return DVBFE_ALGO_SEARCH_SUCCESS ;drivers/media/dvb/frontends/stv090x.c struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, · line 4835
Quoted 9 lines
drivers/media/dvb/frontends/stv090x.c +3
-0@@ -4798,6 +4827,9 @@ struct dvb_frontend *stv090x_attach(const struct stv090x_config *config, } } +if (state->internal->dev_ver >=0x30 ) + state->frontend.ops.info.caps |=FE_CAN_MULTISTREAM ; +/* workaround for stuck DiSEqC output */ if (config->diseqc_envelope_mode)stv090x_send_diseqc_burst (&state->frontend,SEC_MINI_A );Only functional problem is here that it removes
DTV_DVBT2_PLP_IDcommand 43 from the API whilst there could be some applications using that. It should be deprecated (marked as do not use or like that) and then removed in future.regards
Antti