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 - Laptop and Netbook
User Name
Password
Linux - Laptop and Netbook Having a problem installing or configuring Linux on your laptop? Need help running Linux on your netbook? This forum is for you. This forum is for any topics relating to Linux and either traditional laptops or netbooks (such as the Asus EEE PC, Everex CloudBook or MSI Wind).

Notices


Reply
  Search this Thread
Old 05-17-2017, 11:09 AM   #1
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Advice needed on how to troubleshoot a video problem when resuming from sleep


This is the next episode of the Samsung saga! I have now got it to resume successfully after hibernation but not after suspend/sleep. The graphics chip causing all the problems is a Via Chrome 9.

The two problems have completely different symptoms:

Resuming from hibernation: screen cycles through colours, keyboard is completely dead. Cause: a misbehaving kernel module (viafb). Solution: a hook script that unloads the module on suspend/hibernate and restores it after thaw/resume.
Resuming from sleep: screen is completely blank but keyboard is active (caps lock switches on the caps led and ctrl-alt-del works normally). Evidently I have a working console but not working video.

There is a pm-utils hook script called 99video which offers itself for troubleshooting video problems but doesn't give any guidance on how to use it.

Bear in mind that I have absolutely no idea how video works. Someone will have to lead me by the hand on this.
 
Old 05-19-2017, 12:12 PM   #2
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
simple answer: it's tricky. it's reverse engineered. it never left beta status on linux, and it never will.
https://duckduckgo.com/?q=linux+via+chrome+9
 
Old 05-21-2017, 12:06 PM   #3
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
I'm still playing about with this. Today I suspended while in X. To my surprise, when I resumed, I got a completely normal view of my desktop for a moment, then it spontaneously went back to sleep again. When I resumed for the second time, I got a wildly distorted screen with multiply overlapping images of my open xterm, although the cursor looked completely normal and moved normally. Text consoles remained black but I was able to switch between them and the lit-up graphical screen.

Anyone know what's going on here?
 
Old 05-24-2017, 04:00 AM   #4
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Hi,

From what I have read, it seems the Via Linux drivers are very unstable. Maybe, for some reason, X crashes when you resume from suspend. Are you using the xf86-video-openchrome driver? Maybe this could help: https://wiki.archlinux.org/index.php/Via.
 
1 members found this post helpful.
Old 05-24-2017, 06:19 AM   #5
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Yes, it is xf86-video-openchrome, which I understand to be maintained nowadays by the xorg people. I know that early versions of this driver are seriously buggy; I had one that came with Dragora that wouldn't let me switch between X and virtual consoles. The version I use now is the latest off the xorg site and it doesn't cause any problems when switching consoles or when resuming from hibernation (provided it doesn't resume with the viafb kernel module loaded). That's why I feel I should be able to make it resume from sleep too.

I don't think X is crashing. If it did, I'd have a black screen. That's what happens in my virtual consoles, but in X I get a proper display, albeit a distorted one.

I had looked before at the Arch wiki. It's usually a very good source but this page is rather out of date. I shall try with their config options all the same, if only to exclude them. I have already excluded some of pm-utils' video quirks.

I also need to find out if waking and immediately going to sleep again is normal repeatable behaviour. Only experiment will tell me.
 
Old 05-24-2017, 12:05 PM   #6
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
I booted with "nomodeset". Again, I started X, opened a terminal and invoked pm-suspend. The laptop went to sleep. After a couple of minutes, I woke it up. The screen came up perfectly, then it went to sleep again.

This time I didn't wake it up immediately. I waited a few more minutes, then woke it. And whaddyaknow! It came up perfectly and stayed up. The virtual consoles are still blank and black but they work otherwise. I was able to shut the machine down normally by blind-typing the shutdown command.

I need to repeat this exact sequence without using nomodeset and see if that makes any difference. Further reports as and when.
 
Old 05-25-2017, 07:47 AM   #7
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
OK, I have now split the problem into three, two of which are solvable.

1) Laptop goes to sleep again immediately after waking up. This turns out only to happen when I invoke suspend by pressing the sleep button, not when I call pm-suspend explicitly. Evidently I'm creating two button events, not one, and the second one gets stored and then processed immediately after waking. Either I'm being heavy handed or the button is oversensitive.

2) X shows distorted images. This only happens when I wake the machine up immediately after it has gone to sleep (an unlikely event in real life). If I let it sleep for a while before resuming, X comes up flawlessly.

3) Black screen on virtual consoles although keyboard still works. This is the problem I haven't solved yet. It definitely isn't anything to do with the openchrome driver because that only gets used under X. I know that when X is not involved, the kernel manages the screen directly, but how does it do that? Is there a non-technical explanation available somewhere?
 
Old 05-26-2017, 01:30 AM   #8
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
So here's the pattern:

If X is running when I suspend, it's still running when I resume and everything works fine. This is the case even if I gave the suspend command from a virtual console. Resume then takes me back to the same console and it's completely black, but alt+F7 takes me back to my desktop.

If X is not running, I don't seem able to start it on resuming. The screen stays black.

If I shut down X after resuming (ctrl+alt+backspace), and then try to restart it, the same thing happens.

BUT: when I look at the Xorg.0.log afterwards, everything looks normal. There are no obvious errors, no sign of a crash. So it looks as if the screen is working normally after all; I just can't see it! And if that is true in X, it's probably true in the virtual console too.

I've been looking up LCDs in howstuffworks. Apparently they are not self-luminous like a crt display; they depend on having a fluorescent tube lit up behind them. Maybe that's just not coming on by itself. Sound reasonable?
 
Old 05-26-2017, 02:33 AM   #9
sanmarino-london-axis
LQ Newbie
 
Registered: May 2017
Posts: 5

Rep: Reputation: Disabled
me too, i can't resume after sleep mode in a twinhead machine.

sound is also completely dead. I have installed the codecs.

so I have to set to hibernate all the time.

sleep worked on my desktop flawlessly.

only I can't get the power button to respond correctly. no matter what option I choose in power manager, pushing the power button always results in my machine to power off.

I am using salixOS 14.2.
 
Old 05-26-2017, 03:37 AM   #10
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Quote:
Originally Posted by hazel View Post
I've been looking up LCDs in howstuffworks. Apparently they are not self-luminous like a crt display; they depend on having a fluorescent tube lit up behind them. Maybe that's just not coming on by itself. Sound reasonable?
Interesting pattern. Yes, LCD's need a backlight. Your hypothesis is possible, but then, how to explain the case where X is running. It seems that the backlight is off only for the virtual consoles.

Can you please paste the content of dmesg for the suspend event in both cases: when X is running and when it is not.
 
Old 05-26-2017, 11:34 AM   #11
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by aragorn2101 View Post
Can you please paste the content of dmesg for the suspend event in both cases: when X is running and when it is not.
OK, relevant parts of dmesg with and without x are attached. Nothing jumps out at me.
Attached Files
File Type: txt dmesg-nox.txt (5.2 KB, 15 views)
File Type: txt dmesg-x.txt (5.3 KB, 16 views)
 
Old 05-26-2017, 11:44 AM   #12
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Quote:
Originally Posted by sanmarino-london-axis View Post
me too, i can't resume after sleep mode in a twinhead machine.

sound is also completely dead. I have installed the codecs.

so I have to set to hibernate all the time.

sleep worked on my desktop flawlessly.

only I can't get the power button to respond correctly. no matter what option I choose in power manager, pushing the power button always results in my machine to power off.

I am using salixOS 14.2.
Please start your own thread instead of hijacking mine. That's not just me being stroppy (though hijacking a thread is generally considered rude), but a serious piece of advice, because a post like the one you just made is unlikely ever to get an answer. You'll do much better at getting help if you create an independent post with a reasonably informative title.

The exception would be if you really had exactly the same problem, but the symptoms you describe suggest otherwise.
 
Old 05-26-2017, 12:59 PM   #13
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
There definitely was something wrong with the backlight setup. In /sys/class/backlight I found a folder link called acpi_video0, but I couldn't (even as root) change any of the brightness values in it.

If I boot with acpi_backlight=vendor, I get a folder link called /sys/class/backlight/samsung containing editable files. That doesn't solve my main problem but it definitely looks more appropriate.

Also I've discovered something odd: if I now echo a number into the backlight brightness file from a virtual console, it changes the appearance of the screen, but in X it doesn't. So something going wrong with the backlight could in theory cause a problem that only affected virtual consoles.

Last edited by hazel; 05-26-2017 at 02:23 PM. Reason: Additional material
 
Old 05-28-2017, 04:14 AM   #14
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Quote:
Originally Posted by hazel View Post
OK, relevant parts of dmesg with and without x are attached. Nothing jumps out at me.
Yes, no big difference. And yes, seems like the backlight is the culprit here. It is possible that when X is running, it restores the backlight to its saved setting in its screen only but the virtual consoles cannot do that on their own.

My laptop boots into runlevel 3 by default. It boots with maximum brightness, so to decrease the brightness in the tty itself at boot I added the following line in /etc/rc.local:
Code:
echo 537 > /sys/devices/pci0000:00/0000:00:02.0/drm/card0/card0-LVDS-1/intel_backlight/brightness
If you can change the brightness in a similar way, then maybe you can try adding that echo line of yours in a file in /etc/pm/sleep.d so that it is executed at resume. Just read the man pages for pm-suspend to know about naming conventions used in that directory.

To ensure that it runs the command at resume only, use
Code:
case "$1" in
  resume|thaw)
    ALL YOUR INSTRUCTIONS
  ;;
  *)
    exit 0
  ;;
esac
 
Old 05-28-2017, 11:30 AM   #15
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,572

Original Poster
Blog Entries: 19

Rep: Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452Reputation: 4452
Another disappointment! I added the following two lines to the resume branch of my viafb hook script:
Code:
cat /sys/class/backlight/samsung/brightness > /root/backlight
echo 1 > /sys/class/backlight/samsung/brightness
The first was for diagnosis, the second (hopefully) for treatment. But it turned out that the existing brightness saved for inspection in /root/backlight was already 1, the normal value for this parameter. So it's not that the backlight isn't switched on. And explicitly giving it a positive value doesn't make any difference.

I am now systematically trying out various quirks, singly and in combination. I hope I can find some combo that works. I hate to be beaten!
 
  


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
Can you stop hard disk spinning up after resuming from sleep? elsmandino Linux - Newbie 1 05-10-2017 11:22 AM
System crashes after resuming from sleep WinAndLinuxTutorials Linux - Hardware 5 03-31-2012 09:23 AM
[SOLVED] automatic script upon resuming from sleep mode R3V0LV3R Slackware 13 02-26-2012 01:44 PM
laptop not resuming from sleep (debian lenny/sid) khaleel5000 Linux - Laptop and Netbook 0 10-10-2009 03:11 AM
Black screen after resuming from sleep berbsd Linux - Laptop and Netbook 2 12-01-2004 10:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Laptop and Netbook

All times are GMT -5. The time now is 05:45 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