int linuxdvb_satconf_start_mux
( linuxdvb_satconf_t *ls, mpegts_mux_instance_t *mmi );
+int linuxdvb_satconf_tone_off( linuxdvb_satconf_ele_t *ls, int fd, int delay );
+
void linuxdvb_satconf_reset
( linuxdvb_satconf_t *ls );
if (linuxdvb_rotor_check_orbital_pos(lr, lm, ls))
return 0;
+ if (linuxdvb_satconf_tone_off(ls, fd, 1))
+ return -1;
+
/* Force to 18v (quicker movement) */
if (ioctl(fd, FE_SET_VOLTAGE, SEC_VOLTAGE_18)) {
tvherror("diseqc", "failed to set 18v for rotor movement");
return r;
}
+int
+linuxdvb_satconf_tone_off ( linuxdvb_satconf_ele_t *lse, int fd, int delay )
+{
+ linuxdvb_satconf_t *ls = lse->lse_parent;
+
+ if (ls->ls_last_tone_off != 1) {
+ if (ioctl(fd, FE_SET_TONE, SEC_TONE_OFF)) {
+ tvherror("diseqc", "failed to disable tone");
+ return -1;
+ }
+ ls->ls_last_tone_off = 1;
+ }
+ if (delay)
+ usleep(10000);
+ return 0;
+}
+
static void linuxdvb_satconf_ele_tune_cb ( void *o );
static int
if (!lse->lse_en50494 || lse->lse_switch || lse->lse_rotor) {
if (ls->ls_diseqc_full || ls->ls_last_tone_off != 1) {
tvhtrace("diseqc", "initial tone off");
- if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, SEC_TONE_OFF)) {
- tvherror("diseqc", "failed to disable tone");
+ if (linuxdvb_satconf_tone_off(lse, lfe->lfe_fe_fd, 0))
return -1;
- }
- ls->ls_last_tone_off = 1;
}
}
lsp->ls_last_switch = NULL;
+ if (linuxdvb_satconf_tone_off(sc, fd, 1))
+ return -1;
+
pol = (sc->lse_lnb) ? sc->lse_lnb->lnb_pol (sc->lse_lnb, lm) & 0x1 : 0;
band = (sc->lse_lnb) ? sc->lse_lnb->lnb_band(sc->lse_lnb, lm) & 0x1 : 0;
com = 0xF0 | (ls->ls_committed << 2) | (pol << 1) | band;
/* Tone burst */
if (ls->ls_toneburst >= 0 &&
(lsp->ls_diseqc_full || lsp->ls_last_toneburst != ls->ls_toneburst + 1)) {
+
+ if (linuxdvb_satconf_tone_off(sc, fd, 1))
+ return -1;
+
lsp->ls_last_toneburst = 0;
tvhtrace("diseqc", "toneburst %s", ls->ls_toneburst ? "B" : "A");
if (ioctl(fd, FE_DISEQC_SEND_BURST,