![]() Registered Member ![]()
|
i just noticed something. now, this correlation may be spurious, but it looks like suspend and resume work properly when programs (e.g., browser, file manager, etc.) are open, but not when there are no programs open.
|
![]() Registered Member ![]()
|
I doesn't seem to be the same with me... it happens in both cases. maybe it's different
42: There is no other answer. There are only different ways to express it.
0x2A 0o52 0b101010 |
![]() Registered Member ![]()
|
i think i might have figured out the problem.
preliminary note: any screen-blanking event (e.g., switching to a virtual terminal, suspend, etc.) causes the problem. i think it has to do with the graphics. i've noticed that when compositing is disabled, i can suspend, switch between the virtual terminals and the gui, etc. without any issue. when compositing is enabled, i run into problems. some more evidence: as noted above, i can return to the gui properly when compositing is disabled. but as soon as i enable compositing, the screen turns black and all i get is the mouse cursor. |
![]() Administrator ![]()
|
Which graphics drivers do you use? Are they Intel drivers by any chance?
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
i'm using the open source ati drivers.
i just did some more testing. i think the following should work. to get suspend and resume to work properly, disable compositing before suspending, and on resume, replace kwin and then enable compositing. i did that manually and things seemed to work. now i'm trying to figure out how to do it automatically. |
![]() Registered Member ![]()
|
i ended up creating a hook for pm-utils. i called it 00togglecompositing and put it in /etc/pm/sleep.d.
but for some reason, i get these errors:
and
|
![]() Administrator ![]()
|
You need to set DISPLAY to ":0"
additionally, I would recommend sourcing ~/.dbus/session-bus/* as the user, not as root, for both security and multiple user support.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
can you elaborate? i just copied the code from the arch wiki: http://wiki.archlinux.org/index.php/Pm- ... re_suspend how do i set it? what does that command do?
can you explain what you mean here as well? i was doing some more research, and it seems an alternative approach would be to write a script that accomplishes the same task and link it to powerdevil. this is easier than creating a hook for pm-utils in the sense that pm-utils is outside of x. what do you think of the alternative approach? is it possible to implement? |
![]() Administrator ![]()
|
Add the following scripts:
~/.local/prepare-suspend.sh
~/.local/resume-suspend.sh
Change 00togglecompositing to:
In your script, if KWin had managed to access the display, then it would have started and KWin would have been running as root which is EXTREMELY dangerous.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
thank you, bcooksley!
note: there are two minor errors in the first script. first, the quotation mark before 'qdbus' should be a left quotation mark '`'. second, a semicolon is needed before the 'then'. the fixed script:
seems to work. also, the second script is problematic on occasion; either the screen goes black when compositing is enabled or everything comes back properly, but some windows are missing borders, etc. to get around this problem, i added 'kwin --replace' after the last line. interestingly, i get the following error in pm-suspend.log:
not sure why. however, thus far, everything appears to be working properly. i'm going to continue testing this, but the solution is promising. |
![]() Registered Member ![]()
|
i removed the 'kwin --replace' command and everything works (moreover, no errors). i haven't had a black screen since. i guess i didn't need it after all.
i'm marking this thread as solved. thank you again, bcooksley. |
![]() Registered Member ![]()
|
sorry to bring this back up, but the fix noted earlier no longer works (at least not consistently).
to get around the problem, i've created a new hook called 00restartkdm with the following code:
is there anything wrong with this workaround? |
![]() Administrator ![]()
|
As far as I am aware, there shouldn't be, assuming it works fine for you with no ill effects ( such as being thrown back to the login screen )
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Registered Member ![]()
|
thanks, bcooksley.
i get the splash screen upon resume, which is expected. i just want to make sure that there are no issues with security or data integrity associated with the workaround. is there a better way to restart the graphics (x server)? edit: i noticed this in pm-suspend.log:
but kdm (and my desktop) starts properly. |
![]() Administrator ![]()
|
There is no issue associated with security, however if it succeeds ( which it seems to not ) then you will likely end up back at the login screen. I do not know of any method to restart the X server as such. Changing to a virtual terminal, then back to X is common to trigger the display to be reconfigured.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered users: Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]