Powerd (/usr/sbin/powerd) itself is not that hard to read; it is just a shell script.<br><br>On XOs, powerd is willing to aggressively suspend the system (and enable the DCON) if certain criteria are met which seem to indicate that the XO is not in use.  These criteria include:<br>

<ul><li>CPU usage below a set threshold</li><li>No recent keyboard/mouse usage</li><li>No network activity except for certain types (multicast and a few other things)<br></li><li>Camera usage above a set threshold</li><li>

Nothing present which would inhibit suspend given the current ruleset (such as USB keyboards)<br></li></ul>The audio system is not currently monitored to sense activity because applications tend to open the audio device and leave it open, even if they are not making any sound at the moment.<br>

<br>So if the CPU usage is low enough during text-to-speech playback and the audio device is unmonitored, we may try to suspend in the middle of playing audio.<br><br><br><div class="gmail_quote">On Fri, May 18, 2012 at 7:00 AM, Simon Schampijer <span dir="ltr"><<a href="mailto:simon@schampijer.de" target="_blank">simon@schampijer.de</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, so I am still not clear on the whys. Why does the machine suspend when there is audio being played back? That sounds wrong to me. It would be the same as suspending why I am moving the mouse. Can someone provide some background information on this?<br>


<br>
Regards,<br>
   Simon<div class="im"><br>
<br>
<br>
<br>
On 05/17/2012 08:08 PM, Gonzalo Odiard wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
On Tue, May 15, 2012 at 4:51 PM, Sascha Silbe<<a href="mailto:silbe@activitycentral.com" target="_blank">silbe@activitycentral.<u></u>com</a>>wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Gonzalo Odiard<<a href="mailto:godiard@sugarlabs.org" target="_blank">godiard@sugarlabs.org</a>>  writes:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Using  powerd-inhibit-suspend directory is how ALL the activities are<br>
working today,<br>
</blockquote>
<br>
Quantity isn't the same as quality. That everybody is doing it doesn't<br>
make it suddenly a good idea. Quite the contrary, as platform developers<br>
we have the responsibility to take the lead and show what _best_ (not<br>
common) practice is. Activity authors can then adopt it.<br>
<br>
<br>
</blockquote>
But implementing such solution probably should be a feature and will not be<br>
accepted at this time.<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
and how powerd is used.<br>
</blockquote>
<br>
That's exactly what I don't like: it's specific to powerd. That's fine<br>
for downstreams to decide for themselves and use your patch (Dextrose<br>
may be interested in it, for example), but it's not a good direction for<br>
upstream to take.<br>
<br>
<br>
</blockquote>
That is a complete nonsense to me. Probably Dextrose will accept it, and<br>
OLPC too.<br>
In what _real_ users you think when you work?<br>
Do you prefer have a bug who affect to 90% percent of our users without fix,<br>
because your imaginary users may be don't have powerd? And think one<br>
solution can be:<br>
<br></div>
*"Brand-new D-Bus API*<br>
*  If we go this route, we should involve other desktop projects (Gnome,<br>
   KDE, etc.) to agree on an API that all of us can use."*<div class="im"><br>
<br>
Wake up! This is not a university project. There are real users, and we<br>
should work for them.<br>
<br>
Gonzalo<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Sascha<br>
<br>
--<br>
<a href="http://sascha.silbe.org/" target="_blank">http://sascha.silbe.org/</a><br>
<a href="http://www.infra-silbe.de/" target="_blank">http://www.infra-silbe.de/</a><br>
<br>
</blockquote>
<br>
<br>
<br>
</div></blockquote><div class="HOEnZb"><div class="h5">
<br>
______________________________<u></u>_________________<br>
Sugar-devel mailing list<br>
<a href="mailto:Sugar-devel@lists.sugarlabs.org" target="_blank">Sugar-devel@lists.sugarlabs.<u></u>org</a><br>
<a href="http://lists.sugarlabs.org/listinfo/sugar-devel" target="_blank">http://lists.sugarlabs.org/<u></u>listinfo/sugar-devel</a><br>
</div></div></blockquote></div><br>