OESF Portables Forum

Model Specific Forums => Gemini PDA => Gemini PDA - Linux => Topic started by: klf! on September 19, 2018, 06:15:50 am

Title: Lockscreen Freeze [Partial workaround found]
Post by: klf! on September 19, 2018, 06:15:50 am
From time to time, but overall quite regularly, I'm not able to unlock debian on my gemini anymore.

Usually when on debian, with wifi on, the screen gets locked due to inactivity or manually by a short Fn+Esc hit. Unlocking normally works by hitting Esc (worldmap appears), typing pwd and Enter. So far so good. But from time to time, there is no response on the Esc-wakeup keystroke. The screen just stays black, no worldmap screen showing up.

Trying to login blindly (?screen wakeup problem?) did not succeed. I tried the whole process from login to shutdown blindly by keyboard(*), but the system/device does not respond in any way. Also waiting does not help (checked 30min+ more than once). The only solution in this case I found so far was Fn-Esc (aka "Off") until the device is powered off and reboot from scratch.
Reading the post over at xda-developers (https://forum.xda-developers.com/gemini-pda/help/debian-linux-wakeup-problems-t3812779), I checked the device is still reachable via network (wifi): yes, and that I can connect via ssh: true (did not tried this before, because the WLAN I use is normally fully isolated from LAN and isolates the clients also, but I took the effort...;-). So the device and debian are basically still running fine. I can't see anything special from the logs (syslog, daemon.log, repowerd.log, debug, auth.log).

Anyone any idea how to go further?

(*) Esc, typing pwd, Enter, Ctrl+Esc, three times cursor up, one time right, four times down and two times Enter ;-)

Edit:
After having ssh available I found out that
   sudo service sddm restart
works around the issue by going to the initial login screen. But unfortunately that's not an option on the go...
Title: Lockscreen Freeze [Partial workaround found]
Post by: klampfenfreak on November 02, 2018, 11:08:16 pm
nothing more about that very bad black screen bug?
tried to programm a key command with siver button, but seems that hardware keys, except the siver one won't get recognized anymore.
Title: Lockscreen Freeze [Partial workaround found]
Post by: Adam Boardman on November 03, 2018, 07:52:56 am
I also get this occasionally, and I've twice had the 'digital rain' which is a special variant where you have to disconnect the battery/fully flatten the device before you can get it to work again.

The current fudge around screen off/sleep needs re-thinking/fixing, currently its still set with the original first thing that sort of worked. I'm not happy with it but have yet to come up with a better plan.

Facts to work with:So the current solution involves/aims to achieve:I couldn't get Planet to tell me how its handled on the Android side, though whether knowing that would have helped or not I don't know.

Possibly useful things for anyone else who wants to debug this, there are two ways of turning the screen off, both block the general keyboard, but let esc[on]+silver buttons work.

dpms screen off sometimes doesn't actually turn the backlight off, and will wake again from esc presses.
Code: [Select]
xset dpms force offhwcomposer off turns the screen off in a way that it wont wake up from esc key presses, so its good to use when the lid is closed, and then get the lock screen to pickup the esc keypress and wake the device if open.
Code: [Select]
xrandr --output hwcomposer --offThese are the actual commands executed on your behalf by gemain branch of 'repowerd' with its interactions with 'gemain-lock'.
Title: Lockscreen Freeze [Partial workaround found]
Post by: Kiriririn on November 04, 2018, 06:13:01 pm
I've got this 99% fixed on my Gemini, will dig up what I changed to get it working...

I've hacked a few things with repowerd suspend and with the lock screen key blocking, can't remember off hand which fixed this issue in particular, but it's defo along those lines
Title: Lockscreen Freeze [Partial workaround found]
Post by: Kiriririn on November 05, 2018, 11:32:23 am
I believe the change that fixed it for me was either:

Most likely:
https://github.com/lukefor/gemian-lock/comm...cfed97a4eee816f (https://github.com/lukefor/gemian-lock/commit/c77eb618ef11b95334a4a6925cfed97a4eee816f)
(disregarding the system() calls which are to restore brightness and lock miravision state on resume)

Or something in here:
https://github.com/gemian/repowerd/compare/....lukefor:master (https://github.com/gemian/repowerd/compare/master...lukefor:master)
(most of this is to undo the cancer that is miravision, nicer backlight control, and 99% fixes the occasional hard freeze and battery drain in standby - so most if not all of it can be disregarded for this issue)

Anecdotally I'm at 22 days and counting of uptime with no weirdness (no freezes, no battery drain, standby working consistently), generally the only issue I've come across is disconnecting the charger without opening/closing lid stops it from entering standby, likewise with closing the lid too quickly sometimes
Title: Lockscreen Freeze [Partial workaround found]
Post by: Adam Boardman on November 05, 2018, 02:17:14 pm
Possibly I've not looked in the right diff, but it looks like you've changed some bits to call some external scripts: /root/sleepy.sh etc, but not checked those in?
Title: Lockscreen Freeze [Partial workaround found]
Post by: Kiriririn on November 08, 2018, 03:13:29 pm
Quote from: Adam Boardman
Possibly I've not looked in the right diff, but it looks like you've changed some bits to call some external scripts: /root/sleepy.sh etc, but not checked those in?

Just hacks for my setup in there, cant remember if they even achieve anything

wakey
Code: [Select]
nmcli r all on
sleepy
Code: [Select]
killall -CONT /vendor/bin/aal
nnmcli r all off
Title: Lockscreen Freeze [Partial workaround found]
Post by: klampfenfreak on March 21, 2019, 03:25:01 pm
Hi together,

I still have this bug. When I close the lid I get a black screen and can`t login anymore.
I have read, there should be a solution in TP2? I think I am already up to date with my packages?! I walked thru the guid to enable TP2 repository and update/upgrade with apt.
ut I have not updated the Kernel, yet. I am not sure which partition is the right without messing up my Sailfish boot partition.

I also disabled the lid watcher as described on github.
Can someone explain how to identify the right partition for updating the linux kernel, please.
For now my workaround is a hotkey on the silver button to kill the desktop manager. But it closes all the applications, too. I have to start everything again after login.

I really want debian as my daily driver but the "screen black" bug makes it a no go. It seems the battery power drains much faster as on Android or also Sailfish.

Thank you
Title: Lockscreen Freeze [Partial workaround found]
Post by: Kiriririn on March 21, 2019, 07:10:28 pm
Quote from: klampfenfreak
Hi together,

I still have this bug. When I close the lid I get a black screen and can`t login anymore.
I have read, there should be a solution in TP2? I think I am already up to date with my packages?! I walked thru the guid to enable TP2 repository and update/upgrade with apt.
ut I have not updated the Kernel, yet. I am not sure which partition is the right without messing up my Sailfish boot partition.

I also disabled the lid watcher as described on github.
Can someone explain how to identify the right partition for updating the linux kernel, please.
For now my workaround is a hotkey on the silver button to kill the desktop manager. But it closes all the applications, too. I have to start everything again after login.

I really want debian as my daily driver but the "screen black" bug makes it a no go. It seems the battery power drains much faster as on Android or also Sailfish.

Thank you

You need to update the kernel
Title: Lockscreen Freeze [Partial workaround found]
Post by: klampfenfreak on March 21, 2019, 08:56:22 pm
Quote from: Kiriririn
Quote from: klampfenfreak
Hi together,

I still have this bug. When I close the lid I get a black screen and can`t login anymore.
I have read, there should be a solution in TP2? I think I am already up to date with my packages?! I walked thru the guid to enable TP2 repository and update/upgrade with apt.
ut I have not updated the Kernel, yet. I am not sure which partition is the right without messing up my Sailfish boot partition.

I also disabled the lid watcher as described on github.
Can someone explain how to identify the right partition for updating the linux kernel, please.
For now my workaround is a hotkey on the silver button to kill the desktop manager. But it closes all the applications, too. I have to start everything again after login.

I really want debian as my daily driver but the "screen black" bug makes it a no go. It seems the battery power drains much faster as on Android or also Sailfish.

Thank you

You need to update the kernel
my kernel version is 3.18.41+
Is there a newer one?
Title: Lockscreen Freeze [Partial workaround found]
Post by: Adam Boardman on March 22, 2019, 04:54:52 am
Yes, but its still based upon the same upstream version number, you can now install 'gemian-modular-kernel' to get the new (built yesterday) kernel.

Note that you still need to 'dd'/flash the generated boot image to your choice of boot partition depending upon which boot time button combination you press to launch Gemian. A suggested 'sudo dd ...' line should be printed to remind you of this.

This kernel now includes Mithrandir's work to make the kernel support modules, including building out of tree modules (with the matching -headers package). As well as all previous fixes which have improved some of the crashes, though there are still plenty to fix, I'm getting sleep reboots every week or two, Nikita is working on a fix for a race condition that may help this.

Although the build date has no fixed link to what kernel code was built, its what we are using for now to check for kernel versions (uname -a), it certainly works for build server built kernels as they just pull direct from github.

Possibly also of interest the android system.img (the one used by hybris in a LXC container) is now also updatable (gemian-system), and we have a choice of three meta-packages you can install to pull in useful packages, your choice of (gemian-desktop, gemian-desktop-wifi or gemian-desktop-minimal)
Title: Lockscreen Freeze [Partial workaround found]
Post by: klampfenfreak on March 22, 2019, 08:08:17 pm
Thank you for helping how to flash the kernel. Now I have module support. I like to have cifs (next to sshfs) again.

Unfortunately the screen stays still black after closing the lid!  

What else can I do?
I already reinstalled lxda. Gemian-lock and xss-lock starting with session, lid watcher is disabled.
Title: Lockscreen Freeze [Partial workaround found]
Post by: Adam Boardman on March 23, 2019, 03:42:51 am
Sounds like you've got a new one, least something I've not seen. So you'll have to dig in to see whats going on.

You could try ssh'ing in and following the logs, something like 'sudo journalctl -f', might drop your ssh connection on lid close, though being plugged into USB power can help.

The place to look for info and contribute is the debugging (https://github.com/gemian/gemini-keyboard-apps/wiki/Debugging) page.

Also check for the number of lock processes running whilst your logged in as a user.
Title: Lockscreen Freeze [Partial workaround found]
Post by: mithrandir on March 23, 2019, 08:05:11 am
Quote from: klampfenfreak
Thank you for helping how to flash the kernel. Now I have module support. I like to have cifs (next to sshfs) again.

Unfortunately the screen stays still black after closing the lid!  

What else can I do?
I already reinstalled lxda. Gemian-lock and xss-lock starting with session, lid watcher is disabled.

With the new kernel getting cifs support should be as easy as installing the needed tools (for sshfs anyways):

apt install cifs-utils sshfs
Title: Lockscreen Freeze [Partial workaround found]
Post by: klampfenfreak on March 25, 2019, 02:47:28 pm
Hi,

thank you very much. Yesterday I reflashed the Linux partition and upgradet to TP2 and now everything looks fine!!

As I tried to mount a folder via cifs, I had got an error that cifs is not supported by this kernel. (gemian-modular-kernel)
So I removed it and installed: sudo apt install gemini-kernel-image-3.18
Now also cifs is working!

What is the difference between this kernel updates, please? In both versions, I had to flash the boot partition manually.
And one stupid question: what means the name "TP2"

best regards,
Rico
Title: Lockscreen Freeze [Partial workaround found]
Post by: Adam Boardman on March 25, 2019, 06:24:59 pm
TP2 is Technical Preview 2, it was just following on from the name Planet gave the first release (Technical Preview), and seemed sensible to keep as there are still many device features not supported. The release names are just a way of referring to the starting point, once upgraded to the latest stuff then you really need to refer to the date of you last apt upgrade to compare features available, on this basis TP2 is considered very old. We plan to release a TP3 sometime soon-ish, see other threads on this forum, hoping for a few more fixes first though, there would be no need to upgrade via the flash tool for those with working systems, its just to reduce the updates needed from a fresh install.

Interesting that your cifs didn't work with the modular kernel but did with the all-in one. Hopefully mithrandir can advise, in theory you should have access to more kernel modules and features with the module based one (the package is about 10 times the size after all). The plan was to orphan the all-in kernel in favor of the modular one going forwards, on the assumption of positive feedback, we may have to review that...

Flashing/dd'ing the boot partition manually is expected, once we get some consistent feedback of the advised 'dd' line being correct and the kernels working for lots of folk then we'll make it automatic for those with the new bootloader that knows what key combination was used to boot from. Obviously those who upgraded without going back to the flashtool will not have the new bootloader so we can never safely know which boot partition they use for gemian. Cite recent Sailfish upgrades where they 'assume' a boot partition and people lose their access to Android etc.
Title: Lockscreen Freeze [Partial workaround found]
Post by: mithrandir on March 25, 2019, 07:14:31 pm
Tried cifs myself with the modular kernel and it worked ( mount -tcifs <URI> <mountpoint>). The cifs module gets automatically loaded. It is the other way around. The non modular kernel does not support cifs since CONFIG_CIFS is not set in aeon6797_6m_n_halium_defconfig.

@klampfenfreak: Maybe you have forgotten to dd the kernel or to reboot before trying? What is the output of lsmod when you have mounted the share? What is the output of uname -a? (Build date of the modular kernel is Mar 22 00:00:17 UTC 2019. The non modular kernel should be older.)

Mith
Title: Lockscreen Freeze [Partial workaround found]
Post by: Eric BF on March 28, 2019, 07:54:19 am
Quote from: Adam Boardman
As well as all previous fixes which have improved some of the crashes, though there are still plenty to fix, I'm getting sleep reboots every week or two, Nikita is working on a fix for a race condition that may help this.
Ah, thanks for noting this. I have this happen roughly once a week, overnight typically. I look forward to a fix!
Title: Lockscreen Freeze [Partial workaround found]
Post by: klampfenfreak on March 28, 2019, 09:50:27 am
Hi,

ok, I reinstalled the modular kernel and flashed again. Now also mounting via cifs works well.
Sometimes I get a black desktop with only mouse after a reboot! Only I can do is rebooting again. Has someone similar issues?
Lockscreen works perfekt.