]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Class1: Add Class1TCFMinRunECMMod config option to allow higher speeds with ECM
authorAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:58:14 +0000 (12:58 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Wed, 26 Sep 2007 12:58:14 +0000 (12:58 +0000)
From Lee' commits:
| commit d4dfaeb90a6fbb512d0d05738fb910f67d5c57b0
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Mon Aug 27 19:09:15 2007 +0000
|
|              /*
|               * When using ECM it may not be wise to fail TCF so easily
|               * as retransmissions can compensate for data corruption.
|               * For example, if there is a regular disturbance in the
|               * audio every second that will cause TCFs to fail, but where
|               * the majority of the TCF data is "clean", then it will
|               * likely be better to pass TCF more easily at the faster
|               * rate rather than letting things slow down where the
|               * disturbance will only cause slower retransmissions (and
|               * more of them, too).
|               */

and
| commit 76d3485e376a854b20ee4ff61d7fffb4c45b790d
| Author: Lee Howard <faxguy@howardsilvan.com>
| Date:   Tue Aug 28 16:29:28 2007 +0000
|
|   Don't let a divide-by-zero condition happen due to silly configuration.

faxd/Class1Recv.c++
faxd/ModemConfig.c++
faxd/ModemConfig.h
man/hylafax-config.4f

index 2f3a4d72718ddead4c869166706ec94d35f37029..d8294b874e02c8a4414d2ac10d44a4a68c52bca7 100644 (file)
@@ -426,6 +426,20 @@ Class1Modem::recvTraining()
         */
        u_int fullrun = params.transferSize(TCF_DURATION);
        u_int minrun = params.transferSize(conf.class1TCFMinRun);
+       if (params.ec != EC_DISABLE && conf.class1TCFMinRunECMMod > 0) {
+           /*
+            * When using ECM it may not be wise to fail TCF so easily
+            * as retransmissions can compensate for data corruption.
+            * For example, if there is a regular disturbance in the
+            * audio every second that will cause TCFs to fail, but where
+            * the majority of the TCF data is "clean", then it will
+            * likely be better to pass TCF more easily at the faster
+            * rate rather than letting things slow down where the
+            * disturbance will only cause slower retransmissions (and
+            * more of them, too).
+            */
+           minrun /= conf.class1TCFMinRunECMMod;
+       }
        nonzero = (100*nonzero) / (n == 0 ? 1 : n);
        protoTrace("RECV: TCF %u bytes, %u%% non-zero, %u zero-run",
            n, nonzero, zerorun);
index f1743f16e222f087394ec697bf75b62c8adf643c..761b447670c5b3b3e274e77eb1bade67aa92f522 100644 (file)
@@ -211,6 +211,7 @@ static struct {
 { "class1recvidenttimer",      &ModemConfig::class1RecvIdentTimer,  TIMER_T1 },
 { "class1tcfmaxnonzero",       &ModemConfig::class1TCFMaxNonZero,   10 },
 { "class1tcfminrun",           &ModemConfig::class1TCFMinRun,       (2*TCF_DURATION)/3 },
+{ "class1tcfminrunecmmod",     &ModemConfig::class1TCFMinRunECMMod, 2 },
 { "class1tmconnectdelay",      &ModemConfig::class1TMConnectDelay,  0 },
 { "class1ecmframesize",                &ModemConfig::class1ECMFrameSize,    256 },
 { "class1pagelengthsupport",   &ModemConfig::class1PageLengthSupport, LN_ALL },
index b52637e61772a7d7e09903d9b55d7726f546744d..4e5fc9516d7e200bcc4dec0ed443264d610e41b3 100644 (file)
@@ -163,6 +163,7 @@ public:
     u_int      class1RecvIdentTimer;   // timeout receiving initial identity
     u_int      class1TCFMaxNonZero;    // non-zero threshold for TCF check
     u_int      class1TCFMinRun;        // min length of zero run for TCF check
+    u_int      class1TCFMinRunECMMod;  // modify min length in ECM by this factor
     u_int      class1TMConnectDelay;   // delay (ms) after +FTM CONNECT
     u_int      class1ECMFrameSize;     // ECM frame size for transmission
     u_int      class1PageLengthSupport;// page length support
index 8bce159caf44210af720729ac615be881b6f8c8f..9f61df36a5dcd00358d016c8e1d4ab158f777881 100644 (file)
@@ -322,6 +322,7 @@ Class1MsgRecvHackCmd        string  \s-1""\s+1      Class 1/1.0: command to avoid +FCERROR be
 Class1TCFRecvHackCmd   string  \s-1""\s+1      Class 1/1.0: command to avoid +FCERROR before TCF
 Class1TCFMaxNonZero    integer \s-110\s+1      Class 1/1.0: max% of non-zero data in good \s-1TCF\s+1
 Class1TCFMinRun        integer \s-11000\s+1    Class 1/1.0: minimum zero run in good \s-1TCF\s+1
+Class1TCFMinRunECMMod  integer \s-12\s+1       Class 1/1.0: modify minimum zero run in ECM by this factor
 Class1TCFRecvTimeout   integer \s-14500\s+1    Class 1/1.0: max wait (ms) for \s-1TCF\s+1
 Class1TMConnectDelay   integer \s-10\s+1       Class 1/1.0: delay between +FTM CONNECT and data transmission
 Class1SwitchingCmd     string  \s-1AT+FRS=7\s+1        Class 1/1.0: command to ensure silence after HDLC reception
@@ -2662,7 +2663,18 @@ an acceptable received
 This value should be specified according to a 1.5 second
 transmission of zero data (i.e. it should be between 0 and 1500).
 See also
-.BR Class1TCFMaxNonZero .
+.B Class1TCFMaxNonZero
+and
+.BR Class1TCFMinRunECMMod .
+.TP
+.B Class1TCFMinRunECMMod
+The factor by which
+.B Class1TCFMinRun
+should be modified in the case of an ECM session.  As ECM protocol
+allows retransmissions it is commonly faster to accept a lesser-quality
+data stream and the subsequent retransmisisons than it is to allow
+the communication speed to slow down (where the demodulation may still
+not produce an ideal data stream, anyway).
 .TP
 .B Class1TCFRecvHackCmd
 If receive failures occur due to +FCERROR just prior to TCF data