[pkg-fso-commits] [SCM] FSO frameworkd Debian packaging branch, master, updated. milestone4-368-g700ab82

Michael 'Mickey' Lauer mickey at vanille-media.de
Mon Feb 2 18:51:22 UTC 2009


The following commit has been merged in the master branch:
commit 1f2c56f2b9309465f9c03a0cb498e889a9e795c3
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date:   Sun Nov 23 20:54:41 2008 +0100

    ogsmd: Added reinit method to abstract modem class,
    * added hook for handling a HUP in the low level channel class,
    * added reinitializing the TI Calypso modem class whenever
    a HUP on any MUXer channel has been detected (which means
    that the gsm0710muxd has probably been killed).
    NOTE: We now survive a killall gsm0710muxd transparently!
    TODO: How to send this to the upper layers? (via a signal in the org.freesmartphone.GSM.Device space?)

diff --git a/ChangeLog b/ChangeLog
index 1a0ef94..7229c1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,29 @@
+2008-11-23	Michael Lauer	<mickey at openmoko.org>
+
+	* [ogsmd] Added reinit method to abstract modem class,
+	   added hook for handling a HUP in the low level channel class,
+	   added reinitializing the TI Calypso modem class whenever
+	   a HUP on any MUXer channel has been detected (which means
+	   that the gsm0710muxd has probably been killed).
+	   NOTE: We now survive a killall gsm0710muxd transparently!
+
+2008-11-21	Michael Lauer	<mickey at openmoko.org>
+
+	* [odeviced] Fixed a couple of problems in the Audio problem and support new features
+	  such as a loop parameter and an optional length override (time in seconds).
+	  NOTE: Some codecs (i.e. machine emulators such as siddec) can not find out
+	  when a song ends, hence it will play forever until you stop it (or give
+	  it a length override, which is now possible).
+	  WARNING: API breakage in org.freesmartphone.Device.Audio.PlaySound()
+	* [oeventsd]: catch up with API breakage in odeviced/audio
+	* [rules]: override length for SID ring and message tunes
+
+This fixes FSO ticket #247 and the message notification tone only working
+
+for the first time in ms4(.1)
+
+NOTE: More stress-tests for the audio API necessary
+
 2008-11-19	Tobias Gruetzmacher	<tobias-lists at 23.gs>
 
 	* Support audio file options in org.freesmartphone.Device.Audio
diff --git a/framework/subsystems/ogsmd/gsm/channel.py b/framework/subsystems/ogsmd/gsm/channel.py
index ade1eb3..ae471c8 100644
--- a/framework/subsystems/ogsmd/gsm/channel.py
+++ b/framework/subsystems/ogsmd/gsm/channel.py
@@ -14,7 +14,7 @@ This module provides communication channel abstractions that
 transport their data over a (virtual) serial line.
 """
 
-__version__ = "0.9.9"
+__version__ = "0.9.9.1"
 
 from ogsmd.gsm.decor import logged
 import parser
@@ -188,6 +188,10 @@ class VirtualChannel( object ):
         """Override, if special handling is necessary after reading."""
         pass
 
+    def _hookHandleHupCondition( self ):
+        """Override, if special handling is necessary on HUP."""
+        pass
+
     #
     # private API
     #
@@ -196,11 +200,11 @@ class VirtualChannel( object ):
         """Called, if there is a HUP condition on the source."""
         assert source == self.serial.fd, "HUP on bogus source"
         assert condition == gobject.IO_HUP, "HUP on bogus condition"
-        logger.info( "%s: HUP on socket, trying to recover", self )
-        self.close()
-        time.sleep( 1 )
-        self.open()
-        return True
+        logger.info( "%s: HUP on socket" % self )
+
+        self._hookHandleHupCondition()
+
+        return True # gobject, call me again
 
     def _readyToRead( self, source, condition ):
         """Called, if data is available on the source."""
@@ -215,11 +219,11 @@ class VirtualChannel( object ):
             inWaiting = 0
             # should we really continue here?
         data = self.serial.read( inWaiting )
-        logger.debug( "%s: got %d bytes from: %s", self, len(data), repr(data) )
+        logger.debug( "%s: got %d bytes from: %s" % ( self, len(data), repr(data) ) )
         self.readyToRead( data )
 
         self._hookPostReading()
-        return True
+        return True # gobject, call me again
 
     def _readyToSend( self, source, condition ):
         """Called, if source is ready to receive data."""
@@ -231,7 +235,7 @@ class VirtualChannel( object ):
         self.watchReadyToSend = None
         self._hookPostSending()
 
-        return False
+        return False # gobject, don't call me again
 
     def _slowButCorrectWrite( self, data ):
         """
diff --git a/framework/subsystems/ogsmd/modems/abstract/modem.py b/framework/subsystems/ogsmd/modems/abstract/modem.py
index d2fee2f..719bc33 100644
--- a/framework/subsystems/ogsmd/modems/abstract/modem.py
+++ b/framework/subsystems/ogsmd/modems/abstract/modem.py
@@ -13,12 +13,16 @@ Module: modem
 
 # FIXME: The modem should really be a sigleton
 
+__version__ = "0.9.9.1"
+MODULE_NAME = "ogsmd.modem.abstract"
+
+
 from ogsmd.gsm.decor import logged
 
 import gobject
 
 import logging
-logger = logging.getLogger( "ogsmd.modem.abstract" )
+logger = logging.getLogger( MODULE_NAME )
 
 #=========================================================================#
 class AbstractModem( object ):
@@ -70,6 +74,17 @@ class AbstractModem( object ):
             # FIXME: We're throwing away the result here :/
             channel.close()
 
+    def reinit( self ):
+        """
+        Closes and reopens the communication channels, also triggering
+        resending the initialization commands on every channel.
+        """
+        self.close()
+        for channel in self._channels.values():
+            channel._sendCommands( "init" ) # just enqueues them for later
+        # FIXME no error handling yet
+        self.open( lambda: None, lambda foo: None )
+
     def data( self, key, defaultValue=None ):
         return self._data.get( key, defaultValue )
 
diff --git a/framework/subsystems/ogsmd/modems/ti_calypso/channel.py b/framework/subsystems/ogsmd/modems/ti_calypso/channel.py
index a79faf5..f2028e3 100644
--- a/framework/subsystems/ogsmd/modems/ti_calypso/channel.py
+++ b/framework/subsystems/ogsmd/modems/ti_calypso/channel.py
@@ -95,6 +95,12 @@ class CalypsoModemChannel( AbstractModemChannel ):
 
         return True
 
+    #
+    # TI Calypso has a deep sleep mode, effective after 8 seconds,
+    # from which we need to wake up by sending a special character
+    # (plus a small waiting time)
+    #
+
     def _hookPreReading( self ):
         if CalypsoModemChannel.modem_communication_timestamp:
             CalypsoModemChannel.modem_communication_timestamp = time.time()
@@ -115,6 +121,16 @@ class CalypsoModemChannel( AbstractModemChannel ):
         if CalypsoModemChannel.modem_communication_timestamp:
             CalypsoModemChannel.modem_communication_timestamp = time.time()
 
+    #
+    # Since we are using a multiplexer, a hang-up condition on one channel is a good indication
+    # that the underlying multiplexer died. In this case, we need to completely reinit
+    #
+
+    def _hookHandleHupCondition( self ):
+        logger.warning( "HUP condition on modem channel. The multiplexer is probably dead. Launching reinit..." )
+        logger.debug( "Closing the modem..." )
+        self._modem.reinit()
+
 #=========================================================================#
 class CallChannel( CalypsoModemChannel ):
 #=========================================================================#

-- 
FSO frameworkd Debian packaging



More information about the pkg-fso-commits mailing list