Hylafax Developers Mailing List Archives

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

[hylafax-devel] Re: New Feature Contribution: V.34 fax



Here it is.

I have added V.34 fax in hylafax and also corrected Error Correction Mode.

I do not know how to add the modification in CVS, so  I attach the diff files
using base code PVS March 9, 02:00pm and let you include it in CVS.

I have tested it in Class1, Class2 and 2.0 and it looks fine.

The differents modified are :
/faxd/Class2.c++
/faxd/Class2.h
/faxd/Class20.c++
/faxd/Class2Send.c++
/faxd/FaxMachineInfo.c++
/faxd/FaxModem.c++
/faxd/FaxRequest.c++
/faxd/ModemConfig.c++
/man/sendfax.1
/man/sendq.4f
/sendfax/sendfax.c++
/util/Class2Params.c++
/util/Class2Params.h
/util/SendFaxJob.c++
/util/class2.h
/util/recvstats.sh.in
/util/xferfaxstats.sh.in


Guillaume

(See attached file: diff_ml_00030914EcmV34)






Dmitry Bely <dbely@mail.ru> on 03/03/2000 01:09:50 PM
To:   hylafax-devel@hylafax.org
cc:   Joel D Peshkin/USA/Conexant@CNXT (bcc: Guillaume Legoupil/USA/Conexant)
Subject:  [hylafax-devel] Re: New Feature Contribution



joel.peshkin@conexant.com writes:

>    V34fax is effectively a fater fax modulation standardized by the ITU in
1996
> and based on a modulation similar to V34 data.  Essentially, it provides twice
> the speed of a 14400 speed fax modulation.  Until now, fax machines
implementing
> this have been rather scarce, but the higher end machines shipping now from
many
> manufacturers now support this and this is likely to hit the consumer space
> rather soon.   The link below points to a fax vendor's site with some
> explanation. (I hate to try to speak for an industry :-)  Many of the pages I
> found when I did this search were in Japanese.
>
> http://www.tcl.memec.com/Conexant/v34fax.htm

Joel,

It's possibly a bit of offtopic here, but which Rockwell chipsets are
supposed to support V34fax? Also, is there any Rockwell chipset,
supporting ECM (T.30 Annex A) in Class 2.0 mode? If yes, have you tested
this feature with Hylafax? Was the result acceptable?

Hope to hear from you soon,
Dmitry



diff -uNr mainline.000309.14/faxd/Class2.c++ mainline.000309.14EcmV34/faxd/Class2.c++
--- mainline.000309.14/faxd/Class2.c++	Sun Jun 13 00:41:01 1999
+++ mainline.000309.14EcmV34/faxd/Class2.c++	Fri Mar 10 18:42:43 2000
@@ -111,6 +111,13 @@
 	return (false);
     }
     traceModemParams();
+    /* 
+     * Because V.34 fax use a V.8 negociation, we have to enable pre-dial DIS command hack
+     */ 
+    if(modemParams.br > BR_ALL_NO_V34) {
+      modemSupports("V.34, force pre-dial DIS command hack");
+      ddisCmd = disCmd;
+    }
     /*
      * Check to see if the modem supports copy quality checking.
      * If the modem is capable, then enable it using the configured
@@ -314,7 +321,7 @@
 	 * nonsense; should log bogus stuff also.
 	 */
 	params.vr = fxmin(params.vr, (u_int) VR_FINE);
-	params.br = fxmin(params.br, (u_int) BR_14400);
+	params.br = fxmin(params.br, (u_int) BR_33600);
 	params.wd = fxmin(params.wd, (u_int) WD_864);
 	params.ln = fxmin(params.ln, (u_int) LN_INF);
 	params.df = fxmin(params.df, (u_int) DF_2DMMR);
diff -uNr mainline.000309.14/faxd/Class2.h mainline.000309.14EcmV34/faxd/Class2.h
--- mainline.000309.14/faxd/Class2.h	Sun Jun 13 00:41:01 1999
+++ mainline.000309.14EcmV34/faxd/Class2.h	Fri Mar 10 11:19:54 2000
@@ -43,6 +43,7 @@
     fxStr	dccCmd;			// set configuration parameters command
     fxStr	dccQueryCmd;		// modem capabilities query command
     fxStr	disCmd;			// set session parameters command
+    fxStr	ddisCmd;	       	// set ses. params. command before dial
     fxStr	cigCmd;			// set polling ID string command
     fxStr	splCmd;			// set polling request command
     fxStr	nrCmd;			// negotiation message reporting control
diff -uNr mainline.000309.14/faxd/Class20.c++ mainline.000309.14EcmV34/faxd/Class20.c++
--- mainline.000309.14/faxd/Class20.c++	Sun Jun 13 00:41:01 1999
+++ mainline.000309.14EcmV34/faxd/Class20.c++	Fri Mar 10 11:18:37 2000
@@ -48,6 +48,7 @@
     setupDefault(lidCmd,	conf.class2LIDCmd,	"AT+FLI");
     setupDefault(dccCmd,	conf.class2DCCCmd,	"AT+FCC");
     setupDefault(disCmd,	conf.class2DISCmd,	"AT+FIS");
+    setupDefault(ddisCmd,	conf.class2DISCmd,	"");
     setupDefault(cigCmd,	conf.class2CIGCmd,	"AT+FPI");
     setupDefault(splCmd,	conf.class2SPLCmd,	"AT+FSP");
     setupDefault(ptsCmd,	conf.class2PTSCmd,	"AT+FPS");
diff -uNr mainline.000309.14/faxd/Class2Send.c++ mainline.000309.14EcmV34/faxd/Class2Send.c++
--- mainline.000309.14/faxd/Class2Send.c++	Sun Jun 13 00:41:01 1999
+++ mainline.000309.14EcmV34/faxd/Class2Send.c++	Fri Mar 10 16:39:47 2000
@@ -59,8 +59,8 @@
 	    Class2Params::bitRateNames[req.minsp], cmdFailed);
 	return (false);
     }
-    if (conf.class2DDISCmd != "") {
-	if (!class2Cmd(conf.class2DDISCmd, dis)) {
+    if (ddisCmd != "") {
+	if (!class2Cmd(ddisCmd, dis)) {
 	    emsg = fxStr::format("Unable to setup session parameters "
 		"prior to call%s", cmdFailed);
 	    return (false);
diff -uNr mainline.000309.14/faxd/FaxMachineInfo.c++ mainline.000309.14EcmV34/faxd/FaxMachineInfo.c++
--- mainline.000309.14/faxd/FaxMachineInfo.c++	Sun Jun 13 00:41:02 1999
+++ mainline.000309.14EcmV34/faxd/FaxMachineInfo.c++	Thu Mar  9 15:25:50 2000
@@ -152,7 +152,7 @@
 #define	N(a)		(sizeof (a) / sizeof (a[0]))
 
 static const char* brnames[] =
-   { "2400", "4800", "7200", "9600", "12000", "14400" };
+   { "2400", "4800", "7200", "9600", "12000", "14400", "16800", "19200", "21600", "24000", "26400", "28800", "31200", "33600" };
 #define	NBR	N(brnames)
 static const char* stnames[] =
    { "0ms", "5ms", "10ms/5ms", "10ms",
@@ -339,7 +339,7 @@
     putDecimal(buf, "maxPageWidth", isLocked(WD), maxPageWidth);
     putDecimal(buf, "maxPageLength", isLocked(LN), maxPageLength);
     putString(buf, "maxSignallingRate", isLocked(BR),
-	brnames[fxmin(maxSignallingRate, BR_14400)]);
+	brnames[fxmin(maxSignallingRate, BR_33600)]);
     putString(buf, "minScanlineTime", isLocked(ST),
 	stnames[fxmin(minScanlineTime, ST_40MS)]);
     putString(buf, "remoteCSI", false, csi);
diff -uNr mainline.000309.14/faxd/FaxModem.c++ mainline.000309.14EcmV34/faxd/FaxModem.c++
--- mainline.000309.14/faxd/FaxModem.c++	Sun Jun 13 00:41:03 1999
+++ mainline.000309.14EcmV34/faxd/FaxModem.c++	Thu Mar  9 15:26:23 2000
@@ -279,7 +279,7 @@
 u_int
 FaxModem::getBestSignallingRate() const
 {
-    return bestBit(modemParams.br, BR_14400, BR_2400);
+    return bestBit(modemParams.br, BR_33600, BR_2400);
 }
 
 /*
@@ -365,7 +365,7 @@
 u_int
 FaxModem::getBestECM() const
 {
-    return bestBit(modemParams.ec, EC_DISABLE, EC_ECLFULL);
+    return bestBit(modemParams.ec, EC_ECLFULL, EC_DISABLE);
 }
 
 /*
diff -uNr mainline.000309.14/faxd/FaxRequest.c++ mainline.000309.14EcmV34/faxd/FaxRequest.c++
--- mainline.000309.14/faxd/FaxRequest.c++	Sun Jun 13 00:41:03 1999
+++ mainline.000309.14EcmV34/faxd/FaxRequest.c++	Fri Mar 10 15:15:18 2000
@@ -286,7 +286,7 @@
 	case H_PRIORITY:	usrpri = atoi(tag); break;
 	case H_SCHEDPRI:	pri = atoi(tag); break;
 	case H_MINSP:		minsp = tag[0] - '0'; break;
-	case H_DESIREDBR:	desiredbr = tag[0] - '0'; break;
+	case H_DESIREDBR:	desiredbr = atoi(tag); break;
 	case H_DESIREDST:	desiredst = tag[0] - '0'; break;
 	case H_DESIREDEC:	desiredec = tag[0] - '0'; break;
 	case H_DESIREDDF:	desireddf = tag[0] - '0'; break;
@@ -379,7 +379,7 @@
 	);
     }
     if (minsp > BR_14400)	minsp = BR_14400;
-    if (desiredbr > BR_14400)	desiredbr = BR_14400;
+    if (desiredbr > BR_33600)	desiredbr = BR_14400;
     if (desiredst > ST_40MS)	desiredst = ST_40MS;
     if (desiredec > EC_ENABLE)	desiredec = EC_ENABLE;
     if (desireddf > DF_2DMMR)	desireddf = DF_2DMMR;
diff -uNr mainline.000309.14/faxd/ModemConfig.c++ mainline.000309.14EcmV34/faxd/ModemConfig.c++
--- mainline.000309.14/faxd/ModemConfig.c++	Mon Aug 23 04:19:33 1999
+++ mainline.000309.14EcmV34/faxd/ModemConfig.c++	Thu Mar  9 15:40:25 2000
@@ -416,6 +416,13 @@
     case 9600:	return (BR_9600);
     case 12000:	return (BR_12000);
     case 14400:	return (BR_14400);
+    case 16800: return (BR_16800);
+    case 19200: return (BR_19200);
+    case 21600: return (BR_21600);
+    case 24000: return (BR_24000);
+    case 28800: return (BR_28800);
+    case 31200: return (BR_31200);
+    case 33600: return (BR_33600);
     }
     configError("Invalid minimum transmit speed \"%s\"", value);
     return (BR_2400);
diff -uNr mainline.000309.14/man/sendfax.1 mainline.000309.14EcmV34/man/sendfax.1
--- mainline.000309.14/man/sendfax.1	Wed Aug 18 02:35:22 1999
+++ mainline.000309.14EcmV34/man/sendfax.1	Fri Mar 10 11:14:38 2000
@@ -237,6 +237,8 @@
 Try to transmit facsimile documents using the
 desired signalling rate.
 Possible speeds are: 2400, 4800, 7200, 9600, 12000, and 14400.
+If V.34 fax is supported, the possible speeds are extended to: 
+16800, 19200, 21600, 24000, 26400, 28800, 31200 and 33600.
 If the specified speed is greater than the transmitting modem
 or receiver is capable of, it is reduced to the highest possible
 speed both devices support.
@@ -272,7 +274,7 @@
 .TP 12
 .B \-E
 Disable use of the Error Correction Mode (\s-1ECM\s+1)
-when transmitting page data.
+when transmitting page data (Only if V.34 fax is not selected).
 By default \*(Fx will attempt to use \s-1ECM\s+1 when both
 the trasmitting modem and receiving device support it.
 Note that international calls are sometimes faster when
diff -uNr mainline.000309.14/man/sendq.4f mainline.000309.14EcmV34/man/sendq.4f
--- mainline.000309.14/man/sendq.4f	Wed Aug 18 02:35:22 1999
+++ mainline.000309.14EcmV34/man/sendq.4f	Thu Mar  9 15:41:36 2000
@@ -202,7 +202,10 @@
 .B desiredbr
 The desired signalling rate to use for page data transmissions:
 0 for 2400 bps, 1 for 4800 bps, 2 for 7200 bps, 3 for 9600 bps,
-4 for 12000 bps, and 5 for 14400 bps (default).
+4 for 12000 bps, and 5 for 14400 bps (default). If V.34 fax is 
+supported: 6 for 16800 bps, 7 for 19200 bps, 8 for 21600 bps, 
+9 for 24000 bps, 10 for 26400 bps, 11 for 28800 bps, 12 for 
+31200 bps and 13 for 33600 bps.
 .TP 14
 .B desireddf
 The desired data format to use for page data transmissions:
diff -uNr mainline.000309.14/sendfax/sendfax.c++ mainline.000309.14EcmV34/sendfax/sendfax.c++
--- mainline.000309.14/sendfax/sendfax.c++	Mon Aug 23 04:19:39 1999
+++ mainline.000309.14EcmV34/sendfax/sendfax.c++	Fri Mar 10 16:02:50 2000
@@ -263,6 +263,10 @@
     SendFaxJob& job = addJob();
     job.setDialString(dest);
     job.setCoverName(recipient);
+    if(job.getDesiredSpeed() > 5 && job.getDesiredEC() == false) {
+      printWarning("can not send V.34 fax without ECM, force it.");
+      job.setDesiredEC(true);
+    }
 }
 
 /*
diff -uNr mainline.000309.14/util/Class2Params.c++ mainline.000309.14EcmV34/util/Class2Params.c++
--- mainline.000309.14/util/Class2Params.c++	Sun Jun 13 00:41:19 1999
+++ mainline.000309.14EcmV34/util/Class2Params.c++	Thu Mar  9 15:43:54 2000
@@ -493,32 +493,48 @@
 const char* Class2Params::verticalResName() const
     { return (verticalResNames[vr&1]); }
 
-const char* Class2Params::bitRateNames[8] = {
+const char* Class2Params::bitRateNames[16] = {
     "2400 bit/s",		// BR_2400
     "4800 bit/s",		// BR_4800
     "7200 bit/s",		// BR_7200
     "9600 bit/s",		// BR_9600
     "12000 bit/s",		// BR_12000
     "14400 bit/s",		// BR_14400
-    "0 bit/s",		// 6 ???
-    "0 bit/s",		// 7 ???
+    "16800 bit/s V.34",		// BR_16800 V.34
+    "19200 bit/s V.34",		// BR_19200 V.34
+    "21600 bit/s V.34",		// BR_21600 V.34
+    "24000 bit/s V.34",		// BR_24000 V.34
+    "26400 bit/s V.34",		// BR_26400 V.34
+    "28800 bit/s V.34",		// BR_28800 V.34
+    "31200 bit/s V.34",		// BR_31200 V.34
+    "33600 bit/s V.34",		// BR_33600 V.34
+    "future modulations",
+    "future modulations",
 };
 const char* Class2Params::bitRateName() const
-    { return (bitRateNames[br&7]); }
+    { return (bitRateNames[br&15]); }
 u_int
 Class2Params::bitRate() const
 {
-    static const u_int brRates[8] = {
+    static const u_int brRates[16] = {
 	2400,	// BR_2400
 	4800,	// BR_4800
 	7200,	// BR_7200
 	9600,	// BR_9600
 	12000,	// BR_12000
 	14400,	// BR_14400
-	14400,	// 6? XXX
-	14400,	// 7? XXX
+	16800,  // BR_16800 V.34
+	19200,  // BR_19200 V.34
+	21600,  // BR_21600 V.34
+	24000,  // BR_24000 V.34
+	26400,  // BR_26400 V.34
+	28800,  // BR_28800 V.34
+	31200,  // BR_31200 V.34
+	33600,  // BR_33600 V.34
+	14400,	// E? future modulations
+	14400,	// F? furure modulations
     };
-    return (brRates[br & 7]);
+    return (brRates[br & 15]);
 }
 
 const char* Class2Params::dataFormatNames[4] = {
diff -uNr mainline.000309.14/util/Class2Params.h mainline.000309.14EcmV34/util/Class2Params.h
--- mainline.000309.14/util/Class2Params.h	Sun Jun 13 00:41:20 1999
+++ mainline.000309.14EcmV34/util/Class2Params.h	Thu Mar  9 15:44:31 2000
@@ -93,7 +93,7 @@
     u_int verticalRes() const;		// lines/inch
     void setVerticalRes(u_int res);
 
-    static const char* bitRateNames[8];	// XXX needed by Class 1 driver
+    static const char* bitRateNames[16];	// XXX needed by Class 1 driver
 
     const char* pageWidthName() const;
     const char* pageLengthName() const;
diff -uNr mainline.000309.14/util/SendFaxJob.c++ mainline.000309.14EcmV34/util/SendFaxJob.c++
--- mainline.000309.14/util/SendFaxJob.c++	Sun Jun 13 00:41:24 1999
+++ mainline.000309.14EcmV34/util/SendFaxJob.c++	Fri Mar 10 15:59:15 2000
@@ -326,6 +326,14 @@
     case 9600:	return (3);
     case 12000:	return (4);
     case 14400:	return (5);
+    case 16800: return (6);
+    case 19200: return (7);
+    case 21600: return (8);
+    case 24000: return (9);
+    case 26400: return (10);
+    case 28800: return (11);
+    case 31200: return (12);
+    case 33600: return (13);
     }
     return (-1);
 }
diff -uNr mainline.000309.14/util/class2.h mainline.000309.14EcmV34/util/class2.h
--- mainline.000309.14/util/class2.h	Mon Oct 12 13:47:48 1998
+++ mainline.000309.14EcmV34/util/class2.h	Fri Mar 10 18:42:25 2000
@@ -68,7 +68,16 @@
 const int BR_9600	= 3;		// 9600 bit/s
 const int BR_12000	= 4;		// 12000 bit/s
 const int BR_14400	= 5;		// 14400 bit/s
-const int BR_ALL	= BIT(BR_14400+1)-1;
+const int BR_ALL_NO_V34	= BIT(BR_14400+1)-1;
+const int BR_16800	= 6;		// 16800 bit/s V.34
+const int BR_19200	= 7;		// 19200 bit/s V.34
+const int BR_21600	= 8;		// 21600 bit/s V.34
+const int BR_24000	= 9;		// 24000 bit/s V.34
+const int BR_26400	= 10;		// 26400 bit/s V.34
+const int BR_28800	= 11;		// 28800 bit/s V.34
+const int BR_31200	= 12;		// 31200 bit/s V.34
+const int BR_33600	= 13;		// 33600 bit/s V.34
+const int BR_ALL	= BIT(BR_33600+1)-1;
 
 const int WD_1728	= 0;		// 1728 pixels in 215 mm
 const int WD_2048	= 1;		// 2048 pixels in 255 mm
diff -uNr mainline.000309.14/util/recvstats.sh.in mainline.000309.14EcmV34/util/recvstats.sh.in
--- mainline.000309.14/util/recvstats.sh.in	Sun Jan 10 01:50:29 1999
+++ mainline.000309.14EcmV34/util/recvstats.sh.in	Thu Mar  9 15:46:34 2000
@@ -265,7 +265,7 @@
 
 function getBR(params)
 {
-    return brNames[int(int(params) / 2) % 8];
+    return brNames[int(int(params) / 2) % 16];
 }
 
 function getDF(params)
@@ -308,7 +308,7 @@
 }
 
 BEGIN		{ FS="\t";
-		  rates = "2400:4800:7200:9600:12000:14400";
+		  rates = "2400:4800:7200:9600:12000:14400:16800:19200:21600:24000:26400:28800:31200:33600";
 		  setupMaps(rates, rateMap, brNames);
 		  datas = "1-D MR:2-D MR:2-D Uncompressed Mode:2-D MMR";
 		  setupMaps(datas, dataMap, dfNames);
diff -uNr mainline.000309.14/util/xferfaxstats.sh.in mainline.000309.14EcmV34/util/xferfaxstats.sh.in
--- mainline.000309.14/util/xferfaxstats.sh.in	Sun Jan 10 01:50:29 1999
+++ mainline.000309.14EcmV34/util/xferfaxstats.sh.in	Thu Mar  9 15:47:08 2000
@@ -351,7 +351,7 @@
 
 function getBR(params)
 {
-    return brNames[int(int(params) / 2) % 8];
+    return brNames[int(int(params) / 2) % 16];
 }
 
 function getDF(params)
@@ -439,7 +439,7 @@
 }
 
 BEGIN		{ FS="\t";
-		  rates = "2400:4800:7200:9600:12000:14400";
+		  rates = "2400:4800:7200:9600:12000:14400:16800:19200:21600:24000:26400:28800:31200:33600";
 		  setupMaps(rates, rateMap, brNames);
 		  datas = "1-D MR:2-D MR:2-D Uncompressed Mode:2-D MMR";
 		  setupMaps(datas, dataMap, dfNames);








Home
Report any problems to webmaster@hylafax.org

HylaFAX is a trademark of Silicon Graphics Corporation.
Internet connectivity for hylafax.org is provided by:
VirtuALL Private Host Services