LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 08-02-2020, 09:47 PM   #1
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Rep: Reputation: 32
Plasma 5 and hybrid sleep


Hello, I have Slackware-current 64-bit with Plasma 5 (5.19.1)
installed.

I cannot use Suspend to RAM as it kills touchpad.
However Hybrid Sleep (run from console) works well.
I was trying to enable Hybrid Sleep in Plasma 5, however it does not work:
Closing lid just logs user out
Selecting from KDE Menu is not possible (missing option)
also
selecting Hybernate from KDE menu only logs user out.

system is capable to hibernate and hybrid hibernate:
pm-hibernate
pm-suspend-hybrid
from console work
lilo.conf has
append="resume=/dev/sda2"

thank you
 
Old 08-03-2020, 01:12 PM   #2
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Original Poster
Rep: Reputation: 32
o.k.
so I see that there is some interest in the topic but no real solution..

I would not pursue hibernate/suspend-hybrid if suspend to RAM worked properly.
Unfortunately on my laptop suspend to RAM kills touchpad and I have to restart system to regain control over mouse.

Hibernate does not remove psmouse module so after restoring from hibernation all works including touchpad. Suspend-hybrid is just hibernation to RAM so restoring system is as fast as from suspend to RAM.
Even though Plasma has options for hibernate and hybrid-suspend neither works.
There are some references that indicate that it is possible to make hibernate/hybrid-suspend work under kde but all references point to systemd distros.

I found as old as 2016 kde bug report tackling this problem but in 2020 kde still can't do basic stuff (hibernate after lid close or hibernate on battery after time of inactivity.

If some good soul knows how to resolve this issue I would be grateful to learn hot to make kde hibernate.

Last edited by broch; 08-03-2020 at 01:14 PM.
 
Old 08-03-2020, 02:00 PM   #3
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,499

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by broch View Post
o.k.
so I see that there is some interest in the topic but no real solution..

I would not pursue hibernate/suspend-hybrid if suspend to RAM worked properly.
Unfortunately on my laptop suspend to RAM kills touchpad and I have to restart system to regain control over mouse.

Hibernate does not remove psmouse module so after restoring from hibernation all works including touchpad. Suspend-hybrid is just hibernation to RAM so restoring system is as fast as from suspend to RAM.
Even though Plasma has options for hibernate and hybrid-suspend neither works.
There are some references that indicate that it is possible to make hibernate/hybrid-suspend work under kde but all references point to systemd distros.

I found as old as 2016 kde bug report tackling this problem but in 2020 kde still can't do basic stuff (hibernate after lid close or hibernate on battery after time of inactivity.

If some good soul knows how to resolve this issue I would be grateful to learn hot to make kde hibernate.
From what I read, the part from systemd which do this hibernation business is systemd-logind.

And this particular systemd-logind is already used by Mr. Hameleers' Plasma5 and Mr. Workman's XFCE-next as the stand alone elogind , then that information regarding systemd based distributions may apply with some modifications.

Last edited by LuckyCyborg; 08-03-2020 at 02:03 PM.
 
1 members found this post helpful.
Old 08-03-2020, 04:56 PM   #4
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by LuckyCyborg View Post
From what I read, the part from systemd which do this hibernation business is systemd-logind.

And this particular systemd-logind is already used by Mr. Hameleers' Plasma5 and Mr. Workman's XFCE-next as the stand alone elogind , then that information regarding systemd based distributions may apply with some modifications.
I did try to configure /etc/elogind/logind.conf
Based on web suggestions I enabled some options
https://wiki.archlinux.org/index.php...nation_request
with Plasma power options either enabled or disabled.
No luck unfortunately.
After today's Plasma upgrade (5.19.4) even suspend is not working anymore.
I can still put system to hybrid-suspend from command line though.

Thank you for responding.
 
Old 08-03-2020, 05:04 PM   #5
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Original Poster
Rep: Reputation: 32
forgot to mention that if I issue
Quote:
pm-suspend
from console, after wake up, touchpad is working.

So it seems that kde/plasma is messing with the working power management
Quote:
upower -d
............
Daemon:
daemon-version: 0.9.23
can-suspend: yes
can-hibernate: yes
on-battery: yes
on-low-battery: no
lid-is-closed: no
lid-is-present: yes
is-docked: no
upower recognizes ability to suspend and hibernate.
Maybe this has something to do with user privileges (user in wheel, power groups)?

Last edited by broch; 08-03-2020 at 05:43 PM.
 
Old 08-03-2020, 05:55 PM   #6
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,499

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by broch View Post
I did try to configure /etc/elogind/logind.conf
Based on web suggestions I enabled some options
https://wiki.archlinux.org/index.php...nation_request
with Plasma power options either enabled or disabled.
No luck unfortunately.
After today's Plasma upgrade (5.19.4) even suspend is not working anymore.
I can still put system to hybrid-suspend from command line though.

Thank you for responding.
Considering that elogind is a quite new and experimental addition to Slackware, using Plasma5 and XFCE-next builds as testing playground, may be a need for some fine tuning to be complete integrated in Slackware. However, from my experience, it works like a charm as suspend and hibernate.

BUT, there is a trick: you should always use also the DBUS and PolKit shipped by Plasma5 or XFCE-next, as the counterparts from Slackware does not have support for elogind.

How those packages tends to be updated quite often by Mr. Volkerding - see the latest story of mozjs68 which certainly broken the polkit shipped initially by latest Plasma5, the things can go nuts regarding Plasma5 power management.

So, I suggest you to ensure that you synced and upgraded the latest packages from Plasma5, with great attention to polkit-0.117-x86_64-1alien.txz which was released later by Mr. Hameleers, and that you do not rollback by mistake to the Slackware stock packages.

Until Slackware finally replace ConsoleKit2 with elogind, we should be careful about those things.

Last edited by LuckyCyborg; 08-03-2020 at 06:01 PM.
 
2 members found this post helpful.
Old 08-04-2020, 09:37 AM   #7
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by LuckyCyborg View Post
Considering that elogind is a quite new and experimental addition to Slackware, using Plasma5 and XFCE-next builds as testing playground, may be a need for some fine tuning to be complete integrated in Slackware. However, from my experience, it works like a charm as suspend and hibernate.

BUT, there is a trick: you should always use also the DBUS and PolKit shipped by Plasma5 or XFCE-next, as the counterparts from Slackware does not have support for elogind.

How those packages tends to be updated quite often by Mr. Volkerding - see the latest story of mozjs68 which certainly broken the polkit shipped initially by latest Plasma5, the things can go nuts regarding Plasma5 power management.

So, I suggest you to ensure that you synced and upgraded the latest packages from Plasma5, with great attention to polkit-0.117-x86_64-1alien.txz which was released later by Mr. Hameleers, and that you do not rollback by mistake to the Slackware stock packages.

Until Slackware finally replace ConsoleKit2 with elogind, we should be careful about those things.
Thank you for the advice.

I my case the problem was that any modification of logind.conf leads to such behavior: lougout instead of suspend to RAM. So restoring logind.conf to its pristine state fixed the issue with logout instead of suspend.

I think that kde has buggy power management (by design/wontfix or not):
Only thing that I can do from kde/plasma is suspend to RAM and this is not working properly (touchpad after waking up from suspend to RAM is off and the only option is to restart system to get back touchpad).

On the other hand
pm-suspend works perfectly (touchpad working after system waking up)
pm-hibernate works
pm-suspend-hybrid works

So I created symlinks on the desktop to easily put system to sleep when on battery. The only drawback is that system will not go to sleep after period of inactivity but there is nothing I can do about it.

This would conclude current thread as I don't see any good way of fixing the problem.
 
Old 08-04-2020, 09:45 AM   #8
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,499

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
@broch

I have tested today all the ways of hibernation from latest Plasma5, and they works as expected. Including even the hybrid-sleep.

In other hand, please note that Plasma5 relies on elogind for this hibernation business. And it does NOT use the pm-utils , but rather does its power management jobs alone.

I suggest you to test the things using directly the "loginctl" before to blame the power management from Plasma5.

This console utility named "loginctl" supports commands like
Code:
System Commands:
  reload                    Reload the elogind config file
  poweroff [TIME] [WALL...] Turn off the machine
  reboot   [TIME] [WALL...] Reboot the machine
  suspend                   Suspend the machine to memory
  hibernate                 Suspend the machine to disk
  hybrid-sleep              Suspend the machine to memory and disk
  suspend-then-hibernate    Suspend the system, wake after a period of
                            time and put it into hibernate

Last edited by LuckyCyborg; 08-04-2020 at 09:46 AM.
 
1 members found this post helpful.
Old 08-04-2020, 12:24 PM   #9
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by LuckyCyborg View Post
@broch

I have tested today all the ways of hibernation from latest Plasma5, and they works as expected. Including even the hybrid-sleep.

In other hand, please note that Plasma5 relies on elogind for this hibernation business. And it does NOT use the pm-utils , but rather does its power management jobs alone.

I suggest you to test the things using directly the "loginctl" before to blame the power management from Plasma5.

This console utility named "loginctl" supports commands like
Code:
System Commands:
  reload                    Reload the elogind config file
  poweroff [TIME] [WALL...] Turn off the machine
  reboot   [TIME] [WALL...] Reboot the machine
  suspend                   Suspend the machine to memory
  hibernate                 Suspend the machine to disk
  hybrid-sleep              Suspend the machine to memory and disk
  suspend-then-hibernate    Suspend the system, wake after a period of
                            time and put it into hibernate
loginctl suspend disables my touchpad

this is a bug (incomplete implementation - see suspend exercise below) in KDE otherwise, pm-suspend would not work either. However pm-suspend works and turns touchad on after weaking up.


I assume that pm works with my touchpad because it removes psmouse module before suspending/hybernating and loads psmouse module back at resume. Probably this is not something that kde/loginctl do.


if I run from konsole
Quote:
sudo modprobe -r psmouse
followed by
Quote:
loginctl suspend
then after weaking up system
Quote:
sudo modprobe psmouse
my touchpad works.
pm has this script (removing module before suspend and loading after resume) implemented, kde/plasma/loginctl do not

probably hibernate and suspend-hybrid in kde/plasma/loginctl also have something missing that would put to sleep my system.
In contrast pm just works.

Last edited by broch; 08-04-2020 at 12:51 PM.
 
Old 08-04-2020, 01:07 PM   #10
LuckyCyborg
Senior Member
 
Registered: Mar 2010
Posts: 3,499

Rep: Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308Reputation: 3308
Quote:
Originally Posted by broch View Post
I do not see any difference in opening konsole and issuing
loginct suspend
vs
pm-suspend

neither will automatically suspend OS after time of inactivity
Well, the difference is that you can issue as user (from group "power") those power management commands of loginctl, while the pm-utils commands needs the root account.

And even more importantly, I suspect that the "pm-utils" package will be removed once "elogind" is added to Slackware, because it super-seed the first.

Did you do not want to learn how to deal with this business, before be the case that you must deal with?

Quote:
Originally Posted by broch View Post
also
loginctl suspend disables my touchpad similar to K Menu -> Leave -> Suspend

this is a bug in KDE otherwise, pm-suspend would not work either. However pm-suspend works and turns touchad on after weaking up.

It seems that KDE power has issue with my hardware and because pm works, so KDE issue is just a bug for me (as it is limited in therms of recognized hardware).
From my own experiences, neither elogind or Plasma5 will disable your touchpad. You blame erroneous both of those software.

The kernel itself fails to handle your touchpad when its driver wakes up. This usually could be fixed by removing the kernel module and reinserting it after wakeup.

Quote:
Originally Posted by broch View Post
I assume that pm works with my touchpad because it removes psmouse module before suspending/hybernating and loads psmouse modele back at resume. Probably this is not something that kde/loginctl do.
There's the true explanation of WHY your pm-utils apparently works properly.

That's because YOU, dear Comrade Broch, previously you instructed the pm-utils to reload the "psmouse" kernel module with a shiny variable named SUSPEND_MODULES, right?

Your issue is that elogind does not use the pm-utils, then also your elogind should be instructed about reloading this particular kernel module which fails to wake-up in a proper way.

The bad news is that elogind has no shiny variable SUSPEND_MODULES, the good news is that you can create hooks as scripts put in /lib64/elogind/system-sleep

As an example, you can imagine an script /lib64/elogind/system-sleep/modules with a content like this:
Code:
#!/bin/bash
case $1/$2 in
  pre/*)
    # Put here any commands you want to be run when suspending or hibernating.

    echo "Removing 'psmouse' for $2..."
    modprobe -r psmouse
    ;;
  post/*)
    # Put here any commands you want to be run when resuming from suspension or thawing from hibernation.

    echo "Waking up from $2 , adding 'psmouse' ..."
    modprobe psmouse
    ;;
esac
BTW, this script must be executable. See there for futher details:

https://wiki.gentoo.org/wiki/Elogind...ming.2Fthawing

In my humble opinion, this is the proper way to deal with your issue.

Last edited by LuckyCyborg; 08-05-2020 at 01:13 AM.
 
1 members found this post helpful.
Old 08-06-2020, 08:39 AM   #11
broch
Member
 
Registered: Feb 2005
Distribution: Slackware-current 64bit
Posts: 465

Original Poster
Rep: Reputation: 32
Quote:
Originally Posted by LuckyCyborg View Post
Well, the difference is that you can issue as user (from group "power") those power management commands of loginctl, while the pm-utils commands needs the root account.

And even more importantly, I suspect that the "pm-utils" package will be removed once "elogind" is added to Slackware, because it super-seed the first.

Did you do not want to learn how to deal with this business, before be the case that you must deal with?



From my own experiences, neither elogind or Plasma5 will disable your touchpad. You blame erroneous both of those software.

The kernel itself fails to handle your touchpad when its driver wakes up. This usually could be fixed by removing the kernel module and reinserting it after wakeup.



There's the true explanation of WHY your pm-utils apparently works properly.

That's because YOU, dear Comrade Broch, previously you instructed the pm-utils to reload the "psmouse" kernel module with a shiny variable named SUSPEND_MODULES, right?

Your issue is that elogind does not use the pm-utils, then also your elogind should be instructed about reloading this particular kernel module which fails to wake-up in a proper way.

The bad news is that elogind has no shiny variable SUSPEND_MODULES, the good news is that you can create hooks as scripts put in /lib64/elogind/system-sleep

As an example, you can imagine an script /lib64/elogind/system-sleep/modules with a content like this:
Code:
#!/bin/bash
case $1/$2 in
  pre/*)
    # Put here any commands you want to be run when suspending or hibernating.

    echo "Removing 'psmouse' for $2..."
    modprobe -r psmouse
    ;;
  post/*)
    # Put here any commands you want to be run when resuming from suspension or thawing from hibernation.

    echo "Waking up from $2 , adding 'psmouse' ..."
    modprobe psmouse
    ;;
esac
BTW, this script must be executable. See there for futher details:

https://wiki.gentoo.org/wiki/Elogind...ming.2Fthawing

In my humble opinion, this is the proper way to deal with your issue.

Hello LuckyCyborg,
Just wanted to thank you for help:
I found some old scripts dating from 2018 that probably interfered with hibernate and hybrid sleep.
After removing them all (hibernate and hybrid sleep) works .
Also your script for RAM suspend is better than mine so this works too.

I am marking this thread as solved.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] killall sleep to kill both foreground and background sleep processes? mintner Linux - Newbie 3 11-15-2019 06:10 PM
Second monitor connected as DVI enters sleep mode during boot (and never comes out of sleep); but works with VGA connection emacsomancer Linux - Hardware 21 05-24-2019 08:43 PM
Xfce 4.12 and hybrid suspend (aka hybrid sleep) atelszewski Slackware 0 06-15-2017 10:00 PM
LXer: Linux 3.6 Brings Hybrid Sleep, All Rejoice LXer Syndicated Linux News 0 10-02-2012 11:00 PM
creating hybrid-sleep on linux Person_1873 Linux - Laptop and Netbook 2 02-27-2010 08:30 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration