Rotor patch for 1.5.12

Message ID 47868F30.3000505@gmx.de
State New
Headers

Commit Message

Reinhard Nissl Jan. 10, 2008, 9:33 p.m. UTC
  Hi,

lucian orasanu schrieb:

> it is changed after patch with function above and in
> menu.c at line 304 is expecting another function like
> this: 
> 
> SChannel->cChannel::SetSatTransponderData(RotorPos->R_Code(),Frequenz,Pol,Symbolrate,FEC_AUTO);
> 
> so i modified this line in menu.c like this:
> 
> SChannel->cChannel::SetSatTransponderData(RotorPos->R_Code(),Frequenz,Pol,Symbolrate,Symbolrate,Symbolrate,Symbolrate,Symbolrate);

Try changing it to:

SChannel->cChannel::SetSatTransponderData(RotorPos->R_Code(),Frequenz,Pol,Symbolrate,DVBFE_FEC_AUTO,DVBFE_MOD_AUTO,DVBFE_DELSYS_DVBS,DVBFE_ROLLOFF_UNKNOWN);

You'll need to apply the attached VDR patch instead of the one
included with vdr-rotor.

Please keep in mind that I cannot test this patch. The suggested
line above will only support DVB-S. For DVB-S2 and H.264 support,
a lot more needs to be changed.

Bye.
  

Comments

Ales Jurik Jan. 13, 2008, 8:06 p.m. UTC | #1
On Thursday 10 January 2008, Reinhard Nissl wrote:
> Hi,
>
> lucian orasanu schrieb:
> > it is changed after patch with function above and in
> > menu.c at line 304 is expecting another function like
> > this:
> >
> > SChannel->cChannel::SetSatTransponderData(RotorPos->R_Code(),Frequenz,Pol
> >,Symbolrate,FEC_AUTO);
> >
> > so i modified this line in menu.c like this:
> >
> > SChannel->cChannel::SetSatTransponderData(RotorPos->R_Code(),Frequenz,Pol
> >,Symbolrate,Symbolrate,Symbolrate,Symbolrate,Symbolrate);
>
> Try changing it to:
>
> SChannel->cChannel::SetSatTransponderData(RotorPos->R_Code(),Frequenz,Pol,S
>ymbolrate,DVBFE_FEC_AUTO,DVBFE_MOD_AUTO,DVBFE_DELSYS_DVBS,DVBFE_ROLLOFF_UNKN
>OWN);
>
> You'll need to apply the attached VDR patch instead of the one
> included with vdr-rotor.
>

Hi,

I've tested it, it seems that it works - but I have motor behind the switch 
(port D of 4port) and in some cases the dish doesn't went back to east (with 
SS1, old driver, old rotor, vdr-1.5.12 no such problem detected). In that 
case I have to switch to channel which is not behind portD and then back to 
portD and the dish begin to move. I'm using gotoX functionality.

I'm using for testing: 
- Debian Lenny
- TT S2-3200
- HH120
- vdr-1.5.13 patched by 
vdr-1.5.12-dvbs2-h264-syncearly-framespersec-audioindexer-fielddetection-speedup.diff,
vdr-1.5.12-speedup-fix1.diff and vdr-1.5.12-speedup-fix2.diff.
- rotor version vdr-rotor-0.1.4-vdr1.5.7.tgz patched by 
Rotor-0.1.4-vdr1.5.10.diff and vdr-1.5.12-dvbs2-h264-other-rotor.diff and 
with changes of SChannel->cChannel::SetSatTransponderData proposed above by 
Reinhard.

Reinhard, if you agree I'm ready to cooperate in testing.

Ales

> Please keep in mind that I cannot test this patch. The suggested
> line above will only support DVB-S. For DVB-S2 and H.264 support,
> a lot more needs to be changed.
>
> Bye.
  

Patch

--- ../vdr-1.5.12-dvbs2-other/device.h	2007-10-21 11:21:52.000000000 +0200
+++ device.h	2008-01-10 22:09:12.000000000 +0100
@@ -23,6 +23,7 @@ 
 #include "spu.h"
 #include "thread.h"
 #include "tools.h"
+#include <linux/dvb/frontend.h>
 
 #define MAXDEVICES         16 // the maximum number of devices in the system
 #define MAXPIDHANDLES      64 // the maximum number of different PIDs per device
@@ -261,6 +266,7 @@  public:
   virtual bool HasProgramme(void);
          ///< Returns true if the device is currently showing any programme to
          ///< the user, either through replaying or live.
+  virtual bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd) {return false;}
 
 // PID handle facilities
 
--- ../vdr-1.5.12-dvbs2-other/dvbdevice.c	2008-01-01 22:55:18.000000000 +0100
+++ dvbdevice.c	2008-01-10 22:13:39.000000000 +0100
@@ -71,6 +71,7 @@  static int DvbOpen(const char *Name, int
 class cDvbTuner : public cThread {
 private:
   enum eTunerStatus { tsIdle, tsSet, tsTuned, tsLocked };
+  bool SendDiseqc;
   int fd_frontend;
   int cardIndex;
   int tuneTimeout;
@@ -83,6 +84,7 @@  private:
   cMutex mutex;
   cCondVar locked;
   cCondVar newSet;
+  dvb_diseqc_master_cmd diseqc_cmd;
   bool GetFrontendStatus(fe_status_t &Status, int TimeoutMs = 0);
   bool SetFrontend(void);
   virtual void Action(void);
@@ -91,12 +93,14 @@  public:
   virtual ~cDvbTuner();
   bool IsTunedTo(const cChannel *Channel) const;
   void Set(const cChannel *Channel, bool Tune);
+  bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd);
   bool Locked(int TimeoutMs = 0);
   };
 
 cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, dvbfe_delsys FrontendType)
 {
   fd_frontend = Fd_Frontend;
+  SendDiseqc = false;
   cardIndex = CardIndex;
   frontendType = FrontendType;
   tuneTimeout = 0;
@@ -145,6 +149,17 @@  bool cDvbTuner::Locked(int TimeoutMs)
   return tunerStatus >= tsLocked;
 }
 
+bool cDvbTuner::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
+{
+  cMutexLock MutexLock(&mutex);
+  if (!(frontendType & (DVBFE_DELSYS_DVBS | DVBFE_DELSYS_DVBS2)) || SendDiseqc)
+    return false;
+  diseqc_cmd=cmd;
+  SendDiseqc=true;
+  newSet.Broadcast();
+  return true;
+}
+
 bool cDvbTuner::GetFrontendStatus(fe_status_t &Status, int TimeoutMs)
 {
   if (TimeoutMs) {
@@ -348,6 +363,10 @@  void cDvbTuner::Action(void)
         if (GetFrontendStatus(NewStatus, 10))
            Status = NewStatus;
         cMutexLock MutexLock(&mutex);
+        if (SendDiseqc) {
+           CHECK(ioctl(fd_frontend, FE_DISEQC_SEND_MASTER_CMD, &diseqc_cmd));
+           SendDiseqc=false;
+           }
         switch (tunerStatus) {
           case tsIdle:
                break;
@@ -918,6 +950,11 @@  bool cDvbDevice::HasLock(int TimeoutMs)
   return dvbTuner ? dvbTuner->Locked(TimeoutMs) : false;
 }
 
+bool cDvbDevice::SendDiseqcCmd(dvb_diseqc_master_cmd cmd)
+{
+  return dvbTuner->SendDiseqcCmd(cmd);
+}
+
 int cDvbDevice::GetAudioChannelDevice(void)
 {
   if (HasDecoder()) {
--- ../vdr-1.5.12-dvbs2-other/dvbdevice.h	2008-01-01 22:55:18.000000000 +0100
+++ dvbdevice.h	2008-01-10 22:09:12.000000000 +0100
@@ -66,11 +67,13 @@  public:
   virtual bool SetChannelDevice(const cChannel *Channel, bool LiveView);
 public:
   virtual bool HasLock(int TimeoutMs = 0);
+  virtual bool SendDiseqcCmd(dvb_diseqc_master_cmd cmd);
 
 // PID handle facilities