Commit 01810bfc authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DTV: Linux-specific DiSEqC 1.0 master support

parent 9f5e603e
...@@ -172,13 +172,16 @@ static const char *const polarization_user[] = { N_("Unspecified (0V)"), ...@@ -172,13 +172,16 @@ static const char *const polarization_user[] = { N_("Unspecified (0V)"),
"A continuous tone at 22kHz can be sent on the cable. " \ "A continuous tone at 22kHz can be sent on the cable. " \
"This normally selects the higher frequency band from a universal LNB.") "This normally selects the higher frequency band from a universal LNB.")
#if 0
#define SATNO_TEXT N_("DiSEqC LNB number") #define SATNO_TEXT N_("DiSEqC LNB number")
#define SATNO_LONGTEXT N_( \ #define SATNO_LONGTEXT N_( \
"If the satellite receiver is connected to multiple " \ "If the satellite receiver is connected to multiple " \
"low noise block-downconverters (LNB) through a DiSEqC 1.0 switch, " \ "low noise block-downconverters (LNB) through a DiSEqC 1.0 switch, " \
"the correct LNB can be selected (1 to 4). " \ "the correct LNB can be selected (1 to 4). " \
"If there is no switch, this parameter should be 0.") "If there is no switch, this parameter should be 0.")
#ifdef __linux__
static const int satno_vlc[] = { 0, 1, 2, 3, 4 };
static const char *const satno_user[] = { N_("Unspecified"),
"A/1", "B/2", "C/3", "D/4" };
#endif #endif
static int Open (vlc_object_t *); static int Open (vlc_object_t *);
...@@ -286,13 +289,12 @@ vlc_module_begin () ...@@ -286,13 +289,12 @@ vlc_module_begin ()
LNB_SWITCH_TEXT, LNB_SWITCH_LONGTEXT, true) LNB_SWITCH_TEXT, LNB_SWITCH_LONGTEXT, true)
change_integer_range (0, 0x7fffffff) change_integer_range (0, 0x7fffffff)
add_deprecated_alias ("dvb-lnb-slof") add_deprecated_alias ("dvb-lnb-slof")
add_integer ("dvb-tone", -1, TONE_TEXT, TONE_LONGTEXT, true) #ifdef __linux
change_integer_list (auto_off_on_vlc, auto_off_on_user)
#if 0
add_integer ("dvb-satno", 0, SATNO_TEXT, SATNO_LONGTEXT, true) add_integer ("dvb-satno", 0, SATNO_TEXT, SATNO_LONGTEXT, true)
change_integer_range (0, 4) change_integer_list (satno_vlc, satno_user)
change_safe ()
#endif #endif
add_integer ("dvb-tone", -1, TONE_TEXT, TONE_LONGTEXT, true)
change_integer_list (auto_off_on_vlc, auto_off_on_user)
vlc_module_end () vlc_module_end ()
struct access_sys_t struct access_sys_t
......
...@@ -595,9 +595,6 @@ known: ...@@ -595,9 +595,6 @@ known:
freq *= -1; freq *= -1;
assert (freq < 0x7fffffff); assert (freq < 0x7fffffff);
/* TODO: DiSEqC */
/* Continuous tone (to select high oscillator frequency) */
int tone; int tone;
switch (var_InheritInteger (d->obj, "dvb-tone")) switch (var_InheritInteger (d->obj, "dvb-tone"))
{ {
...@@ -606,10 +603,48 @@ known: ...@@ -606,10 +603,48 @@ known:
default: tone = high ? SEC_TONE_ON : SEC_TONE_OFF; default: tone = high ? SEC_TONE_ON : SEC_TONE_OFF;
} }
/*** LNB selection / DiSEqC ***/
unsigned voltage = dvb_parse_polarization (pol); unsigned voltage = dvb_parse_polarization (pol);
if (dvb_set_props (d, 2, DTV_TONE, SEC_TONE_OFF, DTV_VOLTAGE, voltage))
return -1;
unsigned satno = var_InheritInteger (d->obj, "dvb-satno");
if (satno > 0)
{
/* DiSEqC 1.0 */
#undef msleep /* we know what we are doing! */
struct dvb_diseqc_master_cmd cmd;
satno = (satno - 1) & 3;
cmd.msg[0] = 0xE0; /* framing: master, no reply, 1st TX */
cmd.msg[1] = 0x10; /* address: all LNB/switch */
cmd.msg[2] = 0x38; /* command: Write Port Group 0 */
cmd.msg[3] = 0xF0 /* data[0]: clear all bits */
| (satno << 2) /* LNB (A, B, C or D) */
| ((voltage == SEC_VOLTAGE_18) << 1) /* polarization */
| (tone == SEC_TONE_ON); /* option */
cmd.msg[4] = cmd.msg[5] = 0; /* unused */
msleep (15000); /* wait 15 ms before DiSEqC command */
if (ioctl (d->frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd) < 0)
{
msg_Err (d->obj, "cannot send DiSEqC command: %m");
return -1;
}
msleep (54000 + 15000);
/* Mini-DiSEqC */
satno &= 1;
if (ioctl (d->frontend, FE_DISEQC_SEND_BURST,
satno ? SEC_MINI_B : SEC_MINI_A) < 0)
{
msg_Err (d->obj, "cannot send Mini-DiSEqC tone burst: %m");
return -1;
}
msleep (15000);
}
return dvb_set_props (d, 3, DTV_FREQUENCY, freq, /* Continuous tone (to select high oscillator frequency) */
DTV_VOLTAGE, voltage, DTV_TONE, tone); return dvb_set_props (d, 2, DTV_FREQUENCY, freq, DTV_TONE, tone);
} }
int dvb_set_dvbs (dvb_device_t *d, uint32_t freq, int dvb_set_dvbs (dvb_device_t *d, uint32_t freq,
......
...@@ -68,9 +68,6 @@ static void Close( vlc_object_t *p_this ); ...@@ -68,9 +68,6 @@ static void Close( vlc_object_t *p_this );
#define SATELLITE_TEXT N_("Satellite scanning config") #define SATELLITE_TEXT N_("Satellite scanning config")
#define SATELLITE_LONGTEXT N_("filename of config file in share/dvb/dvb-s") #define SATELLITE_LONGTEXT N_("filename of config file in share/dvb/dvb-s")
#define SATNO_TEXT N_("Satellite number in the Diseqc system")
#define SATNO_LONGTEXT N_("[0=no diseqc, 1-4=satellite number].")
#define HOST_TEXT N_( "HTTP Host address" ) #define HOST_TEXT N_( "HTTP Host address" )
#define HOST_LONGTEXT N_( \ #define HOST_LONGTEXT N_( \
"To enable the internal HTTP server, set its address and port here." ) "To enable the internal HTTP server, set its address and port here." )
...@@ -115,8 +112,6 @@ vlc_module_begin () ...@@ -115,8 +112,6 @@ vlc_module_begin ()
/* DVB-S (satellite) */ /* DVB-S (satellite) */
add_string( "dvb-satellite", NULL, SATELLITE_TEXT, SATELLITE_LONGTEXT, add_string( "dvb-satellite", NULL, SATELLITE_TEXT, SATELLITE_LONGTEXT,
true ) true )
add_integer( "dvb-satno", 0, SATNO_TEXT, SATNO_LONGTEXT,
true )
#ifdef ENABLE_HTTPD #ifdef ENABLE_HTTPD
/* MMI HTTP interface */ /* MMI HTTP interface */
set_section( N_("HTTP server" ), 0 ) set_section( N_("HTTP server" ), 0 )
......
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