maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Overzealous suspend everything watchdog [workaround included] (https://talk.maemo.org/showthread.php?t=92183)

szopin 2013-12-28 00:38

Overzealous suspend everything watchdog [workaround included]
 
I would describe N900 behaviour as sane: you have sshd running, you are on a network with IP assigned, whether your screen is on or off people on the network can come and say hello through SSH.

Jolla behaviour is a bit insane, same setup: if your ssh connection hit before screen went dark all is fine and good (until you try to ./configure/make/sudo something), but after screen goes dark (might need an extra minute or two to reproduce) no way to connect.

Does anybody know how to make Jolla more sane in such situations?

edit: This supposedly could help (from irc when asking if screen on could be faked):
Quote:

echo asdf > /sys/power/wake_lock
Workaround by keeping screen on, but will be horrible on battery. Any other way?

rainisto 2013-12-28 01:01

Re: Overzealous suspend everything watchdog
 
Device will not suspended when your device is connected to usb. In home that usually means charger or your laptop.

Only way to wake from suspend (not connected to usb and display off) is to use https://github.com/nemomobile/libiphb which allows periodic heartbeat (ie wake system up at some interval).

Having said that you really should not do it unless you want to screw up your battery life.

szopin 2013-12-28 01:06

Re: Overzealous suspend everything watchdog
 
Quote:

Originally Posted by rainisto (Post 1401318)
Device will not suspended when your connected device with usb. In home that usually means charger or your laptop.

Only way to wake from suspend (not connected to usb and display off) is to use https://github.com/nemomobile/libiphb which allows periodic heartbeat (ie wake system app at some interval).

Going to compile it in a second, do I run it from fingerterm on device and then lock or does it have to be run for each process that needs to be kept alive?

EDIT:
Quote:

Having said that you really should not do it unless you want to screw up your battery life
I want to be able to use my J as my N900 pocket computer that works in pocket and does what it was told to. If I can trigger libphb off after usage and keep the rest of awesome battery life than even better, for now I need to know how to keep this thing working when I want it to

rainisto 2013-12-28 01:08

Re: Overzealous suspend everything watchdog
 
Quote:

Originally Posted by szopin (Post 1401320)
Going to compile it in a second, do I run it from fingerterm on device and then lock or does it have to be run for each process that needs to be kept alive?

Not that easy, you cant say what process needs to be kept alive, you need to integrate that into each application itself. So most likely in your use case its just easier to keep your phone in charger, or have external battery charger connected. (Or keep display on).

libiphb is mostly used by alarm application which needs to wake up from suspend, and some internal apps that needs to wake up peridically.

szopin 2013-12-28 01:10

Re: Overzealous suspend everything watchdog
 
Quote:

Originally Posted by rainisto (Post 1401321)
Not that easy, you cant say what process needs to be kept alive, you need to integrate that into each application itself. So most likely in your use case its just easier to keep your phone in charger, or have external battery charger connected. (Or keep display on).

My use case is N900 connected to J through ssh running makes etc on J. No way to connect USB/power on on the bus/car (train with laptop will work, sure)

rainisto 2013-12-28 01:13

Re: Overzealous suspend everything watchdog
 
Well, yes in developer mode, you can use "mcetool" to disable suspend all together, which will suit your case, but it will make your battery go empty pretty fast.

pkcon install mce-tools
mcetool --set-suspend-policy=disabled

szopin 2013-12-28 01:22

Re: Overzealous suspend everything watchdog
 
Thanks! Device goes into crazy state though, tap to unlock gone, ssh even more wild unresponsive... might need to try on fresh reboot

edit: but htop from ssh now behaves normally instead of screenshot behaviour previously, now just as lively as in fingerterm

szopin 2013-12-28 01:30

Re: Overzealous suspend everything watchdog
 
Works like a charm. New ssh connections start yay! Autogen/configure on libphb went nicely up to lacking 'mce'.
Thanks a lot, with disable.sh while getting on a tram and enable.sh when disembarking this suits all my needs. TY!

javispedro 2013-12-28 02:56

Re: Overzealous suspend everything watchdog [workaround included]
 
Back when I realized that this device had this terribly idiotic behavior*, I tried figuring out how to take a permanent wakelock from the Android side. I did not know about the mce "feature" and thus decided to create a new daemon (actually, a kernel module).

The thing is, the battery doesn't actually seem to take a very hard hit (in fact, I got slightly more battery life after enabling the "permanent wakelock" -- but obviously because of measurement error). Then I discovered the craze about the "other half power vampire" and I suspect I will have to redo tests, but at least that got my hopes somewhat high again. I also must mention that I have not inserted a SIM card yet.

* Which is the same as every other Android device out there. That's one benefit less of Jolla vs other Android devices, and one big con when comparing to Maemo devices :( See blog post on why opportunistic suspend is wrong right from the mouth of a member of the original N900 team.

Code:

This supposedly could help (from irc when asking if screen on could be faked):
    echo asdf > /sys/power/wake_lock

The problem with that is that wake locks are deleted when the process that created them dies. In the above command line, a subshell (or /bin/echo) is the one creating the wakelock and thus the lock dies as soon as echo dies, which is immediate. EDIT: Possibly wrong, see next page.

juiceme 2013-12-28 10:11

Re: Overzealous suspend everything watchdog [workaround included]
 
Now can anyone tell me what is different with my Jola, since I have never been hit with this problem.
I can always SSH to my Jolla, just as I can SSH to my N9, whether the screen is on or off. (and on my Jolla I do have the device lock ON, so if I want to access it via the UI then I need to unlock it first...)


All times are GMT. The time now is 14:17.

vBulletin® Version 3.8.8