Commit 9193098e authored by jpsaman's avatar jpsaman

Add option to override Code Rate (FEC Inner) settings.

Some DVB drivers do not work well with FEC_AUTO. This option allows
to set the FEC Inner manually.

Default value: 999 (FEC_AUTO)

git-svn-id: svn://svn.videolan.org/dvblast/trunk@124 55d3f8b6-4a41-4d2d-a900-313d1436a5b8
parent 07485e70
...@@ -505,6 +505,33 @@ static fe_modulation_t GetModulation(void) ...@@ -505,6 +505,33 @@ static fe_modulation_t GetModulation(void)
exit(1); exit(1);
} }
static fe_code_rate_t GetFECInner(fe_caps_t fe_caps)
{
#define GET_FEC_INNER(fec,val) \
if ( (fe_caps & FE_CAN_##fec) && (i_fec == val) ) \
return fec;
GET_FEC_INNER(FEC_AUTO,999);
if (i_fec == 0)
return FEC_NONE;
GET_FEC_INNER(FEC_1_2, 12);
GET_FEC_INNER(FEC_2_3, 23);
GET_FEC_INNER(FEC_3_4, 34);
if (i_fec == 35)
return FEC_3_5;
GET_FEC_INNER(FEC_4_5, 45);
GET_FEC_INNER(FEC_5_6, 56);
GET_FEC_INNER(FEC_6_7, 67);
GET_FEC_INNER(FEC_7_8, 78);
GET_FEC_INNER(FEC_8_9, 89);
if (i_fec == 910)
return FEC_9_10;
#undef GET_FEC_INNER
msg_Err( NULL, "invalid fec-inner %d", i_fec );
exit(1);
}
/***************************************************************************** /*****************************************************************************
* FrontendSet * FrontendSet
*****************************************************************************/ *****************************************************************************/
...@@ -575,6 +602,7 @@ static struct dtv_properties dvbt_cmdseq = { ...@@ -575,6 +602,7 @@ static struct dtv_properties dvbt_cmdseq = {
#define INVERSION 2 #define INVERSION 2
#define SYMBOL_RATE 3 #define SYMBOL_RATE 3
#define BANDWIDTH 3 #define BANDWIDTH 3
#define FEC_INNER 4
static void FrontendSet( void ) static void FrontendSet( void )
{ {
...@@ -623,10 +651,11 @@ static void FrontendSet( void ) ...@@ -623,10 +651,11 @@ static void FrontendSet( void )
p = &dvbs_cmdseq; p = &dvbs_cmdseq;
p->props[SYMBOL_RATE].u.data = i_srate; p->props[SYMBOL_RATE].u.data = i_srate;
p->props[FEC_INNER].u.data = GetFECInner(info.caps);
p->props[FREQUENCY].u.data = FrontendDoDiseqc(); p->props[FREQUENCY].u.data = FrontendDoDiseqc();
msg_Dbg( NULL, "tuning QPSK frontend to f=%d srate=%d modulation=%s", msg_Dbg( NULL, "tuning QPSK frontend to f=%d srate=%d fec=%d modulation=%s",
i_frequency, i_srate, i_frequency, i_srate, i_fec,
psz_modulation == NULL ? "legacy" : psz_modulation ); psz_modulation == NULL ? "legacy" : psz_modulation );
break; break;
...@@ -700,8 +729,8 @@ static void FrontendSet( void ) ...@@ -700,8 +729,8 @@ static void FrontendSet( void )
fep.u.qam.fec_inner = FEC_AUTO; fep.u.qam.fec_inner = FEC_AUTO;
fep.u.qam.modulation = QAM_AUTO; fep.u.qam.modulation = QAM_AUTO;
msg_Dbg( NULL, "tuning QAM frontend to f=%d, srate=%d", i_frequency, msg_Dbg( NULL, "tuning QAM frontend to f=%d, srate=%d",
i_srate ); i_frequency, i_srate );
break; break;
case FE_QPSK: case FE_QPSK:
......
...@@ -53,6 +53,7 @@ int i_adapter = 0; ...@@ -53,6 +53,7 @@ int i_adapter = 0;
int i_fenum = 0; int i_fenum = 0;
int i_frequency = 0; int i_frequency = 0;
int i_srate = 27500000; int i_srate = 27500000;
int i_fec = 999;
int i_satnum = 0; int i_satnum = 0;
int i_voltage = 13; int i_voltage = 13;
int b_tone = 0; int b_tone = 0;
...@@ -312,7 +313,7 @@ static void DisplayVersion() ...@@ -312,7 +313,7 @@ static void DisplayVersion()
*****************************************************************************/ *****************************************************************************/
void usage() void usage()
{ {
msg_Raw( NULL, "Usage: dvblast [-q] [-c <config file>] [-r <remote socket>] [-t <ttl>] [-o <SSRC IP>] [-i <RT priority>] [-a <adapter>] [-n <frontend number>] [-S <diseqc>] [-f <frequency>|-D <src mcast>:<port>|-A <ASI adapter>] [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-m <modulation] [-u] [-W] [-U] [-d <dest IP:port>] [-e] [-T]" ); msg_Raw( NULL, "Usage: dvblast [-q] [-c <config file>] [-r <remote socket>] [-t <ttl>] [-o <SSRC IP>] [-i <RT priority>] [-a <adapter>] [-n <frontend number>] [-S <diseqc>] [-f <frequency>|-D <src mcast>:<port>|-A <ASI adapter>] [-F <fec inner>] [-s <symbol rate>] [-v <0|13|18>] [-p] [-b <bandwidth>] [-m <modulation] [-u] [-W] [-U] [-d <dest IP:port>] [-e] [-T]" );
msg_Raw( NULL, "Input:" ); msg_Raw( NULL, "Input:" );
msg_Raw( NULL, " -a --adapter <adapter>" ); msg_Raw( NULL, " -a --adapter <adapter>" );
...@@ -321,6 +322,8 @@ void usage() ...@@ -321,6 +322,8 @@ void usage()
msg_Raw( NULL, " -D --rtp-input read packets from a multicast address instead of a DVB card" ); msg_Raw( NULL, " -D --rtp-input read packets from a multicast address instead of a DVB card" );
msg_Raw( NULL, " -e --epg-passthrough enable EPG pass through (EIT data)" ); msg_Raw( NULL, " -e --epg-passthrough enable EPG pass through (EIT data)" );
msg_Raw( NULL, " -f --frequency frontend frequency" ); msg_Raw( NULL, " -f --frequency frontend frequency" );
msg_Raw( NULL, " -F --fec-inner Forward Error Correction (FEC Inner)");
msg_Raw( NULL, " DVB-S2 0|12|23|34|35|56|78|89|910|999 (default auto: 999)");
msg_Raw( NULL, " -m --modulation Modulation type" ); msg_Raw( NULL, " -m --modulation Modulation type" );
msg_Raw( NULL, " DVB-C qpsk|qam_16|qam_32|qam_64|qam_128|qam_256 (default qam_auto)" ); msg_Raw( NULL, " DVB-C qpsk|qam_16|qam_32|qam_64|qam_128|qam_256 (default qam_auto)" );
msg_Raw( NULL, " DVB-T qam_16|qam_32|qam_64|qam_128|qam_256 (default qam_auto)" ); msg_Raw( NULL, " DVB-T qam_16|qam_32|qam_64|qam_128|qam_256 (default qam_auto)" );
...@@ -371,6 +374,7 @@ int main( int i_argc, char **pp_argv ) ...@@ -371,6 +374,7 @@ int main( int i_argc, char **pp_argv )
{ "adapter", required_argument, NULL, 'a' }, { "adapter", required_argument, NULL, 'a' },
{ "frontend-number", required_argument, NULL, 'n' }, { "frontend-number", required_argument, NULL, 'n' },
{ "frequency", required_argument, NULL, 'f' }, { "frequency", required_argument, NULL, 'f' },
{ "fec-inner", required_argument, NULL, 'F' },
{ "symbol-rate", required_argument, NULL, 's' }, { "symbol-rate", required_argument, NULL, 's' },
{ "diseqc", required_argument, NULL, 'S' }, { "diseqc", required_argument, NULL, 'S' },
{ "voltage", required_argument, NULL, 'v' }, { "voltage", required_argument, NULL, 'v' },
...@@ -390,7 +394,7 @@ int main( int i_argc, char **pp_argv ) ...@@ -390,7 +394,7 @@ int main( int i_argc, char **pp_argv )
{ 0, 0, 0, 0} { 0, 0, 0, 0}
}; };
while ( ( c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:f:s:S:v:pb:m:uWUTd:D:A:ehV", long_options, NULL)) != -1 ) while ( ( c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:f:F:s:S:v:pb:m:uWUTd:D:A:ehV", long_options, NULL)) != -1 )
{ {
switch ( c ) switch ( c )
{ {
...@@ -465,6 +469,10 @@ int main( int i_argc, char **pp_argv ) ...@@ -465,6 +469,10 @@ int main( int i_argc, char **pp_argv )
pf_UnsetFilter = dvb_UnsetFilter; pf_UnsetFilter = dvb_UnsetFilter;
break; break;
case 'F':
i_fec = strtol( optarg, NULL, 0 );
break;
case 's': case 's':
i_srate = strtol( optarg, NULL, 0 ); i_srate = strtol( optarg, NULL, 0 );
break; break;
......
...@@ -112,6 +112,7 @@ extern int i_fenum; ...@@ -112,6 +112,7 @@ extern int i_fenum;
extern int i_frequency; extern int i_frequency;
extern int i_srate; extern int i_srate;
extern int i_satnum; extern int i_satnum;
extern int i_fec;
extern int i_voltage; extern int i_voltage;
extern int b_tone; extern int b_tone;
extern int i_bandwidth; extern int i_bandwidth;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment