Commit 3f5c997c authored by Jean-Paul Saman's avatar Jean-Paul Saman Committed by Christophe Massiot

DVB-S2: Add option to override ROLLOFF setting

Some DVB drivers do not work properly with ROLLOFF_AUTO and fail to tune when requested.
By allowing to override the default setting tuning to these DVB-S2 channels does work.
According to /usr/include/linux/dvb/frontend.h (DVBAPI version 5 and above) the default
value for ROLLOFF is ROLLOFF_35 iso ROLLOFF_AUTO.

- ROLLOFF_35 is now default when -R <35|20|25|0=auto> option is not given
parent df319fd6
......@@ -530,6 +530,18 @@ static fe_code_rate_t GetFECInner(fe_caps_t fe_caps)
exit(1);
}
static fe_rolloff_t GetRollOff(int rolloff)
{
switch( rolloff )
{
case 0: return ROLLOFF_AUTO;
case 20: return ROLLOFF_20;
case 25: return ROLLOFF_25;
default:
case 35: return ROLLOFF_35;
}
}
/*****************************************************************************
* FrontendInfo : Print frontend info
*****************************************************************************/
......@@ -663,6 +675,7 @@ static struct dtv_properties dvbt_cmdseq = {
#define SYMBOL_RATE 3
#define BANDWIDTH 3
#define FEC_INNER 4
#define ROLLOFF 7
static void FrontendSet( void )
{
......@@ -708,6 +721,7 @@ static void FrontendSet( void )
{
p = &dvbs2_cmdseq;
p->props[MODULATION].u.data = GetModulation();
p->props[ROLLOFF].u.data = GetRollOff(i_rolloff);
}
else
p = &dvbs_cmdseq;
......@@ -716,8 +730,8 @@ static void FrontendSet( void )
p->props[FEC_INNER].u.data = GetFECInner(info.caps);
p->props[FREQUENCY].u.data = FrontendDoDiseqc();
msg_Dbg( NULL, "tuning QPSK frontend to f=%d srate=%d fec=%d modulation=%s",
i_frequency, i_srate, i_fec,
msg_Dbg( NULL, "tuning QPSK frontend to f=%d srate=%d fec=%d rolloff=%d modulation=%s",
i_frequency, i_srate, i_fec, i_rolloff,
psz_modulation == NULL ? "legacy" : psz_modulation );
break;
......@@ -854,6 +868,7 @@ uint8_t dvb_FrontendStatus( uint8_t *p_answer, ssize_t *pi_size )
msg_Err( NULL, "ioctl FE_GET_INFO failed (%s)", strerror(errno) );
return RET_ERR;
}
if ( ioctl( i_frontend, FE_READ_STATUS, &p_ret->i_status ) < 0 )
{
msg_Err( NULL, "ioctl FE_READ_STATUS failed (%s)", strerror(errno) );
......
......@@ -54,6 +54,7 @@ int i_fenum = 0;
int i_frequency = 0;
int i_srate = 27500000;
int i_fec = 999;
int i_rolloff = 35;
int i_satnum = 0;
int i_voltage = 13;
int b_tone = 0;
......@@ -313,7 +314,7 @@ static void DisplayVersion()
*****************************************************************************/
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>] [-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, "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>] [-R <rolloff>] [-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, " -a --adapter <adapter>" );
......@@ -330,6 +331,8 @@ void usage()
msg_Raw( NULL, " DVB-S2 qpsk|psk_8 (default legacy DVB-S)" );
msg_Raw( NULL, " -n --frontend-number <frontend number>" );
msg_Raw( NULL, " -p --force-pulse force 22kHz pulses for high-band selection (DVB-S)" );
msg_Raw( NULL, " -R --rolloff DVB-S2 Rolloff value" );
msg_Raw( NULL, " DVB-S2 35=0.35|25=0.25|20=0.20|0=AUTO (default: 35)" );
msg_Raw( NULL, " -s --symbole-rate" );
msg_Raw( NULL, " -S --diseqc satellite number for diseqc (0: no diseqc, 1-4, A or B)" );
msg_Raw( NULL, " -T --unique-ts-id generate unique TS ID for each program" );
......@@ -375,6 +378,7 @@ int main( int i_argc, char **pp_argv )
{ "frontend-number", required_argument, NULL, 'n' },
{ "frequency", required_argument, NULL, 'f' },
{ "fec-inner", required_argument, NULL, 'F' },
{ "rolloff", required_argument, NULL, 'R' },
{ "symbol-rate", required_argument, NULL, 's' },
{ "diseqc", required_argument, NULL, 'S' },
{ "voltage", required_argument, NULL, 'v' },
......@@ -394,7 +398,7 @@ int main( int i_argc, char **pp_argv )
{ 0, 0, 0, 0}
};
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 )
while ( ( c = getopt_long(i_argc, pp_argv, "q::c:r:t:o:i:a:n:f:F:R:s:S:v:pb:m:uWUTd:D:A:ehV", long_options, NULL)) != -1 )
{
switch ( c )
{
......@@ -473,6 +477,10 @@ int main( int i_argc, char **pp_argv )
i_fec = strtol( optarg, NULL, 0 );
break;
case 'R':
i_rolloff = strtol( optarg, NULL, 0 );
break;
case 's':
i_srate = strtol( optarg, NULL, 0 );
break;
......
......@@ -113,6 +113,7 @@ extern int i_frequency;
extern int i_srate;
extern int i_satnum;
extern int i_fec;
extern int i_rolloff;
extern int i_voltage;
extern int b_tone;
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