summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY.LNBshare6
-rw-r--r--README.LNBshare16
-rw-r--r--config.h2
-rw-r--r--device.c14
-rw-r--r--device.h4
-rw-r--r--dvbdevice.c39
-rw-r--r--dvbdevice.h9
7 files changed, 64 insertions, 26 deletions
diff --git a/HISTORY.LNBshare b/HISTORY.LNBshare
index a0e539f..6f95a45 100644
--- a/HISTORY.LNBshare
+++ b/HISTORY.LNBshare
@@ -29,3 +29,9 @@ Version for VDR 1.4.3
- Rename the patch to include patch version number (vdr-lnb-sharing-0.1.0-1.7.16.patch)
- Write patch version number to log file (if logging is switched on).
- Adept to VDR 1.7.16
+
+
+2010-02-06 Version 0.1.1 for VDR version 1.7.16
+- Fix: If several DVB devices share one LNB, only the first of these devises will send signals like 22kHz. See README.LNBshare for details
+- README.LNBshare: Include warning about 1.3 FF cards with buggy Loop-Through that might result in destruction of LNBP-Chips if the Loop-Through is used
+- Fix: Log file: Numbering of 'LNBs' not connected to a SAT DVB card
diff --git a/README.LNBshare b/README.LNBshare
index 74c4856..1d624bf 100644
--- a/README.LNBshare
+++ b/README.LNBshare
@@ -1,10 +1,17 @@
+Warning
+- At some 1.3 FF-Cards a voltage at the Loop-Through will destroy the LNBP-Chips of these cards. Please check the manual. If you are unsure or your card is affected, don't use the Loop-Through! Even if this patch avoids switching on the voltage in such a case, the patch might be buggy or wrong configured or ...
+
+Required hardware:
+- sat splitter like SVE 2-01 (reichelt.de). Make sure to have a sat splitter with built in diodes preventing any current in case of different voltage on the connected DVB cards.
+
Settings (OSD)
In VDR, if you select Settings -> LNB and have two or more devices that can recieve SAT channels, you can set the 'LNB Nr.' for each of these devices. Note:
- All devices with an identical 'LNB Nr.' share the same LNB
- The patch assumes that a device has always the same number. If you have more than two devices, you must make sure to load the drivers in a given order to make sure that each of the listed devices belongs always to the same card. If during setup, for example, your first DVB-S card is device 2 and your second DVB-S card is device 4 (device 1 and 3 are, for example, DVB-T cards) you must make sure that after reboot these stay the same: your first DVB-S card is device 2 and your second DVB-S card is device 4.
+- Signals (like DiSEqC, 22kHz, Voltage) are only sent by the first device if several devices share the same LNB. VDR will even switch on the LNB Voltage only on the first device. Note: This is not guarantied: If you use a Loop-Through, please see the warning in the README and make sure that the FF Card is the first card.
-DISEQC Support:
-Diseqc is supported, including the feature added in VDR 1.7.13: Added device definitions to the diseqc.conf file format, so that certain satellite positions can be limited to a given list of devices
+DiSEqC Support:
+DiSEqC is supported, including the feature added in VDR 1.7.13: Added device definitions to the diseqc.conf file format, so that certain satellite positions can be limited to a given list of devices
Note: Please ensure in diseqc.conf that all devices sharing one LNB have exactly the same satellite positions. The system will not check this, but, otherwise, the patch will not work correctly. This is not a restriction: obviously, if two devices share the same LNB, they can also receive the same satellite positions.
Primary limit (Setup.PrimaryLimit):
@@ -19,4 +26,7 @@ Note:
- Such intelligent scheduling is generally missing in VDR and would be also useful for 'mixed' systems with DVB-S and DVB-T cards as well as systems in which not all DVB-S cards can receive the same satellites.
- I don't plan to implement this feature. Any volunteers?
-Contact: You find me at http://www.vdr-portal.de , user MarkusE . Please create a new thread in Developer->Patches for any questions or bug reports
+Hompage: http://projects.vdr-developer.org/projects/patch-lnbsharing . Please use this for bug reports. You can also create a new thread in http://www.vdr-portal.de , Developer->Patches for any questions.
+Git: The patch is available in http://projects.vdr-developer.org/git/?p=vdr-patch-lnbsharing.git
+
+License: The same license as for VDR applies. See file COPYING (in VDR sources) for details.
diff --git a/config.h b/config.h
index 39498d2..60d8027 100644
--- a/config.h
+++ b/config.h
@@ -293,7 +293,7 @@ public:
int EmergencyExit;
//ML
- #define LNB_SHARING_VERSION "0.1.0"
+ #define LNB_SHARING_VERSION "0.1.1"
int VerboseLNBlog;
#define MAXDEVICES 16 // Since VDR 1.3.32 we can not #include "device.h" for MAXDEVICES anymore.
// With this workaround a warning will be shown during compilation if
diff --git a/device.c b/device.c
index 5d5f648..c0f7e41 100644
--- a/device.c
+++ b/device.c
@@ -151,6 +151,20 @@ void cDevice::SetLnbNr(void)
device[i]->SetLnbNrFromSetup();
}
}
+
+
+bool cDevice::IsLnbSendSignals(void)
+{
+ for (int i = 0; i < cardIndex; i++) {
+ if (device[i]->IsShareLnb(this) ) {
+ isyslog("Device %d: will not send any signal (like 22kHz) to LNB as device %d will do this", cardIndex+1, i+1);
+ return false;
+ }
+ }
+ isyslog("Device %d: will send signals (like 22kHz) to LNB nr. = %d ", cardIndex+1, LnbNr() );
+ return true;
+}
+
//ML-Ende
int cDevice::NextCardIndex(int n)
diff --git a/device.h b/device.h
index da6d095..7df3cb5 100644
--- a/device.h
+++ b/device.h
@@ -168,6 +168,10 @@ public:
///< Called after changes in setup
///< Read Setup.CardUsesLNBnr, write value to member variable of this class
///< Only implemented in dvbdevice, other devices don't use LNBs
+ bool IsLnbSendSignals(void);
+ ///< If several devices share the same LNB, only the first of these
+ ///< must send signals (like 22 kHz) to the LNB
+ ///< check, whepher this device must send these signals
virtual int LnbNr(void) const { return ( cardIndex + 1 ) * -1; };
///< Number of LNB. This is -cardIndex for all non-DVB devices.
///< So, there will be no LNB conflicts for non-DVB devices.
diff --git a/dvbdevice.c b/dvbdevice.c
index ea46b49..ab9496a 100644
--- a/dvbdevice.c
+++ b/dvbdevice.c
@@ -261,6 +261,7 @@ private:
int adapter, frontend;
int tuneTimeout;
int lockTimeout;
+ bool lnbSendSignals; // LNB Sharing
time_t lastTimeoutReport;
fe_delivery_system frontendType;
cChannel channel;
@@ -273,7 +274,7 @@ private:
bool SetFrontend(void);
virtual void Action(void);
public:
- cDvbTuner(int Device, int Fd_Frontend, int Adapter, int Frontend, fe_delivery_system FrontendType);
+ cDvbTuner(int Device, int Fd_Frontend, int Adapter, int Frontend, fe_delivery_system FrontendType, bool LnbSendSignals);
virtual ~cDvbTuner();
const cChannel *GetTransponder(void) const { return &channel; }
bool IsTunedTo(const cChannel *Channel) const;
@@ -281,8 +282,9 @@ public:
bool Locked(int TimeoutMs = 0);
};
-cDvbTuner::cDvbTuner(int Device, int Fd_Frontend, int Adapter, int Frontend, fe_delivery_system FrontendType)
+cDvbTuner::cDvbTuner(int Device, int Fd_Frontend, int Adapter, int Frontend, fe_delivery_system FrontendType, bool LnbSendSignals) // LNB Sharing
{
+ lnbSendSignals = LnbSendSignals; // LNB Sharing
device = Device;
fd_frontend = Fd_Frontend;
adapter = Adapter;
@@ -294,7 +296,7 @@ cDvbTuner::cDvbTuner(int Device, int Fd_Frontend, int Adapter, int Frontend, fe_
diseqcCommands = NULL;
tunerStatus = tsIdle;
if (frontendType == SYS_DVBS || frontendType == SYS_DVBS2)
- CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); // must explicitly turn on LNB power
+ if(lnbSendSignals) CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); // must explicitly turn on LNB power // LNB Sharing
SetDescription("tuner on frontend %d/%d", adapter, frontend);
Start();
}
@@ -394,6 +396,7 @@ bool cDvbTuner::SetFrontend(void)
if (Setup.DiSEqC) {
cDiseqc *diseqc = Diseqcs.Get(device, channel.Source(), channel.Frequency(), dtp.Polarization());
if (diseqc) {
+ if(lnbSendSignals) { // LNB sharing
if (diseqc->Commands() && (!diseqcCommands || strcmp(diseqcCommands, diseqc->Commands()) != 0)) {
cDiseqc::eDiseqcActions da;
for (char *CurrentAction = NULL; (da = diseqc->Execute(&CurrentAction)) != cDiseqc::daNone; ) {
@@ -421,6 +424,7 @@ bool cDvbTuner::SetFrontend(void)
}
diseqcCommands = diseqc->Commands();
}
+ } // LNB sharing
frequency -= diseqc->Lof();
}
else {
@@ -438,9 +442,11 @@ bool cDvbTuner::SetFrontend(void)
frequency -= Setup.LnbFrequHi;
tone = SEC_TONE_ON;
}
- int volt = (dtp.Polarization() == 'v' || dtp.Polarization() == 'V' || dtp.Polarization() == 'r' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
- CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, volt));
- CHECK(ioctl(fd_frontend, FE_SET_TONE, tone));
+ if(lnbSendSignals) { // LNB sharing
+ int volt = (dtp.Polarization() == 'v' || dtp.Polarization() == 'V' || dtp.Polarization() == 'r' || dtp.Polarization() == 'R') ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18;
+ CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, volt));
+ CHECK(ioctl(fd_frontend, FE_SET_TONE, tone));
+ } // LNB sharing
}
frequency = abs(frequency); // Allow for C-band, where the frequency is less than the LOF
@@ -683,14 +689,6 @@ cDvbDevice::cDvbDevice(int Adapter, int Frontend)
// The DVR device (will be opened and closed as needed):
fd_dvr = -1;
-
-//ML
- lnbState = -1;
- SetLnbNrFromSetup();
- lnbSource = NULL;
-//ML-Ende
-
-
// We only check the devices that must be present - the others will be checked before accessing them://XXX
@@ -726,7 +724,16 @@ cDvbDevice::cDvbDevice(int Adapter, int Frontend)
else
p = (char *)"unknown modulations";
isyslog("frontend %d/%d provides %s with %s (\"%s\")", adapter, frontend, DeliverySystems[frontendType], p, frontendInfo.name);
- dvbTuner = new cDvbTuner(CardIndex() + 1, fd_frontend, adapter, frontend, frontendType);
+
+//ML
+ isyslog("LNB-sharing: patch version %s", LNB_SHARING_VERSION);
+ lnbState = -1;
+ SetLnbNrFromSetup();
+ lnbSource = NULL;
+//ML-Ende
+
+
+ dvbTuner = new cDvbTuner(CardIndex() + 1, fd_frontend, adapter, frontend, frontendType, lnbSendSignals);
}
}
else
@@ -1061,8 +1068,8 @@ bool cDvbDevice::GetTSPacket(uchar *&Data)
void cDvbDevice::SetLnbNrFromSetup(void)
{
lnbNr = Setup.CardUsesLnbNr[CardIndex()];
- isyslog("LNB-sharing: patch version %s", LNB_SHARING_VERSION);
isyslog("LNB-sharing: setting device %d to use LNB %d", CardIndex() + 1, lnbNr);
+ lnbSendSignals = IsLnbSendSignals();
}
bool cDvbDevice::IsShareLnb(const cDevice *Device)
diff --git a/dvbdevice.h b/dvbdevice.h
index 446ea48..be3ee13 100644
--- a/dvbdevice.h
+++ b/dvbdevice.h
@@ -133,19 +133,16 @@ private:
// cDiseqc *lnbSource; // can not #include "diseqc.h". A workaround follows:
int *lnbSource; // [DiSEqC] DiSEqC-Source
int lnbNr; // Number of LNB used
-// LNB Sharing-Ende
+ bool lnbSendSignals; // false if this device must not send signals to the LNB (like 22 kHz, ...).
public:
int *LnbSource(void) { return lnbSource; };
- virtual int LnbNr(void) const { if(ProvidesSource(cSource::stSat)) return lnbNr; return CardIndex() * -1;};
+ virtual int LnbNr(void) const { if(ProvidesSource(cSource::stSat)) return lnbNr; return (CardIndex() + 1) * -1;};
virtual void SetLnbNrFromSetup(void);
-
-public:
virtual bool IsLnbConflict(const cChannel *Channel);
virtual bool IsShareLnb(const cDevice *Device);
-
// LNB Sharing Ende
-
+
// Common Interface facilities: