[Sugar-devel] [PATCH Sugar] Inhibit power suspend while playing text to speech - OLPC #11830

Paul Fox pgf at laptop.org
Fri May 18 09:10:35 EDT 2012


simon wrote:
 > On 05/09/2012 05:56 PM, Paul Fox wrote:
 > > gonzalo wrote:
 > >   >  On Wed, May 9, 2012 at 12:42 PM, Paul Fox<pgf at laptop.org>  wrote:
 > >   >
 > >   >  >  i would much prefer that we could prevent suspend during any
 > >   >  >  audio playback, rather than have to have anyone that wants
 > >   >  >  to make noise do it individually.
 > >   >  >
 > >   >  >
 > >   >  But this should be done at a lower level, right?
 > >
 > > yes, sorry -- that comment wasn't really directed at sugar.
 > 
 > Hi Paul,
 > 
 > can you give some background information here, why preventing the XO to 
 > fall asleep when there is audio playback is not happening as of today? 
 > And what are the steps to make this happen at a lower level than Sugar?

the problem is that there's no good operating system mechanism that
powerd can use to know that audio is truly in use.

it's possible to know that the audio device has been opened, and i
have tried using that in the past.  but most applications that use
audio open the device once, and then leave it open.  so even when
they're playing nothing but silence, the device appears to be in use.

the solution would be to either change all the activities to close the
device when it's not in use (unlikely), or create a mechanism where
one can find out whether the driver is producing audible energy.  (or
even better -- how long it has been since it produced audible energy)
i think this would be difficult.  on the other hand, this issue always
comes up late in a release cycle, where we don't really have time for
new kernel work, and then attention fades.  perhaps we can really
pursue it this time.

regarding the other elements of this thread:  it may be that system
mechanisms for inhibiting suspend via upowerd or gnome are now mature
enough to be of some use.  this has never seemed to be the case in the
past.  plus -- they're all, as far as i can tell, just as specific to the
power-manager-du-jour as the current powerd interfaces are.  i.e., no
one has created a generic set of interfaces which can be implemented
in various ways behind the scenes.

paul

 > 
 > Thanks,
 >     Simon

=---------------------
 paul fox, pgf at laptop.org


More information about the Sugar-devel mailing list