Add DiSEqC reset after voltage enable and tune failed... hopefully this fixes problem...
authorghost <andreas.monzner@multimedia-labs.de>
Thu, 30 Oct 2008 20:21:46 +0000 (21:21 +0100)
committerAndreas Oberritter <obi@saftware.de>
Thu, 6 Nov 2008 00:41:43 +0000 (01:41 +0100)
lib/dvb/frontend.cpp
lib/dvb/sec.cpp

index 1bcacc0..635de8f 100644 (file)
@@ -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]);
                                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:
                                ++m_sec_sequence.current();
                                break;
                        case eSecCommand::SEND_TONEBURST:
index ca9e4ec..35a8d04 100644 (file)
@@ -372,6 +372,7 @@ RESULT eDVBSatelliteEquipmentControl::prepare(iDVBFrontend &frontend, FRONTENDPA
                        bool doSetVoltageToneFrontend = true;
                        bool sendDiSEqC = false;
                        bool forceChanged = false;
                        bool doSetVoltageToneFrontend = true;
                        bool sendDiSEqC = false;
                        bool forceChanged = false;
+                       bool needDiSEqCReset = false;
                        long band=0,
                                voltage = iDVBFrontend::voltageOff,
                                tone = iDVBFrontend::toneOff,
                        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);
 
                        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;
 
                        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) );
                                                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 )
                                                for (int seq_repeat = 0; seq_repeat < (di_param.m_seq_repeat?2:1); ++seq_repeat)
                                                {
                                                        if ( send_mask & 4 )