From: ghost Date: Thu, 30 Oct 2008 20:21:46 +0000 (+0100) Subject: Add DiSEqC reset after voltage enable and tune failed... hopefully this fixes problem... X-Git-Tag: 2.6.0~667 X-Git-Url: https://git.cweiske.de/enigma2.git/commitdiff_plain/4b8de38c639f03b191ce66d85d5b2c894117d4d5?ds=sidebyside Add DiSEqC reset after voltage enable and tune failed... hopefully this fixes problems with some DiSEqC switches --- diff --git a/lib/dvb/frontend.cpp b/lib/dvb/frontend.cpp index 1bcacc03..635de8f5 100644 --- a/lib/dvb/frontend.cpp +++ b/lib/dvb/frontend.cpp @@ -1492,7 +1492,12 @@ void eDVBFrontend::tuneLoop() // called by m_tuneTimer eDebugNoSimulateNoNewLine("[SEC] sendDiseqc: "); for (int i=0; i < m_sec_sequence.current()->diseqc.len; ++i) eDebugNoSimulateNoNewLine("%02x", m_sec_sequence.current()->diseqc.data[i]); - eDebugNoSimulate(""); + if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x00", 3)) + eDebugNoSimulate("(DiSEqC reset)"); + else if (!memcmp(m_sec_sequence.current()->diseqc.data, "\xE0\x00\x03", 3)) + eDebugNoSimulate("(DiSEqC peripherial power on)"); + else + eDebugNoSimulate(""); ++m_sec_sequence.current(); break; case eSecCommand::SEND_TONEBURST: diff --git a/lib/dvb/sec.cpp b/lib/dvb/sec.cpp index ca9e4ec8..35a8d04a 100644 --- a/lib/dvb/sec.cpp +++ b/lib/dvb/sec.cpp @@ -372,6 +372,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA bool doSetVoltageToneFrontend = true; bool sendDiSEqC = false; bool forceChanged = false; + bool needDiSEqCReset = false; long band=0, voltage = iDVBFrontend::voltageOff, tone = iDVBFrontend::toneOff, @@ -418,6 +419,9 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_fe->getData(eDVBFrontend::ROTOR_CMD, lastRotorCmd); sec_fe->getData(eDVBFrontend::ROTOR_POS, curRotorPos); + if (lastcsw == lastucsw && lastToneburst == lastucsw && lastucsw == -1) + needDiSEqCReset = true; + if ( sat.frequency > lnb_param.m_lof_threshold ) band |= 1; @@ -623,6 +627,23 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, m_params[DELAY_AFTER_ENABLE_VOLTAGE_BEFORE_SWITCH_CMDS]) ); sec_sequence.push_back( eSecCommand(eSecCommand::INVALIDATE_CURRENT_SWITCHPARMS) ); + if (needDiSEqCReset) + { + eDVBDiseqcCommand diseqc; + memset(diseqc.data, 0, MAX_DISEQC_LENGTH); + diseqc.len = 3; + diseqc.data[0] = 0xE0; + diseqc.data[1] = 0; + diseqc.data[2] = 0; + // diseqc reset + sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 50) ); + diseqc.data[2] = 3; + // diseqc peripherial powersupply on + sec_sequence.push_back( eSecCommand(eSecCommand::SEND_DISEQC, diseqc) ); + sec_sequence.push_back( eSecCommand(eSecCommand::SLEEP, 150) ); + } + for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat) { if ( send_mask & 4 )