]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Further changes to polish the long training/short training issues that spoilt
authorSteve Underwood <steveu@coppice.org>
Wed, 16 Jun 2010 15:26:15 +0000 (23:26 +0800)
committerSteve Underwood <steveu@coppice.org>
Wed, 16 Jun 2010 15:27:34 +0000 (23:27 +0800)
T.38 gateway operation with some FAX machines

libs/spandsp/src/t38_gateway.c
libs/spandsp/src/v17rx.c

index 824ee16e4b30f6bdb1447565ad0d184fcaf654b0..e4fac8067c431835a4a45998c6eb43e56f594703 100644 (file)
@@ -1627,6 +1627,7 @@ static void non_ecm_rx_status(void *user_data, int status)
         s->audio.modems.rx_trained = TRUE;
         s->core.timed_mode = TIMED_MODE_IDLE;
         s->core.samples_to_timeout = 0;
+        s->core.short_train = TRUE;
         to_t38_buffer_init(&s->core.to_t38);
         break;
     case SIG_STATUS_CARRIER_UP:
@@ -1792,6 +1793,7 @@ static void hdlc_rx_status(hdlc_rx_state_t *t, int status)
         /* The modem is now trained. */
         s->audio.modems.rx_signal_present = TRUE;
         s->audio.modems.rx_trained = TRUE;
+        s->core.short_train = TRUE;
         /* Behave like HDLC preamble has been announced. */
         t->framing_ok_announced = TRUE;
         to_t38_buffer_init(&s->core.to_t38);
index b5ba221cae9bfeebfd5a3c6f64585f38b69409d7..78311a8a43ced98378d30313612fff40b99fc89c 100644 (file)
@@ -1358,12 +1358,12 @@ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_trai
         s->carrier_phase_rate = dds_phase_ratef(CARRIER_NOMINAL_FREQ);
         equalizer_reset(s);
 #if defined(SPANDSP_USE_FIXED_POINTx)
-        //s->agc_scaling_save = 0;
+        s->agc_scaling_save = 0;
         s->agc_scaling = (float) FP_FACTOR*32768.0f*0.0017f/RX_PULSESHAPER_GAIN;
         s->carrier_track_i = 5000;
         s->carrier_track_p = 40000;
 #else
-        //s->agc_scaling_save = 0.0f;
+        s->agc_scaling_save = 0.0f;
         s->agc_scaling = 0.0017f/RX_PULSESHAPER_GAIN;
         s->carrier_track_i = 5000.0f;
         s->carrier_track_p = 40000.0f;
@@ -1371,6 +1371,7 @@ SPAN_DECLARE(int) v17_rx_restart(v17_rx_state_t *s, int bit_rate, int short_trai
     }
     s->last_sample = 0;
     span_log(&s->logging, SPAN_LOG_FLOW, "Phase rates %f %f\n", dds_frequencyf(s->carrier_phase_rate), dds_frequencyf(s->carrier_phase_rate_save));
+    span_log(&s->logging, SPAN_LOG_FLOW, "Gains %f %f\n", s->agc_scaling_save, s->agc_scaling);
 
     /* Initialise the working data for symbol timing synchronisation */
 #if defined(SPANDSP_USE_FIXED_POINTx)
@@ -1407,7 +1408,7 @@ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_
     case 9600:
     case 7200:
     case 4800:
-        /* 4800 is an extension of V.17, to provide full converage of the V.32bis modes */
+        /* 4800 is an extension of V.17, to provide full coverage of the V.32bis modes */
         break;
     default:
         return NULL;
@@ -1425,13 +1426,6 @@ SPAN_DECLARE(v17_rx_state_t *) v17_rx_init(v17_rx_state_t *s, int bit_rate, put_
     s->short_train = FALSE;
     //s->scrambler_tap = 18 - 1;
     v17_rx_signal_cutoff(s, -45.5f);
-#if defined(SPANDSP_USE_FIXED_POINTx)
-    s->agc_scaling_save = 0;
-    s->agc_scaling = (float) FP_FACTOR*32768.0f*0.0017f/RX_PULSESHAPER_GAIN;
-#else
-    s->agc_scaling_save = 0.0f;
-    s->agc_scaling = 0.0017f/RX_PULSESHAPER_GAIN;
-#endif
     s->carrier_phase_rate_save = dds_phase_ratef(CARRIER_NOMINAL_FREQ);
     v17_rx_restart(s, bit_rate, s->short_train);
     return s;