Revision
16394
Author
gmaruzz
Date
2010-01-18 14:31:44 -0600 (Mon, 18 Jan 2010)

Log Message

gsmopen: ALSA works again

Modified Paths

Diff

Modified: freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp (16393 => 16394)


--- freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-18 19:42:47 UTC (rev 16393)
+++ freeswitch/branches/gmaruzz/mod_gsmopen/mod_gsmopen.cpp	2010-01-18 20:31:44 UTC (rev 16394)
@@ -838,9 +838,10 @@
 		return SWITCH_STATUS_FALSE;
 	}
 
+#ifndef GSMOPEN_PORTAUDIO
+	switch_core_timer_next(&tech_pvt->timer_read);
+#endif// GSMOPEN_PORTAUDIO
 
-	//switch_core_timer_next(&tech_pvt->timer_read);
-
 		if(tech_pvt->no_sound==1){
 		goto cng;
 		}
@@ -884,8 +885,9 @@
 		tech_pvt->read_frame.datalen = samples * 2;
 		tech_pvt->read_frame.samples = samples;
 
-		//switch_core_timer_check(&tech_pvt->timer, SWITCH_TRUE);
-		//tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount;
+#ifndef GSMOPEN_PORTAUDIO
+		tech_pvt->read_frame.timestamp = tech_pvt->timer_read.samplecount;
+#endif// GSMOPEN_PORTAUDIO
 
 		*frame = &tech_pvt->read_frame;
 
@@ -1027,6 +1029,7 @@
 	gsmopen_sound_boost(frame->data, frame->samples, tech_pvt->playback_boost);
 #ifdef GSMOPEN_ALSA
  
+	switch_core_timer_next(&tech_pvt->timer_write);
 	sent = alsa_write(tech_pvt, (short *) frame->data, (int) (frame->datalen));
 //DEBUGA_GSMOPEN("sent=%d \n", GSMOPEN_P_LOG, sent);
 
@@ -2746,7 +2749,7 @@
 
 			if ((now_timestamp - tech_pvt->gsmopen_serial_synced_timestamp) > 30) {	//TODO find a sensible period. 5min? in config?
 				gsmopen_serial_sync(tech_pvt);
-				//gsmopen_serial_getstatus_AT(tech_pvt);
+				gsmopen_serial_getstatus_AT(tech_pvt);
 			}
 		}
 	WARNINGA("EXIT\n", GSMOPEN_P_LOG);