]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
linuxdvb: fix bug 2229
authorSascha Kuehndel (InuSasha) <dev@inusasha.de>
Sat, 30 Aug 2014 09:47:27 +0000 (11:47 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 8 Sep 2014 15:56:47 +0000 (17:56 +0200)
change behavior for en50494
- don't use tone
- don't change voltage for tune (this makes the switch)
- skip unneeded test

src/input/mpegts/linuxdvb/linuxdvb_en50494.c
src/input/mpegts/linuxdvb/linuxdvb_lnb.c
src/input/mpegts/linuxdvb/linuxdvb_satconf.c

index 4b1219d7655782df0236d2da43d5952be7f98710..74a1d7d8b488baff5d0aee5c1b4dd149e80863f4 100644 (file)
  *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  *  Open things:
- *    - TODO: collision dectection
- *      when a en50494-command wasn't executed succesful, retry.
- *      delay time is easly random, but in standard is special (complicated) way described (cap. 8).
+ *    - TODO: collision detection
+ *      * compare transport-stream-id from stream with id in config
+ *      * check continuity of the pcr-counter
+ *      * when one point is given -> retry
+ *      * delay time is easily random, but in standard is special (complicated) way described (cap. 8).
  */
 
 #include "tvheadend.h"
@@ -39,7 +41,7 @@
 #define LINUXDVB_EN50494_NOPIN                 256
 
 #define LINUXDVB_EN50494_FRAME                 0xE0
-/* adresses 0x00, 0x10 and 0x11 are possible */
+/* addresses 0x00, 0x10 and 0x11 are possible */
 #define LINUXDVB_EN50494_ADDRESS               0x10
 
 #define LINUXDVB_EN50494_CMD_NORMAL            0x5A
@@ -162,7 +164,7 @@ linuxdvb_en50494_tune
   linuxdvb_en50494_t *le = (linuxdvb_en50494_t*) ld;
   linuxdvb_lnb_t *lnb = sc->lse_lnb;
 
-  /* band & polarisation */
+  /* band & polarization */
   uint8_t  pol  = lnb->lnb_pol(lnb, lm);
   uint8_t  band = lnb->lnb_band(lnb, lm);
   uint32_t freq = lnb->lnb_freq(lnb, lm);
@@ -180,8 +182,8 @@ linuxdvb_en50494_tune
   /* 2 data fields (16bit) */
   uint8_t data1, data2;
   data1  = (le->le_id & 7) << 5;        /* 3bit user-band */
-  data1 |= (le->le_position & 1) << 4;  /* 1bit position (satelitte A(0)/B(1)) */
-  data1 |= (pol & 1) << 3;              /* 1bit polarisation v(0)/h(1) */
+  data1 |= (le->le_position & 1) << 4;  /* 1bit position (satellite A(0)/B(1)) */
+  data1 |= (pol & 1) << 3;              /* 1bit polarization v(0)/h(1) */
   data1 |= (band & 1) << 2;             /* 1bit band lower(0)/upper(1) */
   data1 |= (t >> 8) & 3;                /* 2bit transponder value bit 1-2 */
   data2  = t & 0xFF;                    /* 8bit transponder value bit 3-10 */
index 27a4c78f238d156ebe1f1497e204c7ba0ed7e78c..e3c33d27b8814dcba2cc47a664aad96aa6fd58ef 100644 (file)
@@ -105,6 +105,9 @@ static int
 linuxdvb_lnb_standard_tune
   ( linuxdvb_diseqc_t *ld, dvb_mux_t *lm, linuxdvb_satconf_ele_t *ls, int fd )
 {
+  if (ls->lse_en50494)
+    return 0;
+
   int pol = linuxdvb_lnb_standard_pol((linuxdvb_lnb_t*)ld, lm);
   return linuxdvb_diseqc_set_volt(fd, pol);
 }
index b89ae72d42af7b2a1a7c6bfc34a40f6f6f0d007a..635288ed6bf4b70679e67a92d53680522f9c63f9 100644 (file)
@@ -633,10 +633,12 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
   // TODO: really need to understand whether or not we need to pre configure
   //       and/or re-affirm the switch
 
-  /* Disable tone */
-  if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, SEC_TONE_OFF)) {
-    tvherror("diseqc", "failed to disable tone");
-    return -1;
+  /* Disable tone (en50494 don't use tone) */
+  if (!lse->lse_en50494) {
+    if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, SEC_TONE_OFF)) {
+      tvherror("diseqc", "failed to disable tone");
+      return -1;
+    }
   }
 
   /* Diseqc */  
@@ -660,14 +662,16 @@ linuxdvb_satconf_ele_tune ( linuxdvb_satconf_ele_t *lse )
                               &lse->lse_parent->ls_orbital_pos,
                               &lse->lse_parent->ls_orbital_dir);
 
-  /* Set the tone */
-  b = lse->lse_lnb->lnb_band(lse->lse_lnb, lm);
-  tvhtrace("disqec", "set diseqc tone %s", b ? "on" : "off");
-  if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, b ? SEC_TONE_ON : SEC_TONE_OFF)) {
-    tvherror("diseqc", "failed to set diseqc tone (e=%s)", strerror(errno));
-    return -1;
+  /* Set the tone (en50494 don't use tone) */
+  if (!lse->lse_en50494) {
+    b = lse->lse_lnb->lnb_band(lse->lse_lnb, lm);
+    tvhtrace("disqec", "set diseqc tone %s", b ? "on" : "off");
+    if (ioctl(lfe->lfe_fe_fd, FE_SET_TONE, b ? SEC_TONE_ON : SEC_TONE_OFF)) {
+      tvherror("diseqc", "failed to set diseqc tone (e=%s)", strerror(errno));
+      return -1;
+    }
+    usleep(20000); // Allow LNB to settle before tuning
   }
-  usleep(20000); // Allow LNB to settle before tuning
 
   /* Frontend */
   /* use en50494 tuning frequency, if needed (not channel frequency) */
@@ -701,13 +705,16 @@ linuxdvb_satconf_start_mux
   // Note: basically this ensures the tuning params are acceptable
   //       for the FE, so that if they're not we don't have to wait
   //       for things like rotors and switches
+  //       the en50494 have to skip this test
   if (!lse->lse_lnb)
     return SM_CODE_TUNING_FAILED;
   f = lse->lse_lnb->lnb_freq(lse->lse_lnb, lm);
   if (f == (uint32_t)-1)
     return SM_CODE_TUNING_FAILED;
-  r = linuxdvb_frontend_tune0(lfe, mmi, f);
-  if (r) return r;
+  if (!lse->lse_en50494) {
+    r = linuxdvb_frontend_tune0(lfe, mmi, f);
+    if (r) return r;
+  }
 
   /* Diseqc */
   ls->ls_mmi        = mmi;