--- vdr-2.0.0/dvbdevice.c 2013-03-31 13:13:32.081458741 +0300 +++ vdr-1.7.40/dvbdevice.c 2013-03-31 13:26:33.260190854 +0300 @@ -23,6 +23,9 @@ #include "menuitems.h" #include "sourceparams.h" +int dfd_frontend=0; +int adap=0; + #if (DVB_API_VERSION << 8 | DVB_API_VERSION_MINOR) < 0x0508 #define DTV_STREAM_ID DTV_DVBT2_PLP_ID #define FE_CAN_MULTISTREAM 0x4000000 @@ -344,8 +347,19 @@ device = Device; fd_frontend = Fd_Frontend; adapter = Adapter; + printf("adapter: %i\n",adapter); + +// if(adapter==4&&dfd_frontend<=0) { dfd_frontend=fd_frontend; printf("dfd_frontend set to %i\n",dfd_frontend); } frontend = Frontend; subsystemId = cDvbDeviceProbe::GetSubsystemId(adapter, frontend); +// printf("device: %d\n",device); +// printf("subsystemId: %08X\n",subsystemId); +// if(0x13C2300A==subsystemId) { + if(0xD4649022==subsystemId) { +// adap++; +// if(adap==2) + dfd_frontend=fd_frontend; printf("dfd_frontend set to %i\n",dfd_frontend); + } tuneTimeout = 0; lockTimeout = 0; lastTimeoutReport = 0; @@ -414,7 +428,10 @@ cDvbTransponderParameters dtp(Channel->Parameters()); if (Setup.DiSEqC) { if (const cDiseqc *diseqc = Diseqcs.Get(device->CardIndex() + 1, Channel->Source(), Channel->Frequency(), dtp.Polarization(), NULL)) - return diseqc->Commands(); + printf("returning %i\n",Channel->Source()); + return cString::sprintf("%i",Channel->Source()); +// return 0; } else { bool ToneOff = Channel->Frequency() < Setup.LnbSLOF; @@ -765,6 +777,8 @@ { if (!lnbPowerTurnedOn) { CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); // must explicitly turn on LNB power + if(dfd_frontend!=fd_frontend) + CHECK(ioctl(dfd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); // must explicitly turn on LNB power lnbPowerTurnedOn = true; } static cMutex Mutex; @@ -773,6 +787,7 @@ struct dvb_diseqc_master_cmd cmd; const char *CurrentAction = NULL; for (;;) { + printf("dfd_frontend: %i\nfd_frontend: %i\n",dfd_frontend,fd_frontend); cmd.msg_len = sizeof(cmd.msg); cDiseqc::eDiseqcActions da = Diseqc->Execute(&CurrentAction, cmd.msg, &cmd.msg_len, scr, Frequency); if (da == cDiseqc::daNone) @@ -784,8 +799,8 @@ case cDiseqc::daVoltage18: CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); break; case cDiseqc::daMiniA: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_A)); break; case cDiseqc::daMiniB: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_BURST, SEC_MINI_B)); break; - case cDiseqc::daGotoX: HandleGotox(fd_frontend, channel.Source()); break; - case cDiseqc::daCodes: CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); break; + case cDiseqc::daGotoX: HandleGotox(dfd_frontend, channel.Source()); break; + case cDiseqc::daCodes: CHECK(ioctl(dfd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_18)); CHECK(ioctl(dfd_frontend, FE_SET_TONE, SEC_TONE_OFF)); CHECK(ioctl(dfd_frontend, FE_DISEQC_SEND_MASTER_CMD, &cmd)); break; default: esyslog("ERROR: unknown diseqc command %d", da); } } @@ -814,6 +829,10 @@ { CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); CHECK(ioctl(fd_frontend, FE_SET_TONE, SEC_TONE_OFF)); + if(dfd_frontend!=fd_frontend) { + CHECK(ioctl(dfd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); + CHECK(ioctl(dfd_frontend, FE_SET_TONE, SEC_TONE_OFF)); + } } static int GetRequiredDeliverySystem(const cChannel *Channel, const cDvbTransponderParameters *Dtp) @@ -869,13 +888,11 @@ frequency -= diseqc->Lof(); if (diseqc != lastDiseqc || diseqc->IsScr() || \ ((TestDiseqcForGotoXX(diseqc) && (channel.Source() != lastSource )))) { - if (IsBondedMaster()) { + if (IsBondedMaster() || !IsBondedMaster()) { ExecuteDiseqc(diseqc, &frequency); if (frequency == 0) return false; } - else - ResetToneAndVoltage(); lastDiseqc = diseqc; lastSource = channel.Source(); } @@ -900,10 +917,10 @@ tone = SEC_TONE_ON; } int volt = (dtp.Polarization() == 'V' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18; - if (!IsBondedMaster()) { - tone = SEC_TONE_OFF; - volt = SEC_VOLTAGE_13; - } +// if (!IsBondedMaster()) { +// tone = SEC_TONE_OFF; +// volt = SEC_VOLTAGE_13; +// } CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, volt)); CHECK(ioctl(fd_frontend, FE_SET_TONE, tone)); }