LinuxQuestions.org
Help answer threads with 0 replies.
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-29-2017, 01:03 AM   #16
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301

Are there any other files in /sys/class/backlight/samsung/ ?

If not, do you happen to have a directory "samsung" deep under /sys/devices for the LCD backlight like what we have for intel_backlight?

Last edited by aragorn2101; 05-29-2017 at 01:07 AM.
 
Old 05-29-2017, 05:49 AM   #17
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567

Original Poster
Blog Entries: 19

Rep: Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448
/sys/class/backlight/samsung is actually a symbolic link to /sys/devices/platform/samsung/backlight/samsung. There are several files in there: the backlight-specific ones are brightness, max_brightness, actual_brightness, and bl_power. Brightness is editable: the default levels seem to be 1 for battery operation and 8 for AC power. Actual_brightness is read-only and always equal to brightness. Max_brightness is 8 and also read-only as you would expect. I have no idea what bl_power does, but the value when the system is on charge is 0.

Edit: I just googled and found this:
# Turn off backlight
echo 1 | sudo tee /sys/class/backlight/*/bl_power

# Turn on backlight
echo 0 | sudo tee /sys/class/backlight/*/bl_power

I'm going to try some experiments with this.

Last edited by hazel; 05-29-2017 at 05:53 AM.
 
Old 05-29-2017, 06:56 AM   #18
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567

Original Poster
Blog Entries: 19

Rep: Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448
Nope, that isn't it. Getting the hook script to echo 0 into bl_power doesn't switch the screen on; the trace shows that it was already set to 0.
 
Old 05-30-2017, 08:00 AM   #19
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
I think file /sys/devices/platform/samsung/backlight/samsung/brightness should be monitored closely. It is the equivalent file which I use to change brightness in the tty's for intel_backlight. If this does not work I really don't know any other way.
 
Old 05-31-2017, 11:30 AM   #20
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567

Original Poster
Blog Entries: 19

Rep: Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448
I wrote this script and put it in /etc/pm/sleep.d:
Code:
#! /bin/bash
br=`cat /sys/devices/platform/samsing/backlight/samsung/actual_brightness`
p=`cat /sys/devices/platform/samsing/backlight/samsung/bl_power`
case $1 in
     suspend|hibernate)
          echo "Going to sleep..." >> /root/backlight
          echo "Brightness is $br" >> /root/backlight
          echo "Power setting is $p" >> /root/backlight;;
     resume|thaw)
          echo "Waking up..." >> /root/backlight
          echo "Brightness is $br" >> /root/backlight
          echo "Power setting is $p" >> /root/backlight;;
esac
exit 0
What I got was:

Going to sleep...
Brightness is 1
Power setting is 0
Waking up...
Brightness is 1
Power setting is 0

So everything is the same after waking as it was before going to sleep. It was a nice theory but it doesn't seem to be correct.
 
Old 06-01-2017, 06:02 AM   #21
aragorn2101
Member
 
Registered: Dec 2012
Location: Mauritius
Distribution: Slackware
Posts: 567

Rep: Reputation: 301Reputation: 301Reputation: 301Reputation: 301
Quote:
Originally Posted by hazel View Post
So everything is the same after waking as it was before going to sleep. It was a nice theory but it doesn't seem to be correct.
Yeah, was a nice theory though. Have to rule out solving it using backlight values then. Maybe it's something deeply rooted in viafb.
 
Old 06-01-2017, 06:31 AM   #22
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,567

Original Poster
Blog Entries: 19

Rep: Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448Reputation: 4448
Quote:
Originally Posted by aragorn2101 View Post
Yeah, was a nice theory though. Have to rule out solving it using backlight values then. Maybe it's something deeply rooted in viafb.
That's why I'll now have to try out all the combinations of video quirks that pm-utils provides. But it's disheartening, repetitive work so I can only do it in small sessions. If I find a combo that works, I'll post it here.

Meanwhile I have found a new riddle, so expect another thread.
 
  


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 11:13 PM.

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