Screen brightness on Sony Vaio running M16 - SOLVED

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

I wonder if this would work in grub

Code: Select all

acpi_osi=linux acpi_backlight=vendor
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

Changed to:

Code: Select all

/boot/vmlinuz-3.11.0-12-generic root=UUID=(DisinclinedToType) ro quiet splash acpi_osi=linux acpi_backlight=vendor $vt_handoff
Sadly, that didn't solve the problem. The result of this was the same as when I did this before without the 'acpi_osi=linux' bit - if I try the brightness control the sceen icon comes on and it allows me to decrease it by one 'notch' from full, though it makes no difference to the actual brightness.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

When you get a chance open a terminal and

Code: Select all

acpi_listen
and press the FN+F5 and FN+F6 and post the results, use CTRL+C to stop acpi_listen. Can you change the backlight when booted to the Live CD-not really important
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

Pressing the function keys generated the following:

Code: Select all

sony/hotkey SNC 00000001 00000010
sony/hotkey SNC 00000001 0000003b
sony/hotkey SNC 00000001 00000011
sony/hotkey SNC 00000001 0000003b
Fn+F5 generated the first two lines, Fn+F6 the second two.

And no, I can't adjust the brightness when running Mint from the boot USB.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

Create the following files with the following content (you will need root privileges to do this, so something like "gksu gedit <file>" where <file> is: )

1. /etc/acpi/events/sony-brightness-up, use

Code: Select all

gksu gedit /etc/acpi/events/sony-brightness-up
event=sony/hotkey SNC 00000001 00000011
action=/etc/acpi/brightup.sh

2. /etc/acpi/events/sony-brightness-down

event=sony/hotkey SNC 00000001 00000010
action=/etc/acpi/brightdown.sh

3. /etc/acpi/brightdown.sh

#!/bin/bash
curr=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ $curr -gt 11 ]; then
curr=$((curr-11));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi

4. /etc/acpi/brightup.sh

#!/bin/bash
curr=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ $curr -lt 117 ]; then
curr=$((curr+11));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi

Make all 4 of those scripts executable via:

sudo chmod +x /etc/acpi/events/sony-brightness-up
sudo chmod +x /etc/acpi/events/sony-brightness-down
sudo chmod +x /etc/acpi/brightdown.sh
sudo chmod +x /etc/acpi/brightup.sh

Restart acpid:

sudo service acpid restart

The function keys should now work.


This is copied from a post on ubuntuforums by Toz that I slightly modified, the original thread is http://ubuntuforums.org/archive/index.p ... 84054.html
This should work but may need some tweaking
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

Many thanks. Happy to give this a go but in a lunch break it may be challenging! I shall give this a try later or tomorrow (which has the added benefit of giving you a brief respite!)
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

OK, I created the files by navigating to the directory location, opening in root and then opening in Terminal. In terminal I used the pico command to create the file (i.e. pico <filename>).

For each file I copied and pasted your text, using CTRL-O to write out and CTRL-X to exit. I've double clicked on each of the files and the text in your post is there.

I then did the sudo command to make the files executable (again copying and pasting).

Sadly, the brightness is unaffected, though at least the 'progress bar' under the brightness icon works from minimum to maximum.

Have I done something wrong?
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

Have you restarted the computer or at least restarted apcid with

Code: Select all

sudo service acpid restart
Can you open the files created and paste what is there? I was hoping my old Sony Vaio would have the issue with mint, no such luck, as all hotkeys worked and so did the brightness
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

JeremyB wrote:Have you restarted the computer or at least restarted apcid with

Code: Select all

sudo service acpid restart
Can you open the files created and paste what is there? I was hoping my old Sony Vaio would have the issue with mint, no such luck, as all hotkeys worked and so did the brightness
I did everything you detailed including the acpid restart (which if memory serves generated a couple of lines saying it was stopping and then starting).

Did a reboot as well.

Will post copies of the files a little later...
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

Sgt Peppermint wrote:
JeremyB wrote:Have you restarted the computer or at least restarted apcid with

Code: Select all

sudo service acpid restart
Can you open the files created and paste what is there? I was hoping my old Sony Vaio would have the issue with mint, no such luck, as all hotkeys worked and so did the brightness
I did everything you detailed including the acpid restart (which if memory serves generated a couple of lines saying it was stopping and then starting).

Did a reboot as well.

Will post copies of the files a little later...
OK, here goes.
/etc/acpi/events/sony-brightness-down

Code: Select all

event=sony/hotkey SNC 00000001 00000010
action=/etc/acpi/brightdown.sh
/etc/acpi/events/sony-brightness-up

Code: Select all

event=sony/hotkey SNC 00000001 00000011
action=/etc/acpi/brightup.sh
/etc/acpi/brightdown.sh

Code: Select all

#!/bin/bash
curr=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ $curr -gt 11 ]; then
curr=$((curr-11));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi
/etc/acpi/brightup.sh

Code: Select all

#!/bin/bash
curr=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ $curr -lt 117 ]; then
curr=$((curr+11));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi
As I mentioned, I copied and pasted your text so there wouldn't be any keying errors.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

Sgt Peppermint wrote:
Sgt Peppermint wrote:
JeremyB wrote:Have you restarted the computer or at least restarted apcid with

Code: Select all

sudo service acpid restart
Can you open the files created and paste what is there? I was hoping my old Sony Vaio would have the issue with mint, no such luck, as all hotkeys worked and so did the brightness
I did everything you detailed including the acpid restart (which if memory serves generated a couple of lines saying it was stopping and then starting).

Did a reboot as well.

Will post copies of the files a little later...
OK, here goes.
/etc/acpi/events/sony-brightness-down

Code: Select all

event=sony/hotkey SNC 00000001 00000010
action=/etc/acpi/brightdown.sh
/etc/acpi/events/sony-brightness-up

Code: Select all

event=sony/hotkey SNC 00000001 00000011
action=/etc/acpi/brightup.sh
/etc/acpi/brightdown.sh

Code: Select all

#!/bin/bash
curr=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ $curr -gt 11 ]; then
curr=$((curr-11));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi
/etc/acpi/brightup.sh

Code: Select all

#!/bin/bash
curr=`cat /sys/class/backlight/intel_backlight/actual_brightness`
if [ $curr -lt 117 ]; then
curr=$((curr+11));
echo $curr > /sys/class/backlight/intel_backlight/brightness;
fi
As I mentioned, I copied and pasted your text so there wouldn't be any keying errors.
Does the echo > /sys/class/backlight/intel_backlight/brightness still work to change. I know you tried echo 8 before and it worked. If you go to /sys/class/backlight/intel_backlight/ in file manager you should be able to see what the current brightness and max_brightness settings are as it should be shown on the icon for the files. I am using my smartphone and dont have access to a pc with linuc
Sgt Peppermint

Re: Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

JeremyB wrote:Does the echo > /sys/class/backlight/intel_backlight/brightness still work to change. I know you tried echo 8 before and it worked. If you go to /sys/class/backlight/intel_backlight/ in file manager you should be able to see what the current brightness and max_brightness settings are as it should be shown on the icon for the files. I am using my smartphone and dont have access to a pc with linuc
Yes the echo command still works - I have it in a document on my desktop and the first thing I do when I log in is paste it into a terminal window in order to avoid eye strain. Maybe even sunburn.

Max brightness (if memory serves) is around 4880. I currently set it to 1600.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

A few more to try during boot from a backlight troubleshooting guide
Reboot with kernel parameter video.use_bios_initial_backlight=0 and make a comment on if you can now alter the backlight with hotkeys or a brightness applet.
+ * Reboot with just kernel parameter video.use_bios_initial_backlight=0 and make a comment on if you can now alter the backlight with hotkeys or a brightness applet.
+ * Reboot with just kernel parameter video.use_native_backlight=1 and and make a comment on if you can now alter the backlight with hotkeys or a brightness applet.

Another one is acpi.brightness_enable=1 acpi_backlight=vendor

You are using mint 16 mate? I tried the live dvd for 16 cinnamon on my vaio but my vaio had win vista originally.
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

Linux Mint 16 Cinnamon 32-bit v2.0.14

Pretty much as it came off the install (apart from the addition of a few programs).

I recognise the first two parameters you have there, but I can't remember if and where I ran them, so will have another go.
Last edited by Sgt Peppermint on Fri Apr 25, 2014 12:56 pm, edited 1 time in total.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

Sgt Peppermint wrote:
JeremyB wrote:A few more to try during boot from a backlight troubleshooting guide
Reboot with kernel parameter video.use_bios_initial_backlight=0 and make a comment on if you can now alter the backlight with hotkeys or a brightness applet.
+ * Reboot with just kernel parameter video.use_bios_initial_backlight=0 and make a comment on if you can now alter the backlight with hotkeys or a brightness applet.
+ * Reboot with just kernel parameter video.use_native_backlight=1 and and make a comment on if you can now alter the backlight with hotkeys or a brightness applet.

Another one is acpi.brightness_enable=1 acpi_backlight=vendor

You are using mint 16 mate? I tried the live dvd for 16 cinnamon on my vaio but my vaio had win vista originally.
Will try them later. Presumably these are all put in the same place I put the acpi... thing before?
Yes, in the grub edit linux line
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

Looks like I edited my previous post whilst you were replying to it!

I'd tried the first two of those previously with no joy; tried the acpi ones just now but still all i get is the icon bar moving with no effect on the actual brightness.

In the acpi folder there is a file called asus-keyboard-backlight.sh with two associated files for light up/down in the events folder. Are they of any use? No idea where they came from - they were part of the install.
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

Sgt Peppermint wrote:Looks like I edited my previous post whilst you were replying to it!

I'd tried the first two of those previously with no joy; tried the acpi ones just now but still all i get is the icon bar moving with no effect on the actual brightness.

In the acpi folder there is a file called asus-keyboard-backlight.sh with two associated files for light up/down in the events folder. Are they of any use? No idea where they came from - they were part of the install.
That is for a backlit keyboards unfortunately, after trying to change the brightness try

Code: Select all

cat /var/log/Xorg.0.log | tail
and

Code: Select all

dmesg | tail
to see if any errors are being generated

If nothing else, we can try modifying the bash scripts to use the acpi_video0 backlight

Code: Select all

 /etc/acpi/brightdown.sh

#!/bin/bash
curr=`cat /sys/class/backlight/acpi_video0/actual_brightness`
if [ $curr -gt 1 ]; then
curr=$((curr-1));
echo $curr > /sys/class/backlight/acpi_video0/brightness;
fi
and the other one changed to

Code: Select all

 /etc/acpi/brightup.sh

#!/bin/bash
curr=`cat /sys/class/backlight/acpi_video0/actual_brightness`
if [ $curr -lt 10 ]; then
curr=$((curr+1));
echo $curr > /sys/class/backlight/acpi_video0/brightness;
fi
Sgt Peppermint

Re: Screen brightness on Sony Vaio running M16

Post by Sgt Peppermint »

JeremyB wrote:That is for a backlit keyboards unfortunately, after trying to change the brightness try

Code: Select all

cat /var/log/Xorg.0.log | tail
and

Code: Select all

dmesg | tail
to see if any errors are being generated
cat /var/log/Xorg.0.log | tail resulted in:

Code: Select all

[   254.237] (II) intel(0): EDID vendor "SEC", prod id 14657
[   254.237] (II) intel(0): Printing DDC gathered Modelines:
[   254.237] (II) intel(0): Modeline "1600x900"x0.0  107.62  1600 1648 1680 1888  900 902 908 950 -hsync -vsync (57.0 kHz eP)
[   254.606] (II) intel(0): EDID vendor "SEC", prod id 14657
[   254.606] (II) intel(0): Printing DDC gathered Modelines:
[   254.606] (II) intel(0): Modeline "1600x900"x0.0  107.62  1600 1648 1680 1888  900 902 908 950 -hsync -vsync (57.0 kHz eP)
[   254.859] (II) intel(0): EDID vendor "SEC", prod id 14657
[   254.859] (II) intel(0): Printing DDC gathered Modelines:
[   254.859] (II) intel(0): Modeline "1600x900"x0.0  107.62  1600 1648 1680 1888  900 902 908 950 -hsync -vsync (57.0 kHz eP)
[   328.354] (II) XKB: reuse xkmfile /var/lib/xkb/server-14B7503D830F6433941F279130885A2D664E08AA.xkm
dmesg | tail resulted in:

Code: Select all

[   15.736530] ppdev: user-space parallel port driver
[   17.056417] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
[   17.240366] r8169 0000:0e:00.0 eth0: link down
[   17.240398] r8169 0000:0e:00.0 eth0: link down
[   17.240428] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   17.240744] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[   18.849466] r8169 0000:0e:00.0 eth0: link up
[   18.849474] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[   33.342510] init: anacron main process (1114) killed by TERM signal
[   35.544468] UDF-fs: INFO Mounting volume 'Mar 02 2014', timestamp 2014/03/02 20:28 (103c)
JeremyB wrote:If nothing else, we can try modifying the bash scripts to use the acpi_video0 backlight

Code: Select all

 /etc/acpi/brightdown.sh

#!/bin/bash
curr=`cat /sys/class/backlight/acpi_video0/actual_brightness`
if [ $curr -gt 1 ]; then
curr=$((curr-1));
echo $curr > /sys/class/backlight/acpi_video0/brightness;
fi
and the other one changed to

Code: Select all

 /etc/acpi/brightup.sh

#!/bin/bash
curr=`cat /sys/class/backlight/acpi_video0/actual_brightness`
if [ $curr -lt 10 ]; then
curr=$((curr+1));
echo $curr > /sys/class/backlight/acpi_video0/brightness;
fi
I've edited the files and rebooted. Still struggling...
ClutchDisc

Re: Screen brightness on Sony Vaio running M16

Post by ClutchDisc »

Wow, this thread sure went over my head fast! Wish I could help but this is beyond me! Have you tried anything like this? It's made for Ubuntu, but I don't know, might work for mint too. https://apps.ubuntu.com/cat/application ... ontroller/
JeremyB
Level 21
Level 21
Posts: 13771
Joined: Fri Feb 21, 2014 8:17 am

Re: Screen brightness on Sony Vaio running M16

Post by JeremyB »

I might have an alternative figured out

Code: Select all

#!/bin/bash
max=`cat /sys/class/backlight/acpi_video0/max_brightness`
curr=`cat /sys/class/backlight/acpi_video0/actual_brightness`
if [ $curr -lt $max ]; then
curr=$((curr+1));
echo $curr > /sys/class/backlight/acpi_video0/brightness;
fi
save as brightness_up.sh in your home folder and

Code: Select all

#!/bin/bash
curr=`cat /sys/class/backlight/acpi_video0/actual_brightness`
if [ $curr -gt 1 ]; then
curr=$((curr-1));
echo $curr > /sys/class/backlight/acpi_video0/brightness;
fi
save this as brightness_down.sh in home folder and then in terminal

Code: Select all

chmod +x brightness_up.sh
chmod +x brightness_down.sh
gksudo pluma /etc/rc.local
and add

Code: Select all

chmod a+w /sys/class/backlight/*/brightness
in the file above exit 0 and save

In the Menu there is a program called keyboard shortcuts, click the add button and give it the name brightness-down and for the command enter

Code: Select all

./brightness_down.sh
then click apply. Do the same for one called brightness-up and command will be

Code: Select all

./brightness_up.sh
under the shortcut heading it will say disabled for these, click disabled and it will change from disabled to New Shortcut, press CTRL+up arrow for brightness-up and use CTRL+down arrow for brightness down. Close the keyboard shortcut program and you should have control of the display brightness-although the OSD hasn't shown up in my tests.

Actually, you will likely need a restart unless you do a

Code: Select all

chmod a+w /sys/class/backlight/*/brightness
in terminal
Locked

Return to “Hardware Support”