rework DVB_S2X

Origin commit data
------------------
Commit: 42d8d62fe5
Author: TangoCash <eric@loxat.de>
Date: 2020-10-25 (Sun, 25 Oct 2020)
This commit is contained in:
TangoCash
2020-10-25 22:50:07 +01:00
committed by vanhofen
parent c8aba4405f
commit 1657d618d1
2 changed files with 47 additions and 58 deletions

View File

@@ -154,12 +154,12 @@ class CFrontend
uint32_t deliverySystemMask; uint32_t deliverySystemMask;
uint32_t forcedSystemMask; uint32_t forcedSystemMask;
bool isMultistream; bool fe_can_multistream;
//fe_delivery_system_t deliverySystems[MAX_DELSYS]; //fe_delivery_system_t deliverySystems[MAX_DELSYS];
//uint32_t numDeliverySystems; //uint32_t numDeliverySystems;
t_channel_id channel_id; t_channel_id channel_id;
bool buildProperties(const FrontendParameters*, struct dtv_properties &, bool useMultistream); bool buildProperties(const FrontendParameters*, struct dtv_properties &, bool can_multistream);
FrontendParameters getFrontend(void) const; FrontendParameters getFrontend(void) const;
void secSetTone(const fe_sec_tone_mode_t mode, const uint32_t ms); void secSetTone(const fe_sec_tone_mode_t mode, const uint32_t ms);

View File

@@ -80,8 +80,8 @@ extern int zapit_debug;
#define FE_COMMON_PROPS 2 #define FE_COMMON_PROPS 2
#define FE_DVBS_PROPS 6 #define FE_DVBS_PROPS 6
#define FE_DVBS2_PROPS 10 #define FE_DVBS2_PROPS 8
#define FE_DVBS2X_PROPS 10 #define FE_DVBS2X_PROPS 9
#define FE_DVBC_PROPS 6 #define FE_DVBC_PROPS 6
#define FE_DVBT_PROPS 10 #define FE_DVBT_PROPS 10
#define FE_DVBT2_PROPS 11 #define FE_DVBT2_PROPS 11
@@ -108,8 +108,6 @@ static const struct dtv_property dvbs2_cmdargs[] = {
{ DTV_INNER_FEC, {} , { FEC_AUTO }, 0 }, { DTV_INNER_FEC, {} , { FEC_AUTO }, 0 },
{ DTV_PILOT, {} , { PILOT_AUTO }, 0 }, { DTV_PILOT, {} , { PILOT_AUTO }, 0 },
{ DTV_ROLLOFF, {} , { ROLLOFF_AUTO }, 0 }, { DTV_ROLLOFF, {} , { ROLLOFF_AUTO }, 0 },
{ DTV_STREAM_ID, {} , { NO_STREAM_ID_FILTER }, 0 },
{ DTV_STREAM_ID, {} , { NO_STREAM_ID_FILTER }, 0 }, // twice for BCM45308X
{ DTV_TUNE, {} , { 0 }, 0 } { DTV_TUNE, {} , { 0 }, 0 }
}; };
@@ -124,7 +122,6 @@ static const struct dtv_property dvbs2x_cmdargs[] = {
{ DTV_PILOT, {} , { PILOT_AUTO }, 0 }, { DTV_PILOT, {} , { PILOT_AUTO }, 0 },
{ DTV_ROLLOFF, {} , { ROLLOFF_AUTO }, 0 }, { DTV_ROLLOFF, {} , { ROLLOFF_AUTO }, 0 },
{ DTV_STREAM_ID, {} , { NO_STREAM_ID_FILTER }, 0 }, { DTV_STREAM_ID, {} , { NO_STREAM_ID_FILTER }, 0 },
{ DTV_STREAM_ID, {} , { NO_STREAM_ID_FILTER }, 0 }, // twice for BCM45308X
{ DTV_TUNE, {} , { 0 }, 0 } { DTV_TUNE, {} , { 0 }, 0 }
}; };
@@ -282,7 +279,7 @@ CFrontend::CFrontend(int Number, int Adapter)
memset(&info, 0, sizeof(info)); memset(&info, 0, sizeof(info));
deliverySystemMask = UNKNOWN_DS; deliverySystemMask = UNKNOWN_DS;
isMultistream = false; fe_can_multistream = false;
} }
CFrontend::~CFrontend(void) CFrontend::~CFrontend(void)
@@ -402,8 +399,8 @@ void CFrontend::getFEInfo(void)
break; break;
case SYS_DVBT2: case SYS_DVBT2:
deliverySystemMask |= DVB_T2; deliverySystemMask |= DVB_T2;
isMultistream = info.caps & FE_CAN_MULTISTREAM; fe_can_multistream = info.caps & FE_CAN_MULTISTREAM;
printf("[fe%d/%d] add delivery system DVB-T2 (delivery_system: %d / Multistream: %s)\n", adapter, fenumber, (fe_delivery_system_t)prop[0].u.buffer.data[i], isMultistream ? "yes" :"no"); printf("[fe%d/%d] add delivery system DVB-T2 (delivery_system: %d / Multistream: %s)\n", adapter, fenumber, (fe_delivery_system_t)prop[0].u.buffer.data[i], fe_can_multistream ? "yes" :"no");
break; break;
case SYS_DVBS: case SYS_DVBS:
deliverySystemMask |= DVB_S; deliverySystemMask |= DVB_S;
@@ -411,13 +408,13 @@ void CFrontend::getFEInfo(void)
break; break;
case SYS_DVBS2: case SYS_DVBS2:
deliverySystemMask |= DVB_S2; deliverySystemMask |= DVB_S2;
isMultistream = info.caps & FE_CAN_MULTISTREAM; fe_can_multistream = info.caps & FE_CAN_MULTISTREAM;
printf("[fe%d/%d] add delivery system DVB-S2 (delivery_system: %d / Multistream: %s)\n", adapter, fenumber, (fe_delivery_system_t)prop[0].u.buffer.data[i], isMultistream ? "yes" :"no"); printf("[fe%d/%d] add delivery system DVB-S2 (delivery_system: %d / Multistream: %s)\n", adapter, fenumber, (fe_delivery_system_t)prop[0].u.buffer.data[i], fe_can_multistream ? "yes" :"no");
break; break;
case SYS_DVBS2X: case SYS_DVBS2X:
deliverySystemMask |= DVB_S2X; deliverySystemMask |= DVB_S2X;
isMultistream = info.caps & FE_CAN_MULTISTREAM; fe_can_multistream = info.caps & FE_CAN_MULTISTREAM;
printf("[fe%d/%d] add delivery system DVB-S2X (delivery_system: %d / Multistream: %s)\n", adapter, fenumber, (fe_delivery_system_t)prop[0].u.buffer.data[i], isMultistream ? "yes" :"no"); printf("[fe%d/%d] add delivery system DVB-S2X (delivery_system: %d / Multistream: %s)\n", adapter, fenumber, (fe_delivery_system_t)prop[0].u.buffer.data[i], fe_can_multistream ? "yes" :"no");
break; break;
case SYS_DTMB: case SYS_DTMB:
deliverySystemMask |= DTMB; deliverySystemMask |= DTMB;
@@ -1458,7 +1455,7 @@ void CFrontend::setName(const char* _name)
snprintf(info.name, sizeof(info.name)-1, "%s", _name); snprintf(info.name, sizeof(info.name)-1, "%s", _name);
} }
bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_properties& cmdseq, bool useMultistream) bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_properties& cmdseq, bool can_multistream)
{ {
fe_pilot_t pilot = PILOT_OFF; fe_pilot_t pilot = PILOT_OFF;
int fec; int fec;
@@ -1466,13 +1463,14 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
/* cast to int is ncesessary because many of the FEC_S2 values are not /* cast to int is ncesessary because many of the FEC_S2 values are not
* properly defined in the enum, thus the compiler complains... :-( */ * properly defined in the enum, thus the compiler complains... :-( */
switch ((int)fec_inner) { switch ((int)fec_inner)
{
case FEC_1_2: case FEC_1_2:
fec = FEC_1_2; fec = FEC_1_2;
break; break;
case FEC_2_3: case FEC_2_3:
fec = FEC_2_3; fec = FEC_2_3;
if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) if ((feparams->delsys == DVB_S2 || feparams->delsys == DVB_S2X) && feparams->modulation == PSK_8)
#if BOXMODEL_VUPLUS_ARM #if BOXMODEL_VUPLUS_ARM
pilot = PILOT_AUTO; pilot = PILOT_AUTO;
#else #else
@@ -1481,7 +1479,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
break; break;
case FEC_3_4: case FEC_3_4:
fec = FEC_3_4; fec = FEC_3_4;
if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) if ((feparams->delsys == DVB_S2 || feparams->delsys == DVB_S2X) && feparams->modulation == PSK_8)
#if BOXMODEL_VUPLUS_ARM #if BOXMODEL_VUPLUS_ARM
pilot = PILOT_AUTO; pilot = PILOT_AUTO;
#else #else
@@ -1493,7 +1491,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
break; break;
case FEC_5_6: case FEC_5_6:
fec = FEC_5_6; fec = FEC_5_6;
if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) if ((feparams->delsys == DVB_S2 || feparams->delsys == DVB_S2X) && feparams->modulation == PSK_8)
#if BOXMODEL_VUPLUS_ARM #if BOXMODEL_VUPLUS_ARM
pilot = PILOT_AUTO; pilot = PILOT_AUTO;
#else #else
@@ -1511,7 +1509,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
break; break;
case FEC_3_5: case FEC_3_5:
fec = FEC_3_5; fec = FEC_3_5;
if (feparams->delsys == DVB_S2 && feparams->modulation == PSK_8) if ((feparams->delsys == DVB_S2 || feparams->delsys == DVB_S2X) && feparams->modulation == PSK_8)
#if BOXMODEL_VUPLUS_ARM #if BOXMODEL_VUPLUS_ARM
pilot = PILOT_AUTO; pilot = PILOT_AUTO;
#else #else
@@ -1590,7 +1588,8 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
fec = FEC_AUTO; fec = FEC_AUTO;
break; break;
} }
switch(feparams->pilot) { switch(feparams->pilot)
{
case ZPILOT_ON: case ZPILOT_ON:
pilot = PILOT_ON; pilot = PILOT_ON;
break; break;
@@ -1605,65 +1604,55 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
int nrOfProps = 0; int nrOfProps = 0;
switch (feparams->delsys) { switch (feparams->delsys)
{
case DVB_S: case DVB_S:
case DVB_S2: case DVB_S2:
if (feparams->delsys == DVB_S2) { case DVB_S2X:
if (useMultistream) { if (feparams->delsys == DVB_S2 || feparams->delsys == DVB_S2X)
nrOfProps = FE_DVBS2X_PROPS; {
if (can_multistream)
{
nrOfProps = FE_DVBS2X_PROPS;
memcpy(cmdseq.props, dvbs2x_cmdargs, sizeof(dvbs2x_cmdargs)); memcpy(cmdseq.props, dvbs2x_cmdargs, sizeof(dvbs2x_cmdargs));
cmdseq.props[MIS].u.data = feparams->plp_id | (feparams->pls_code << 8) | (feparams->pls_mode << 26); cmdseq.props[MIS].u.data = feparams->plp_id | (feparams->pls_code << 8) | (feparams->pls_mode << 26);
} else { }
else
{
nrOfProps = FE_DVBS2_PROPS; nrOfProps = FE_DVBS2_PROPS;
memcpy(cmdseq.props, dvbs2_cmdargs, sizeof(dvbs2_cmdargs)); memcpy(cmdseq.props, dvbs2_cmdargs, sizeof(dvbs2_cmdargs));
} }
cmdseq.props[MODULATION].u.data = feparams->modulation; cmdseq.props[MODULATION].u.data = feparams->modulation;
cmdseq.props[ROLLOFF].u.data = feparams->rolloff; cmdseq.props[ROLLOFF].u.data = feparams->rolloff;
cmdseq.props[PILOTS].u.data = pilot; cmdseq.props[PILOTS].u.data = pilot;
}
if (zapit_debug) { else
if (useMultistream) {
printf("[fe%d/%d] tuner pilot %d (feparams %d) streamid (%d/%d/%d)\n", adapter, fenumber, pilot, feparams->pilot, feparams->plp_id, feparams->pls_code, feparams->pls_mode );
else
printf("[fe%d/%d] tuner pilot %d (feparams %d)\n", adapter, fenumber, pilot, feparams->pilot);
}
} else {
memcpy(cmdseq.props, dvbs_cmdargs, sizeof(dvbs_cmdargs)); memcpy(cmdseq.props, dvbs_cmdargs, sizeof(dvbs_cmdargs));
nrOfProps = FE_DVBS_PROPS; nrOfProps = FE_DVBS_PROPS;
} }
cmdseq.props[FREQUENCY].u.data = feparams->frequency; cmdseq.props[FREQUENCY].u.data = feparams->frequency;
cmdseq.props[SYMBOL_RATE].u.data = feparams->symbol_rate; cmdseq.props[SYMBOL_RATE].u.data = feparams->symbol_rate;
cmdseq.props[INNER_FEC].u.data = fec; /*_inner*/ cmdseq.props[INNER_FEC].u.data = fec; /*_inner*/ ;
break; if (can_multistream)
case DVB_S2X: INFO("[fe%d/%d] tuner pilot %d (feparams %d) streamid (%d/%d/%d)\n", adapter, fenumber, pilot, feparams->pilot, feparams->plp_id, feparams->pls_code, feparams->pls_mode );
nrOfProps = FE_DVBS2X_PROPS; else
memcpy(cmdseq.props, dvbs2x_cmdargs, sizeof(dvbs2x_cmdargs)); INFO("[fe%d/%d] tuner pilot %d (feparams %d)\n", adapter, fenumber, pilot, feparams->pilot);
cmdseq.props[MODULATION].u.data = feparams->modulation;
cmdseq.props[ROLLOFF].u.data = feparams->rolloff;
cmdseq.props[PILOTS].u.data = pilot;
cmdseq.props[MIS].u.data = feparams->plp_id | (feparams->pls_code << 8) | (feparams->pls_mode << 26);
if (zapit_debug)
printf("[fe%d/%d] tuner pilot %d (feparams %d) streamid (%d/%d/%d)\n", adapter, fenumber, pilot, feparams->pilot, feparams->plp_id, feparams->pls_code, feparams->pls_mode);
cmdseq.props[FREQUENCY].u.data = feparams->frequency;
cmdseq.props[SYMBOL_RATE].u.data = feparams->symbol_rate;
cmdseq.props[INNER_FEC].u.data = fec; /*_inner*/
break; break;
case DVB_C: case DVB_C:
memcpy(cmdseq.props, dvbc_cmdargs, sizeof(dvbc_cmdargs)); memcpy(cmdseq.props, dvbc_cmdargs, sizeof(dvbc_cmdargs));
nrOfProps = FE_DVBC_PROPS;
cmdseq.props[FREQUENCY].u.data = feparams->frequency; cmdseq.props[FREQUENCY].u.data = feparams->frequency;
cmdseq.props[MODULATION].u.data = feparams->modulation; cmdseq.props[MODULATION].u.data = feparams->modulation;
cmdseq.props[SYMBOL_RATE].u.data = feparams->symbol_rate; cmdseq.props[SYMBOL_RATE].u.data = feparams->symbol_rate;
cmdseq.props[INNER_FEC].u.data = fec_inner; cmdseq.props[INNER_FEC].u.data = fec_inner;
nrOfProps = FE_DVBC_PROPS;
break; break;
case DVB_T: case DVB_T:
case DTMB: case DTMB:
memcpy(cmdseq.props, dvbt_cmdargs, sizeof(dvbt_cmdargs)); memcpy(cmdseq.props, dvbt_cmdargs, sizeof(dvbt_cmdargs));
nrOfProps = FE_DVBT_PROPS; nrOfProps = FE_DVBT_PROPS;
cmdseq.props[FREQUENCY].u.data = feparams->frequency; cmdseq.props[FREQUENCY].u.data = feparams->frequency;
cmdseq.props[MODULATION].u.data = feparams->modulation; cmdseq.props[MODULATION].u.data = feparams->modulation;
cmdseq.props[INVERSION].u.data = feparams->inversion; cmdseq.props[INVERSION].u.data = feparams->inversion;
cmdseq.props[CODE_RATE_HP].u.data = feparams->code_rate_HP; cmdseq.props[CODE_RATE_HP].u.data = feparams->code_rate_HP;
cmdseq.props[CODE_RATE_LP].u.data = feparams->code_rate_LP; cmdseq.props[CODE_RATE_LP].u.data = feparams->code_rate_LP;
@@ -1677,7 +1666,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
memcpy(cmdseq.props, dvbt2_cmdargs, sizeof(dvbt2_cmdargs)); memcpy(cmdseq.props, dvbt2_cmdargs, sizeof(dvbt2_cmdargs));
nrOfProps = FE_DVBT2_PROPS; nrOfProps = FE_DVBT2_PROPS;
cmdseq.props[FREQUENCY].u.data = feparams->frequency; cmdseq.props[FREQUENCY].u.data = feparams->frequency;
cmdseq.props[MODULATION].u.data = feparams->modulation; cmdseq.props[MODULATION].u.data = feparams->modulation;
cmdseq.props[INVERSION].u.data = feparams->inversion; cmdseq.props[INVERSION].u.data = feparams->inversion;
cmdseq.props[CODE_RATE_HP].u.data = feparams->code_rate_HP; cmdseq.props[CODE_RATE_HP].u.data = feparams->code_rate_HP;
cmdseq.props[CODE_RATE_LP].u.data = feparams->code_rate_LP; cmdseq.props[CODE_RATE_LP].u.data = feparams->code_rate_LP;
@@ -1689,7 +1678,7 @@ bool CFrontend::buildProperties(const FrontendParameters *feparams, struct dtv_p
cmdseq.props[PLP_ID].u.data = feparams->plp_id; cmdseq.props[PLP_ID].u.data = feparams->plp_id;
break; break;
default: default:
INFO("[frontend] unknown frontend type, exiting"); INFO("[fe%d/%d] unknown frontend type, exiting\n", adapter, fenumber);
return false; return false;
} }
@@ -1735,7 +1724,7 @@ int CFrontend::setFrontend(const FrontendParameters *feparams, bool nowait)
} }
} }
if (!buildProperties(feparams, cmdseq, isMultistream)) if (!buildProperties(feparams, cmdseq, fe_can_multistream))
return 0; return 0;
{ {