===================================================================
RCS file: ./RCS/channels.c
retrieving revision 2.3
diff -u -b -r2.3 ./channels.c
--- ./channels.c	2008/07/06 12:59:41	2.3
+++ ./channels.c	2008/12/06 10:15:49
@@ -21,114 +21,87 @@
 // --- Channel Parameter Maps ------------------------------------------------
 
 const tChannelParameterMap InversionValues[] = {
-  {   0, DVBFE_INVERSION_OFF, trNOOP("off") },
-  {   1, DVBFE_INVERSION_ON,  trNOOP("on") },
-  { 999, DVBFE_INVERSION_AUTO },
+  {   0, INVERSION_OFF, trNOOP("off") },
+  {   1, INVERSION_ON,  trNOOP("on") },
+  { 999, INVERSION_AUTO },
   { -1 }
   };
 
 const tChannelParameterMap BandwidthValues[] = {
-  {   5, DVBFE_BANDWIDTH_5_MHZ, "5 MHz" },
-  {   6, DVBFE_BANDWIDTH_6_MHZ, "6 MHz" },
-  {   7, DVBFE_BANDWIDTH_7_MHZ, "7 MHz" },
-  {   8, DVBFE_BANDWIDTH_8_MHZ, "8 MHz" },
-  { 999, DVBFE_BANDWIDTH_AUTO },
+  {   6, BANDWIDTH_6_MHZ, "6 MHz" },
+  {   7, BANDWIDTH_7_MHZ, "7 MHz" },
+  {   8, BANDWIDTH_8_MHZ, "8 MHz" },
+  { 999, BANDWIDTH_AUTO },
   { -1 }
   };
 
 const tChannelParameterMap CoderateValues[] = {
-  {   0, DVBFE_FEC_NONE, trNOOP("none") },
-  {  12, DVBFE_FEC_1_2,  "1/2" },
-  {  13, DVBFE_FEC_1_3,  "1/3" },
-  {  14, DVBFE_FEC_1_4,  "1/4" },
-  {  23, DVBFE_FEC_2_3,  "2/3" },
-  {  25, DVBFE_FEC_2_5,  "2/5" },
-  {  34, DVBFE_FEC_3_4,  "3/4" },
-  {  35, DVBFE_FEC_3_5,  "3/5" },
-  {  45, DVBFE_FEC_4_5,  "4/5" },
-  {  56, DVBFE_FEC_5_6,  "5/6" },
-  {  67, DVBFE_FEC_6_7,  "6/7" },
-  {  78, DVBFE_FEC_7_8,  "7/8" },
-  {  89, DVBFE_FEC_8_9,  "8/9" },
-  { 910, DVBFE_FEC_9_10, "9/10" },
-  { 999, DVBFE_FEC_AUTO },
+  {   0, FEC_NONE, trNOOP("none") },
+  {  12, FEC_1_2,  "1/2" },
+  {  23, FEC_2_3,  "2/3" },
+  {  34, FEC_3_4,  "3/4" },
+  {  35, FEC_3_5,  "3/5" },
+  {  45, FEC_4_5,  "4/5" },
+  {  56, FEC_5_6,  "5/6" },
+  {  67, FEC_6_7,  "6/7" },
+  {  78, FEC_7_8,  "7/8" },
+  {  89, FEC_8_9,  "8/9" },
+  { 910, FEC_9_10, "9/10" },
+  { 999, FEC_AUTO },
   { -1 }
   };
 
 const tChannelParameterMap ModulationValues[] = {
-  {   0, DVBFE_MOD_NONE,    trNOOP("none") },
-  {   4, DVBFE_MOD_QAM4,    "QAM4" },
-  {  16, DVBFE_MOD_QAM16,   "QAM16" },
-  {  32, DVBFE_MOD_QAM32,   "QAM32" },
-  {  64, DVBFE_MOD_QAM64,   "QAM64" },
-  { 128, DVBFE_MOD_QAM128,  "QAM128" },
-  { 256, DVBFE_MOD_QAM256,  "QAM256" },
-  { 512, DVBFE_MOD_QAM512,  "QAM512" },
-  {1024, DVBFE_MOD_QAM1024, "QAM1024" },
-  {   1, DVBFE_MOD_BPSK,    "BPSK" },
-  {   2, DVBFE_MOD_QPSK,    "QPSK" },
-  {   3, DVBFE_MOD_OQPSK,   "OQPSK" },
-  {   5, DVBFE_MOD_8PSK,    "8PSK" },
-  {   6, DVBFE_MOD_16APSK,  "16APSK" },
-  {   7, DVBFE_MOD_32APSK,  "32APSK" },
-  {   8, DVBFE_MOD_OFDM,    "OFDM" },
-  {   9, DVBFE_MOD_COFDM,   "COFDM" },
-  {  10, DVBFE_MOD_VSB8,    "VSB8" },
-  {  11, DVBFE_MOD_VSB16,   "VSB16" },
-  { 998, DVBFE_MOD_QAMAUTO, "QAMAUTO" },
-  { 999, DVBFE_MOD_AUTO },
+  {  16, QAM_16,   "QAM16" },
+  {  32, QAM_32,   "QAM32" },
+  {  64, QAM_64,   "QAM64" },
+  { 128, QAM_128,  "QAM128" },
+  { 256, QAM_256,  "QAM256" },
+  {   2, QPSK,     "QPSK" },
+  {   5, PSK_8,    "8PSK" },
+  {   6, APSK_16,  "16APSK" },
+  {  10, VSB_8,    "VSB8" },
+  {  11, VSB_16,   "VSB16" },
+  { 998, QAM_AUTO, "QAMAUTO" },
   { -1 }
   };
 
 const tChannelParameterMap SystemValues[] = {
-  {   0, DVBFE_DELSYS_DVBS,  "DVB-S" },
-  {   1, DVBFE_DELSYS_DVBS2, "DVB-S2" },
+  {   0, SYS_DVBS,  "DVB-S" },
+  {   1, SYS_DVBS2, "DVB-S2" },
   { -1 }
   };
 
 const tChannelParameterMap TransmissionValues[] = {
-  {   2, DVBFE_TRANSMISSION_MODE_2K, "2K" },
-  {   4, DVBFE_TRANSMISSION_MODE_4K, "4K" },
-  {   8, DVBFE_TRANSMISSION_MODE_8K, "8K" },
-  { 999, DVBFE_TRANSMISSION_MODE_AUTO },
+  {   2, TRANSMISSION_MODE_2K, "2K" },
+  {   8, TRANSMISSION_MODE_8K, "8K" },
+  { 999, TRANSMISSION_MODE_AUTO },
   { -1 }
   };
 
 const tChannelParameterMap GuardValues[] = {
-  {   4, DVBFE_GUARD_INTERVAL_1_4,  "1/4" },
-  {   8, DVBFE_GUARD_INTERVAL_1_8,  "1/8" },
-  {  16, DVBFE_GUARD_INTERVAL_1_16, "1/16" },
-  {  32, DVBFE_GUARD_INTERVAL_1_32, "1/32" },
-  { 999, DVBFE_GUARD_INTERVAL_AUTO },
+  {   4, GUARD_INTERVAL_1_4,  "1/4" },
+  {   8, GUARD_INTERVAL_1_8,  "1/8" },
+  {  16, GUARD_INTERVAL_1_16, "1/16" },
+  {  32, GUARD_INTERVAL_1_32, "1/32" },
+  { 999, GUARD_INTERVAL_AUTO },
   { -1 }
   };
 
 const tChannelParameterMap HierarchyValues[] = {
-  {   0, DVBFE_HIERARCHY_OFF, trNOOP("off") },
-  {   1, DVBFE_HIERARCHY_ON,  trNOOP("on") },
-  { 999, DVBFE_HIERARCHY_AUTO },
-  { -1 }
-  };
-
-const tChannelParameterMap AlphaValues[] = {
-  {   0, 0 },
-  {   1, DVBFE_ALPHA_1 },
-  {   2, DVBFE_ALPHA_2 },
-  {   4, DVBFE_ALPHA_4 },
-  { -1 }
-  };
-
-const tChannelParameterMap PriorityValues[] = {
-  {   0, DVBFE_STREAM_PRIORITY_HP, trNOOP("high") },
-  {   1, DVBFE_STREAM_PRIORITY_LP, trNOOP("low") },
+  {   0, HIERARCHY_NONE, trNOOP("off") },
+  {   1, HIERARCHY_1,  trNOOP("1") },
+  {   2, HIERARCHY_2,  trNOOP("2") },
+  {   4, HIERARCHY_4,  trNOOP("4") },
+  { 999, HIERARCHY_AUTO },
   { -1 }
   };
 
 const tChannelParameterMap RollOffValues[] = {
-  {   0, DVBFE_ROLLOFF_UNKNOWN },
-  {  20, DVBFE_ROLLOFF_20, "0.20" },
-  {  25, DVBFE_ROLLOFF_25, "0.25" },
-  {  35, DVBFE_ROLLOFF_35, "0.35" },
+  {   0, ROLLOFF_AUTO, trNOOP("auto") },
+  {  20, ROLLOFF_20, "0.20" },
+  {  25, ROLLOFF_25, "0.25" },
+  {  35, ROLLOFF_35, "0.35" },
   { -1 }
   };
 
@@ -217,18 +190,16 @@
   provider = strdup("");
   portalName = strdup("");
   memset(&__BeginData__, 0, (char *)&__EndData__ - (char *)&__BeginData__);
-  inversion    = DVBFE_INVERSION_AUTO;
-  bandwidth    = DVBFE_BANDWIDTH_AUTO;
-  coderateH    = DVBFE_FEC_AUTO;
-  coderateL    = DVBFE_FEC_AUTO;
-  modulation   = DVBFE_MOD_AUTO;
-  system       = DVBFE_DELSYS_DVBS;
-  transmission = DVBFE_TRANSMISSION_MODE_AUTO;
-  guard        = DVBFE_GUARD_INTERVAL_AUTO;
-  hierarchy    = DVBFE_HIERARCHY_AUTO;
-  alpha        = 0;
-  priority     = DVBFE_STREAM_PRIORITY_HP;
-  rollOff      = DVBFE_ROLLOFF_UNKNOWN;
+  inversion    = INVERSION_AUTO;
+  bandwidth    = BANDWIDTH_AUTO;
+  coderateH    = FEC_AUTO;
+  coderateL    = FEC_AUTO;
+  modulation   = QPSK;
+  system       = SYS_DVBS;
+  transmission = TRANSMISSION_MODE_AUTO;
+  guard        = GUARD_INTERVAL_AUTO;
+  hierarchy    = HIERARCHY_AUTO;
+  rollOff      = ROLLOFF_AUTO;
   modification = CHANNELMOD_NONE;
   schedule     = NULL;
   linkChannels = NULL;
@@ -335,8 +306,6 @@
      transmission = Channel->transmission;
      guard        = Channel->guard;
      hierarchy    = Channel->hierarchy;
-     alpha        = Channel->alpha;
-     priority     = Channel->priority;
      rollOff      = Channel->rollOff;
      }
 }
@@ -394,9 +363,9 @@
   return true;
 }
 
-bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CoderateH, int CoderateL, int Guard, int Transmission, int Alpha, int Priority)
+bool cChannel::SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CoderateH, int CoderateL, int Guard, int Transmission)
 {
-  if (source != Source || frequency != Frequency || bandwidth != Bandwidth || modulation != Modulation || hierarchy != Hierarchy || coderateH != CoderateH || coderateL != CoderateL || guard != Guard || transmission != Transmission || alpha != Alpha || priority != Priority) {
+  if (source != Source || frequency != Frequency || bandwidth != Bandwidth || modulation != Modulation || hierarchy != Hierarchy || coderateH != CoderateH || coderateL != CoderateL || guard != Guard || transmission != Transmission) {
      cString OldTransponderData = TransponderDataToString();
      source = Source;
      frequency = Frequency;
@@ -407,8 +376,6 @@
      coderateL = CoderateL;
      guard = Guard;
      transmission = Transmission;
-     alpha = Alpha;
-     priority = Priority;
      schedule = NULL;
      if (Number()) {
         dsyslog("changing transponder data of channel %d from %s to %s", Number(), *OldTransponderData, *TransponderDataToString());
@@ -670,7 +637,6 @@
   char *q = buffer;
   *q = 0;
   ST(" S ")  q += sprintf(q, "%c", polarization);
-  ST("  T")  q += PrintParameter(q, 'A', MapToUser(alpha, AlphaValues));
   ST("  T")  q += PrintParameter(q, 'B', MapToUser(bandwidth, BandwidthValues));
   ST("CST")  q += PrintParameter(q, 'C', MapToUser(coderateH, CoderateValues));
   ST("  T")  q += PrintParameter(q, 'D', MapToUser(coderateL, CoderateValues));
@@ -678,7 +644,6 @@
   ST("CST")  q += PrintParameter(q, 'I', MapToUser(inversion, InversionValues));
   ST("CST")  q += PrintParameter(q, 'M', MapToUser(modulation, ModulationValues));
   ST(" S ")  q += PrintParameter(q, 'O', MapToUser(rollOff, RollOffValues));
-  ST("  T")  q += PrintParameter(q, 'P', MapToUser(priority, PriorityValues));
   ST(" S ")  q += PrintParameter(q, 'S', MapToUser(system, SystemValues));
   ST("  T")  q += PrintParameter(q, 'T', MapToUser(transmission, TransmissionValues));
   ST("  T")  q += PrintParameter(q, 'Y', MapToUser(hierarchy, HierarchyValues));
@@ -701,11 +666,18 @@
   return NULL;
 }
 
+static const char *SkipDigits(const char *s)
+{
+  while (*++s && isdigit(*s))
+        ;
+  return s;
+}
+
 bool cChannel::StringToParameters(const char *s)
 {
   while (s && *s) {
         switch (toupper(*s)) {
-          case 'A': s = ParseParameter(s, alpha, AlphaValues); break;
+          case 'A': s = SkipDigits(s); break; // for compatibility with the "multiproto" approach - may be removed in future versions
           case 'B': s = ParseParameter(s, bandwidth, BandwidthValues); break;
           case 'C': s = ParseParameter(s, coderateH, CoderateValues); break;
           case 'D': s = ParseParameter(s, coderateL, CoderateValues); break;
@@ -714,14 +686,14 @@
           case 'I': s = ParseParameter(s, inversion, InversionValues); break;
           case 'L': polarization = *s++; break;
           case 'M': s = ParseParameter(s, modulation, ModulationValues); break;
-          case 'Z':// for compatibility with the original DVB-S2 patch - may be removed in future versions
           case 'O': s = ParseParameter(s, rollOff, RollOffValues); break;
-          case 'P': s = ParseParameter(s, priority, PriorityValues); break;
+          case 'P': s = SkipDigits(s); break; // for compatibility with the "multiproto" approach - may be removed in future versions
           case 'R': polarization = *s++; break;
           case 'S': s = ParseParameter(s, system, SystemValues); break;
           case 'T': s = ParseParameter(s, transmission, TransmissionValues); break;
           case 'V': polarization = *s++; break;
           case 'Y': s = ParseParameter(s, hierarchy, HierarchyValues); break;
+          case 'Z': s = SkipDigits(s); break; // for compatibility with the original DVB-S2 patch - may be removed in future versions
           default: esyslog("ERROR: unknown parameter key '%c'", *s);
                    return false;
           }
===================================================================
RCS file: ./RCS/channels.h
retrieving revision 2.3
diff -u -b -r2.3 ./channels.h
--- ./channels.h	2008/07/06 11:49:37	2.3
+++ ./channels.h	2008/11/22 13:35:52
@@ -66,8 +66,6 @@
 extern const tChannelParameterMap TransmissionValues[];
 extern const tChannelParameterMap GuardValues[];
 extern const tChannelParameterMap HierarchyValues[];
-extern const tChannelParameterMap AlphaValues[];
-extern const tChannelParameterMap PriorityValues[];
 extern const tChannelParameterMap RollOffValues[];
 
 struct tChannelID {
@@ -149,8 +147,6 @@
   int transmission;
   int guard;
   int hierarchy;
-  int alpha;
-  int priority;
   int rollOff;
   int __EndData__;
   int modification;
@@ -209,8 +205,6 @@
   int Transmission(void) const { return transmission; }
   int Guard(void) const { return guard; }
   int Hierarchy(void) const { return hierarchy; }
-  int Alpha(void) const { return alpha; }
-  int Priority(void) const { return priority; }
   int RollOff(void) const { return rollOff; }
   const cLinkChannels* LinkChannels(void) const { return linkChannels; }
   const cChannel *RefChannel(void) const { return refChannel; }
@@ -223,7 +217,7 @@
   void CopyTransponderData(const cChannel *Channel);
   bool SetSatTransponderData(int Source, int Frequency, char Polarization, int Srate, int CoderateH, int Modulation, int System, int RollOff);
   bool SetCableTransponderData(int Source, int Frequency, int Modulation, int Srate, int CoderateH);
-  bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission, int Alpha, int Priority);
+  bool SetTerrTransponderData(int Source, int Frequency, int Bandwidth, int Modulation, int Hierarchy, int CodeRateH, int CodeRateL, int Guard, int Transmission);
   void SetId(int Nid, int Tid, int Sid, int Rid = 0);
   void SetName(const char *Name, const char *ShortName, const char *Provider);
   void SetPortalName(const char *PortalName);
===================================================================
RCS file: ./RCS/dvbdevice.c
retrieving revision 2.4
diff -u -b -r2.4 ./dvbdevice.c
--- ./dvbdevice.c	2008/07/06 13:58:56	2.4
+++ ./dvbdevice.c	2008/12/06 13:30:38
@@ -76,7 +76,7 @@
   int tuneTimeout;
   int lockTimeout;
   time_t lastTimeoutReport;
-  dvbfe_delsys frontendType;
+  fe_delivery_system frontendType;
   cChannel channel;
   const char *diseqcCommands;
   eTunerStatus tunerStatus;
@@ -87,14 +87,14 @@
   bool SetFrontend(void);
   virtual void Action(void);
 public:
-  cDvbTuner(int Fd_Frontend, int CardIndex, dvbfe_delsys FrontendType);
+  cDvbTuner(int Fd_Frontend, int CardIndex, fe_delivery_system FrontendType);
   virtual ~cDvbTuner();
   bool IsTunedTo(const cChannel *Channel) const;
   void Set(const cChannel *Channel, bool Tune);
   bool Locked(int TimeoutMs = 0);
   };
 
-cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, dvbfe_delsys FrontendType)
+cDvbTuner::cDvbTuner(int Fd_Frontend, int CardIndex, fe_delivery_system FrontendType)
 {
   fd_frontend = Fd_Frontend;
   cardIndex = CardIndex;
@@ -104,7 +104,7 @@
   lastTimeoutReport = 0;
   diseqcCommands = NULL;
   tunerStatus = tsIdle;
-  if (frontendType & (DVBFE_DELSYS_DVBS | DVBFE_DELSYS_DVBS2))
+  if (frontendType == SYS_DVBS || frontendType == SYS_DVBS2)
      CHECK(ioctl(fd_frontend, FE_SET_VOLTAGE, SEC_VOLTAGE_13)); // must explicitly turn on LNB power
   SetDescription("tuner on device %d", cardIndex + 1);
   Start();
@@ -127,7 +127,6 @@
   char Type = **cSource::ToString(Channel->Source());
 #define ST(s, p) if (strchr(s, Type)) if (channel.p() != Channel->p()) return false;
   // Polarization is already checked as part of the Transponder.
-  ST("  T", Alpha);
   ST("  T", Bandwidth);
   ST("CST", CoderateH);
   ST("  T", CoderateL);
@@ -135,8 +134,8 @@
   ST("CST", Inversion);
   ST("CST", Modulation);
   ST(" S ", RollOff);
-  ST("  T", Priority);
   ST(" S ", System);
+  ST("CS ", Srate);
   ST("  T", Transmission);
   ST("  T", Hierarchy);
   return true;
@@ -192,10 +191,27 @@
 
 bool cDvbTuner::SetFrontend(void)
 {
-  dvbfe_params Frontend;
+#define MAXFRONTENDCMDS 16
+#define SETCMD(c, d) { Frontend[CmdSeq.num].cmd = (c);\
+                       Frontend[CmdSeq.num].u.data = (d);\
+                       if (CmdSeq.num++ > MAXFRONTENDCMDS) {\
+                          esyslog("ERROR: too many tuning commands on frontend %d", cardIndex);\
+                          return false;\
+                          }\
+                     }
+  dtv_property Frontend[MAXFRONTENDCMDS];
   memset(&Frontend, 0, sizeof(Frontend));
+  dtv_properties CmdSeq;
+  memset(&CmdSeq, 0, sizeof(CmdSeq));
+  CmdSeq.props = Frontend;
+  SETCMD(DTV_CLEAR, 0);
+  if (ioctl(fd_frontend, FE_SET_PROPERTY, &CmdSeq) < 0) {
+     esyslog("ERROR: frontend %d: %m", cardIndex);
+     return false;
+     }
+  CmdSeq.num = 0;
 
-  if (frontendType & (DVBFE_DELSYS_DVBS | DVBFE_DELSYS_DVBS2)) {
+  if (frontendType == SYS_DVBS || frontendType == SYS_DVBS2) {
      unsigned int frequency = channel.Frequency();
      if (Setup.DiSEqC) {
         cDiseqc *diseqc = Diseqcs.Get(channel.Source(), channel.Frequency(), channel.Polarization());
@@ -249,48 +265,56 @@
         }
      frequency = abs(frequency); // Allow for C-band, where the frequency is less than the LOF
 
-     Frontend.delivery = dvbfe_delsys(channel.System());
-     Frontend.frequency = frequency * 1000UL;
-     Frontend.inversion = fe_spectral_inversion_t(channel.Inversion());
-     if (Frontend.delivery == DVBFE_DELSYS_DVBS) {
-        Frontend.delsys.dvbs.modulation = dvbfe_modulation(channel.Modulation());
-        Frontend.delsys.dvbs.symbol_rate = channel.Srate() * 1000UL;
-        Frontend.delsys.dvbs.fec = dvbfe_fec(channel.CoderateH());
+     // DVB-S/DVB-S2 (common parts)
+     SETCMD(DTV_DELIVERY_SYSTEM, fe_delivery_system_t(channel.System()));
+     SETCMD(DTV_FREQUENCY, frequency * 1000UL);
+     SETCMD(DTV_MODULATION, fe_modulation_t(channel.Modulation()));
+     SETCMD(DTV_SYMBOL_RATE, channel.Srate() * 1000UL);
+     SETCMD(DTV_INNER_FEC, fe_code_rate_t(channel.CoderateH()));
+     SETCMD(DTV_INVERSION, fe_spectral_inversion_t(channel.Inversion()));
+     if (fe_delivery_system_t(channel.System()) == SYS_DVBS2) {
+        if (frontendType == SYS_DVBS2) {
+           // DVB-S2
+           SETCMD(DTV_PILOT, PILOT_AUTO);
+           SETCMD(DTV_ROLLOFF, fe_rolloff_t(channel.RollOff()));
+           }
+        else {
+           esyslog("ERROR: frontend %d doesn't provide DVB-S2", cardIndex);
+           return false;
+           }
         }
      else {
-        Frontend.delsys.dvbs2.modulation = dvbfe_modulation(channel.Modulation());
-        Frontend.delsys.dvbs2.symbol_rate = channel.Srate() * 1000UL;
-        Frontend.delsys.dvbs2.fec = dvbfe_fec(channel.CoderateH());
-        Frontend.delsys.dvbs2.rolloff = dvbfe_rolloff(channel.RollOff());
+        // DVB-S
+        SETCMD(DTV_ROLLOFF, ROLLOFF_35); // DVB-S always has a ROLLOFF of 0.35
         }
 
      tuneTimeout = DVBS_TUNE_TIMEOUT;
      lockTimeout = DVBS_LOCK_TIMEOUT;
      }
-  else if (frontendType & DVBFE_DELSYS_DVBC) {
-     Frontend.delivery = DVBFE_DELSYS_DVBC;
-     Frontend.frequency = FrequencyToHz(channel.Frequency());
-     Frontend.inversion = fe_spectral_inversion_t(channel.Inversion());
-     Frontend.delsys.dvbc.symbol_rate = channel.Srate() * 1000UL;
-     Frontend.delsys.dvbc.fec = dvbfe_fec(channel.CoderateH());
-     Frontend.delsys.dvbc.modulation = dvbfe_modulation(channel.Modulation());
+  else if (frontendType == SYS_DVBC_ANNEX_AC || frontendType == SYS_DVBC_ANNEX_B) {
+     // DVB-C
+     SETCMD(DTV_DELIVERY_SYSTEM, frontendType);
+     SETCMD(DTV_FREQUENCY, FrequencyToHz(channel.Frequency()));
+     SETCMD(DTV_INVERSION, fe_spectral_inversion_t(channel.Inversion()));
+     SETCMD(DTV_SYMBOL_RATE, channel.Srate() * 1000UL);
+     SETCMD(DTV_INNER_FEC, fe_code_rate_t(channel.CoderateH()));
+     SETCMD(DTV_MODULATION, fe_modulation_t(channel.Modulation()));
 
      tuneTimeout = DVBC_TUNE_TIMEOUT;
      lockTimeout = DVBC_LOCK_TIMEOUT;
      }
-  else if (frontendType & DVBFE_DELSYS_DVBT) {
-     Frontend.delivery = DVBFE_DELSYS_DVBT;
-     Frontend.frequency = FrequencyToHz(channel.Frequency());
-     Frontend.inversion = fe_spectral_inversion_t(channel.Inversion());
-     Frontend.delsys.dvbt.bandwidth = dvbfe_bandwidth(channel.Bandwidth());
-     Frontend.delsys.dvbt.code_rate_HP = dvbfe_fec(channel.CoderateH());
-     Frontend.delsys.dvbt.code_rate_LP = dvbfe_fec(channel.CoderateL());
-     Frontend.delsys.dvbt.constellation = dvbfe_modulation(channel.Modulation());
-     Frontend.delsys.dvbt.transmission_mode = dvbfe_transmission_mode(channel.Transmission());
-     Frontend.delsys.dvbt.guard_interval = dvbfe_guard_interval(channel.Guard());
-     Frontend.delsys.dvbt.hierarchy = dvbfe_hierarchy(channel.Hierarchy());
-     Frontend.delsys.dvbt.alpha = dvbfe_alpha(channel.Alpha());
-     Frontend.delsys.dvbt.priority = dvbfe_stream_priority(channel.Priority());
+  else if (frontendType == SYS_DVBT) {
+     // DVB-T
+     SETCMD(DTV_DELIVERY_SYSTEM, frontendType);
+     SETCMD(DTV_FREQUENCY, FrequencyToHz(channel.Frequency()));
+     SETCMD(DTV_INVERSION, fe_spectral_inversion_t(channel.Inversion()));
+     SETCMD(DTV_BANDWIDTH_HZ, fe_bandwidth_t(channel.Bandwidth()));
+     SETCMD(DTV_CODE_RATE_HP, fe_code_rate_t(channel.CoderateH()));
+     SETCMD(DTV_CODE_RATE_LP, fe_code_rate_t(channel.CoderateL()));
+     SETCMD(DTV_MODULATION, fe_modulation_t(channel.Modulation()));
+     SETCMD(DTV_TRANSMISSION_MODE, fe_transmit_mode_t(channel.Transmission()));
+     SETCMD(DTV_GUARD_INTERVAL, fe_guard_interval_t(channel.Guard()));
+     SETCMD(DTV_HIERARCHY, fe_hierarchy_t(channel.Hierarchy()));
 
      tuneTimeout = DVBT_TUNE_TIMEOUT;
      lockTimeout = DVBT_LOCK_TIMEOUT;
@@ -299,8 +323,8 @@
      esyslog("ERROR: attempt to set channel with unknown DVB frontend type");
      return false;
      }
-  CHECK(ioctl(fd_frontend, DVBFE_SET_DELSYS, &Frontend.delivery));
-  if (ioctl(fd_frontend, DVBFE_SET_PARAMS, &Frontend) < 0) {
+  SETCMD(DTV_TUNE, 0);
+  if (ioctl(fd_frontend, FE_SET_PROPERTY, &CmdSeq) < 0) {
      esyslog("ERROR: frontend %d: %m", cardIndex);
      return false;
      }
@@ -372,13 +396,22 @@
 int cDvbDevice::setTransferModeForDolbyDigital = 1;
 
 const char *DeliverySystems[] = {
-  "DVBS",
+  "UNDEFINED",
+  "DVB-C",
+  "DVB-C",
+  "DVB-T",
   "DSS",
-  "DVBS2",
-  "DVBC",
-  "DVBT",
-  "DVBH",
+  "DVB-S",
+  "DVB-S2",
+  "DVB-H",
+  "ISDBT",
+  "ISDBS",
+  "ISDBC",
   "ATSC",
+  "ATSCMH",
+  "DMBTH",
+  "CMMB",
+  "DAB",
   NULL
   };
 
@@ -386,7 +419,7 @@
 {
   ciAdapter = NULL;
   dvbTuner = NULL;
-  frontendType = DVBFE_DELSYS_DUMMY;
+  frontendType = SYS_UNDEFINED;
   numProvidedSystems = 0;
   spuDecoder = NULL;
   digitalAudio = false;
@@ -449,26 +482,24 @@
   // We only check the devices that must be present - the others will be checked before accessing them://XXX
 
   if (fd_frontend >= 0) {
-     if (ioctl(fd_frontend, DVBFE_GET_DELSYS, &frontendType) >= 0) {
-        const char **DeliverySystem = DeliverySystems;
-        cString ds;
-        for (int i = 0; i < 32; i++) {
-            if (frontendType & (1u << i)) {
-               numProvidedSystems++;
-               if (*DeliverySystem)
-                  ds = cString::sprintf("%s %s", *ds ? *ds : "", *DeliverySystem);
-               else
-                  esyslog("ERROR: unknown delivery system %d", i);
+     if (ioctl(fd_frontend, FE_GET_INFO, &frontendInfo) >= 0) {
+        switch (frontendInfo.type) {
+          case FE_QPSK: frontendType = (frontendInfo.caps & FE_CAN_2ND_GEN_MODULATION) ? SYS_DVBS2 : SYS_DVBS; break;
+          case FE_OFDM: frontendType = SYS_DVBT; break;
+          case FE_QAM:  frontendType = SYS_DVBC_ANNEX_AC; break;
+          case FE_ATSC: frontendType = SYS_ATSC; break;
+          default: esyslog("ERROR: unknown frontend type %d on device %d", frontendInfo.type, CardIndex() + 1);
                }
-            if (*DeliverySystem)
-               DeliverySystem++;
-            }
-        if (*ds)
-           isyslog("device %d provides:%s", CardIndex() + 1, *ds);
-        dvbTuner = new cDvbTuner(fd_frontend, CardIndex(), frontendType);
         }
      else
         LOG_ERROR;
+     if (frontendType != SYS_UNDEFINED) {
+        numProvidedSystems++;
+        if (frontendType == SYS_DVBS2)
+           numProvidedSystems++;
+        isyslog("device %d provides %s (\"%s\")", CardIndex() + 1, DeliverySystems[frontendType], frontendInfo.name);
+        dvbTuner = new cDvbTuner(fd_frontend, CardIndex(), frontendType);
+        }
      }
   else
      esyslog("ERROR: can't open DVB device %d", n);
@@ -789,9 +820,9 @@
 {
   int type = Source & cSource::st_Mask;
   return type == cSource::stNone
-      || type == cSource::stCable && (frontendType & DVBFE_DELSYS_DVBC)
-      || type == cSource::stSat   && (frontendType & (DVBFE_DELSYS_DVBS | DVBFE_DELSYS_DVBS2))
-      || type == cSource::stTerr  && (frontendType & DVBFE_DELSYS_DVBT);
+      || type == cSource::stCable && (frontendType == SYS_DVBC_ANNEX_AC || frontendType == SYS_DVBC_ANNEX_B)
+      || type == cSource::stSat   && (frontendType == SYS_DVBS || frontendType == SYS_DVBS2)
+      || type == cSource::stTerr  && (frontendType == SYS_DVBT);
 }
 
 bool cDvbDevice::ProvidesTransponder(const cChannel *Channel) const
===================================================================
RCS file: ./RCS/dvbdevice.h
retrieving revision 2.2
diff -u -b -r2.2 ./dvbdevice.h
--- ./dvbdevice.h	2008/06/01 09:48:04	2.2
+++ ./dvbdevice.h	2008/12/06 13:31:12
@@ -15,8 +15,8 @@
 #include "device.h"
 #include "dvbspu.h"
 
-#if DVB_API_VERSION != 3 || DVB_API_VERSION_MINOR != 3
-#error VDR requires Linux DVB driver API version 3.3!
+#if DVB_API_VERSION != 5 || DVB_API_VERSION_MINOR != 0
+#error VDR requires Linux DVB driver API version 5.0!
 #endif
 
 #define MAXDVBDEVICES  8
@@ -35,8 +35,9 @@
          ///< Must be called before accessing any DVB functions.
          ///< \return True if any devices are available.
 private:
-  dvbfe_delsys frontendType;
+  dvb_frontend_info frontendInfo;
   int numProvidedSystems;
+  fe_delivery_system frontendType;
   int fd_osd, fd_audio, fd_video, fd_dvr, fd_stc, fd_ca;
 protected:
   virtual void MakePrimaryDevice(bool On);
===================================================================
RCS file: ./RCS/menu.c
retrieving revision 2.2
diff -u -b -r2.2 ./menu.c
--- ./menu.c	2008/05/01 14:37:24	2.2
+++ ./menu.c	2008/11/22 15:18:00
@@ -252,8 +252,6 @@
   ST("  T")  Add(new cMenuEditMapItem( tr("Transmission"), &data.transmission, TransmissionValues));
   ST("  T")  Add(new cMenuEditMapItem( tr("Guard"),        &data.guard,        GuardValues));
   ST("  T")  Add(new cMenuEditMapItem( tr("Hierarchy"),    &data.hierarchy,    HierarchyValues));
-  ST("  T")  Add(new cMenuEditMapItem( tr("Alpha"),        &data.alpha,        AlphaValues));
-  ST("  T")  Add(new cMenuEditMapItem( tr("Priority"),     &data.priority,     PriorityValues));
   ST(" S ")  Add(new cMenuEditMapItem( tr("Rolloff"),      &data.rollOff,      RollOffValues));
 
   SetCurrent(Get(current));
===================================================================
RCS file: ./RCS/nit.c
retrieving revision 2.1
diff -u -b -r2.1 ./nit.c
--- ./nit.c	2008/04/12 12:06:40	2.1
+++ ./nit.c	2008/11/22 15:35:40
@@ -127,13 +127,13 @@
                  int Frequency = Frequencies[0] = BCD2INT(sd->getFrequency()) / 100;
                  static char Polarizations[] = { 'h', 'v', 'l', 'r' };
                  char Polarization = Polarizations[sd->getPolarization()];
-                 static int CodeRates[] = { DVBFE_FEC_NONE, DVBFE_FEC_1_2, DVBFE_FEC_2_3, DVBFE_FEC_3_4, DVBFE_FEC_5_6, DVBFE_FEC_7_8, DVBFE_FEC_8_9, DVBFE_FEC_3_5, DVBFE_FEC_4_5, DVBFE_FEC_9_10, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_NONE };
+                 static int CodeRates[] = { FEC_NONE, FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_8_9, FEC_3_5, FEC_4_5, FEC_9_10, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_NONE };
                  int CodeRate = CodeRates[sd->getFecInner()];
-                 static int Modulations[] = { DVBFE_MOD_AUTO, DVBFE_MOD_QPSK, DVBFE_MOD_8PSK, DVBFE_MOD_QAM16 };
+                 static int Modulations[] = { QPSK, PSK_8, QAM_16 };
                  int Modulation = Modulations[sd->getModulationType()];
-                 int System = sd->getModulationSystem() ? DVBFE_DELSYS_DVBS2 : DVBFE_DELSYS_DVBS;
-                 static int RollOffs[] = { DVBFE_ROLLOFF_35, DVBFE_ROLLOFF_25, DVBFE_ROLLOFF_20, DVBFE_ROLLOFF_UNKNOWN };
-                 int RollOff = sd->getModulationSystem() ? RollOffs[sd->getRollOff()] : DVBFE_ROLLOFF_UNKNOWN;
+                 int System = sd->getModulationSystem() ? SYS_DVBS2 : SYS_DVBS;
+                 static int RollOffs[] = { ROLLOFF_35, ROLLOFF_25, ROLLOFF_20, ROLLOFF_AUTO };
+                 int RollOff = sd->getModulationSystem() ? RollOffs[sd->getRollOff()] : ROLLOFF_AUTO;
                  int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10;
                  if (ThisNIT >= 0) {
                     for (int n = 0; n < NumFrequencies; n++) {
@@ -181,9 +181,9 @@
                  int Source = cSource::FromData(cSource::stCable);
                  int Frequency = Frequencies[0] = BCD2INT(sd->getFrequency()) / 10;
                  //XXX FEC_outer???
-                 static int CodeRates[] = { DVBFE_FEC_NONE, DVBFE_FEC_1_2, DVBFE_FEC_2_3, DVBFE_FEC_3_4, DVBFE_FEC_5_6, DVBFE_FEC_7_8, DVBFE_FEC_8_9, DVBFE_FEC_3_5, DVBFE_FEC_4_5, DVBFE_FEC_9_10, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_NONE };
+                 static int CodeRates[] = { FEC_NONE, FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_8_9, FEC_3_5, FEC_4_5, FEC_9_10, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_AUTO, FEC_NONE };
                  int CodeRate = CodeRates[sd->getFecInner()];
-                 static int Modulations[] = { DVBFE_MOD_NONE, DVBFE_MOD_QAM16, DVBFE_MOD_QAM32, DVBFE_MOD_QAM64, DVBFE_MOD_QAM128, DVBFE_MOD_QAM256, QAM_AUTO };
+                 static int Modulations[] = { QPSK, QAM_16, QAM_32, QAM_64, QAM_128, QAM_256, QAM_AUTO };
                  int Modulation = Modulations[min(sd->getModulation(), 6)];
                  int SymbolRate = BCD2INT(sd->getSymbolRate()) / 10;
                  if (ThisNIT >= 0) {
@@ -231,22 +231,19 @@
                  SI::TerrestrialDeliverySystemDescriptor *sd = (SI::TerrestrialDeliverySystemDescriptor *)d;
                  int Source = cSource::FromData(cSource::stTerr);
                  int Frequency = Frequencies[0] = sd->getFrequency() * 10;
-                 static int Bandwidths[] = { DVBFE_BANDWIDTH_8_MHZ, DVBFE_BANDWIDTH_7_MHZ, DVBFE_BANDWIDTH_6_MHZ, DVBFE_BANDWIDTH_5_MHZ, DVBFE_BANDWIDTH_AUTO, DVBFE_BANDWIDTH_AUTO, DVBFE_BANDWIDTH_AUTO, DVBFE_BANDWIDTH_AUTO };
+                 static int Bandwidths[] = { BANDWIDTH_8_MHZ, BANDWIDTH_7_MHZ, BANDWIDTH_6_MHZ, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO, BANDWIDTH_AUTO };
                  int Bandwidth = Bandwidths[sd->getBandwidth()];
-                 static int Constellations[] = { DVBFE_MOD_QPSK, DVBFE_MOD_QAM16, DVBFE_MOD_QAM64, DVBFE_MOD_AUTO };
+                 static int Constellations[] = { QPSK, QAM_16, QAM_64, QAM_AUTO };
                  int Constellation = Constellations[sd->getConstellation()];
-                 static int CodeRates[] = { DVBFE_FEC_1_2, DVBFE_FEC_2_3, DVBFE_FEC_3_4, DVBFE_FEC_5_6, DVBFE_FEC_7_8, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO, DVBFE_FEC_AUTO };
+                 static int Hierarchies[] = { HIERARCHY_NONE, HIERARCHY_1, HIERARCHY_2, HIERARCHY_4, HIERARCHY_AUTO, HIERARCHY_AUTO, HIERARCHY_AUTO, HIERARCHY_AUTO };
+                 int Hierarchy = Hierarchies[sd->getHierarchy()];
+                 static int CodeRates[] = { FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8, FEC_AUTO, FEC_AUTO, FEC_AUTO };
                  int CodeRateHP = CodeRates[sd->getCodeRateHP()];
                  int CodeRateLP = CodeRates[sd->getCodeRateLP()];
-                 static int GuardIntervals[] = { DVBFE_GUARD_INTERVAL_1_32, DVBFE_GUARD_INTERVAL_1_16, DVBFE_GUARD_INTERVAL_1_8, DVBFE_GUARD_INTERVAL_1_4 };
+                 static int GuardIntervals[] = { GUARD_INTERVAL_1_32, GUARD_INTERVAL_1_16, GUARD_INTERVAL_1_8, GUARD_INTERVAL_1_4 };
                  int GuardInterval = GuardIntervals[sd->getGuardInterval()];
-                 static int TransmissionModes[] = { DVBFE_TRANSMISSION_MODE_2K, DVBFE_TRANSMISSION_MODE_8K, DVBFE_TRANSMISSION_MODE_4K, DVBFE_TRANSMISSION_MODE_AUTO };
+                 static int TransmissionModes[] = { TRANSMISSION_MODE_2K, TRANSMISSION_MODE_8K, TRANSMISSION_MODE_AUTO, TRANSMISSION_MODE_AUTO };
                  int TransmissionMode = TransmissionModes[sd->getTransmissionMode()];
-                 static int Priorities[] = { DVBFE_STREAM_PRIORITY_LP, DVBFE_STREAM_PRIORITY_HP };
-                 int Priority = Priorities[sd->getPriority()];
-                 static int Alphas[] = { 0, DVBFE_ALPHA_1, DVBFE_ALPHA_2, DVBFE_ALPHA_4 };
-                 int Alpha = Alphas[sd->getHierarchy() & 3];
-                 int Hierarchy = Alpha ? DVBFE_HIERARCHY_ON : DVBFE_HIERARCHY_OFF;
                  if (ThisNIT >= 0) {
                     for (int n = 0; n < NumFrequencies; n++) {
                         if (ISTRANSPONDER(Frequencies[n] / 1000000, Transponder())) {
@@ -272,14 +269,14 @@
                                   }
                               }
                            if (ISTRANSPONDER(Frequency / 1000000, Transponder())) // only modify channels if we're actually receiving this transponder
-                              Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode, Alpha, Priority);
+                              Channel->SetTerrTransponderData(Source, Frequency, Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode);
                            }
                         }
                     if (!found) {
                        for (int n = 0; n < NumFrequencies; n++) {
                            cChannel *Channel = new cChannel;
                            Channel->SetId(ts.getOriginalNetworkId(), ts.getTransportStreamId(), 0, 0);
-                           if (Channel->SetTerrTransponderData(Source, Frequencies[n], Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode, Alpha, Priority))
+                           if (Channel->SetTerrTransponderData(Source, Frequencies[n], Bandwidth, Constellation, Hierarchy, CodeRateHP, CodeRateLP, GuardInterval, TransmissionMode))
                               EITScanner.AddTransponder(Channel);
                            else
                               delete Channel;
