Bug 59651 - [Toshiba Satellite R830] brightness control works until sleep
Summary: [Toshiba Satellite R830] brightness control works until sleep
Status: CLOSED WILL_NOT_FIX
Alias: None
Product: ACPI
Classification: Unclassified
Component: BIOS (show other bugs)
Hardware: All Linux
: P1 low
Assignee: Aaron Lu
URL: https://bugs.launchpad.net/ubuntu/+so...
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-12 15:40 UTC by To Do
Modified: 2013-07-08 05:46 UTC (History)
2 users (show)

See Also:
Kernel Version: 3.10.0-031000rc5-generic_3.10.0-031000rc5.201306082135
Subsystem:
Regression: No
Bisected commit-id:


Attachments
Test results as requested by the Kernel testing wiki. (50.15 KB, application/octet-stream)
2013-06-12 15:40 UTC, To Do
Details
The result of sudo acpidump while using this kernel (198.40 KB, application/octet-stream)
2013-06-12 16:43 UTC, To Do
Details
Faulty xorg.conf file (screen flicker) (see comment #17) (6.42 KB, application/octet-stream)
2013-06-22 15:48 UTC, To Do
Details

Description To Do 2013-06-12 15:40:59 UTC
Created attachment 104511 [details]
Test results as requested by the Kernel testing wiki.

On my Toshiba Satellite R830, I have 13.04 AMD64. The Fn + F6, Fn + F7 buttons reduce/increase the brightness level of the screen. The issue is that they stop working after waking my computer from sleep. When this happens I cannot even control brightness by going to "System Settings/Brightness and Lock". I had Ubuntu 12.04 and 12.10 installed before and I had the same identical problem. 

On 12.04 and 12.10 the fommowing solved the problem:

WORKAROUND: I modified /etc/default/grub changing the line:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi_osi=Linux acpi_backlight=vendor"

Then updated grub with:
sudo update-grub

and the problem was solved.

These values are not between 0 and 7 (as the ones in the other directory), but between 284 and 4539, or something like that. Source is http://askubuntu.com/a/196863/27968.

WORKAROUND: In Raring:
echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness

http://www.toshiba.co.uk/innovation/download_bios.jsp?service=UK

Sent an e-mail upstream to: http://marc.info/?l=linux-acpi&m=136975088406475&w=2
Comment 1 To Do 2013-06-12 16:43:52 UTC
Created attachment 104521 [details]
The result of sudo acpidump while using this kernel
Comment 2 Aaron Lu 2013-06-14 07:40:04 UTC
_BCM used by ACPI video driver to control backlight will call into SMI handler, which we do not have any idea what it does. Adding acpi_backlight=vendor will cause ACPI video driver does not create backlight interface, and intel xorg driver will use intel_backlight and everything works. I don't see a way to solve this, I'm afraid you will need to continue to use the command line.
Comment 3 To Do 2013-06-14 08:12:02 UTC
I'm no expert.

Is it possible to simply make the brightness controls change the value of /sys/class/backlight/intel_backlight/brightness instead of /sys/class/backlight/toshiba/brightness?

The ranges are different, but changing the former works before and after wakeup from sleep whereas the latter has an effect on the actual brightness only before putting the computer to sleep.
Comment 4 To Do 2013-06-14 08:26:51 UTC
I tried removing acpi_backlight=vendor from Grub but this causes the brightness to go to 100% on wakeup.

If it might help I could remove acpi_backlight=vendor and go through the testing procedure again.
Comment 5 Aaron Lu 2013-06-14 08:36:32 UTC
(In reply to comment #4)
> I tried removing acpi_backlight=vendor from Grub but this causes the
> brightness
          ~~~~~~~~
do you mean adding?

> to go to 100% on wakeup.
> 
> If it might help I could remove acpi_backlight=vendor and go through the
> testing procedure again.
Comment 6 To Do 2013-06-14 08:55:03 UTC
I meant removing.

I have acpi_backlight=vendor in my grub due to the brightness going to 100% after wakeup. So I removed it temporarily and cycled my computer through sleep and wakeup with the mainline kernel but the problem remained: no control of brightness through the normal means and 100% brightness after wakeup, so now I'm running again with acpi_backlight=vendor.

Maybe I should have tested without the grub command but I didn't think of it. Could testing the mainline kernel again without the grub command help diagnose the problem?
Comment 7 Aaron Lu 2013-06-14 09:02:31 UTC
So the symptoms are:
Without acpi_backlight=vendor, before sleep, backlight works. On wakeup, you get a 100% backlight level, and backlight stops working;
With acpi_backlight=vendor, before and after sleep, backlight always works. The only problem is you will get a 100% backlight level on wakeup.

Is this correct?
Comment 8 To Do 2013-06-14 09:08:56 UTC
No.

Without acpi_backlight=vendor, 
before sleep, backlight works. On wakeup, I
get a 100% backlight level, and backlight controls stop working;

With acpi_backlight=vendor, before sleep, backlight controls work. On wakeup, backlight controls stop working but the brightness level is remembered.
Comment 9 Aaron Lu 2013-06-14 15:36:09 UTC
(In reply to comment #8)
> No.
> 
> Without acpi_backlight=vendor, 

acpi_video interface will be used in this case.

> before sleep, backlight works. On wakeup, I
> get a 100% backlight level, and backlight controls stop working;

Expected behavior, and I don't see a way to solve this since the ACPI video interface will rely on firmware implementation to adjust brightness level, and in this case, firmware chooses to do it in SMI handler which is totally transparent to OS.

> 
> With acpi_backlight=vendor, before sleep, backlight controls work. On wakeup,

intel_backlight interface will be used in this case.

> backlight controls stop working but the brightness level is remembered.

Un-expected.
After wakeup, does manually change brightness for intel_backlight like the following command work?
# cd /sys/class/backlight/intel_backlight
# echo some_value_in_the_min_max_range > brightness

Thanks.
Comment 10 To Do 2013-06-14 16:49:39 UTC
After wakeup, using echo 400 | sudo tee /sys/class/backlight/intel_backlight/brightness does change the brightness level.

With or without acpi_backlight=vendor, the brightness control does not vary the /sys/class/backlight/intel_backlight/brightness value but the /sys/class/backlight/toshiba/brightness value.

Unfortunately, the toshiba/brightness works only before sleep. After wakeup, the value continues to change with the fn + F6 and fn + F7 but without influencing the actual screen brightness.

If you're saying that with acpi_backlight=vendor, the intel_backlight should be used, then that is where the bug lies, because this is not the case. It is the toshiba/brightness value that is being controlled and not intel_backlight/brightness.

In kernel 3.2 and 3.5 I had the problem without acpi_backlight=vendor but adding this command to my grub used to solve it. I noticed that when I added acpi_backlight=vendor with kernel 3.5, the brightness levels changed, that is, there were many more steps in between minimum and maximum.

With kernel 3.8 and 3.10, this does not happen any longer. With or without the acpi_backlight=vendor the brightness steps are exactly the same.

I have to add that, for the workaround to work in kernel 3.2 and 3.5, I had to add a second grub command, that is: acpi_osi=Linux. Without this command adding acpi_backlight=vendor did not solve the problem.

With the recent kernels, acpi_osi=Linux had no effect whatsoever.

Hope this helps in the diagnosis.
Comment 11 Aaron Lu 2013-06-19 13:41:26 UTC
Sorry for replying late.

Please specify the backlight interface to intel_backlight in /etc/X11/xorg.conf, as this example shows:

Section "Device"
Identifier  "Intel Graphics"
Driver      "intel"
Option     "Backlight"          "intel_backlight"
Identifier  "Card0"
Driver      "intel"
BusID       "PCI:0:2:0"
EndSection

And then you do not need to add any kernel command line options and backlight control should work before and after sleep, thanks.
Comment 12 To Do 2013-06-19 14:21:53 UTC
I tried creating an xorg.conf file in /etc/X11 with the text above.

I removed acpi_backlight=vendor from grub and updated grub and rebooted.

I got a black screen with a flashing cursor. Couldn't even change to console with ctrl+alt+F1 and had to force shutdown.

Any clues what happened? I remember I had tried, on a different machine, to create an xorg.conf file and had the same symptoms. Is there the need to set permissions or do something else for this to work?
Comment 13 Aaron Lu 2013-06-19 14:31:17 UTC
Try this: boot into console mode, and then
$ sudo Xorg -configure
Then a new file xorg.conf.new is created in the current directory, you can cut the Device section for intel driver, and add the Backlight option, then make a new file named xorg.conf such that the new file contains only that Device section. Place that new file to /etc/X11/xorg.conf, see if everything works OK.
Comment 14 To Do 2013-06-19 14:41:25 UTC
This may sound stupid, but I'm not sure what "boot into console mode" means.

Ctrl+Alt+F1, Login, lightdm stop ?
Using Recovery mode?
Comment 15 Aaron Lu 2013-06-19 14:45:33 UTC
Perhaps lightdm stop. I don't know much about Ubuntu, try to Google it if stopping lightdm doesn't work. The point is to make sure X is not running, or you can not run Xorg command, thanks.
Comment 16 Aaron Lu 2013-06-20 05:42:13 UTC
Most likely, the following should be OK:

Section "Device"
Option      "Backlight"          "intel_backlight"
Identifier  "Card0"
Driver      "intel"
BusID       "PCI:0:2:0"
EndSection
Comment 17 To Do 2013-06-22 15:46:53 UTC
So I tried to create an xorg.conf file by:

1. Booting in recovery mode
2. Remounting / as read-write with mount -o remount,rw /
3. Configure X with X -configure

I got an error message: "Number of created screens does not match number of detected devices. Configuration failed. Using /root/xorg.conf.new.

I tried ignoring the error message and, before doing any changes I copied the file to /etc/X11/xorg.conf and rebooted.

The display was not functioning normally. There was flicker and the left hand side of the screen, where Unity dash is, was blank.

So, I'm stuck.

I'm attaching the xorg.conf file.
Comment 18 To Do 2013-06-22 15:48:14 UTC
Created attachment 105781 [details]
Faulty xorg.conf file (screen flicker) (see comment #17)
Comment 19 Aaron Lu 2013-06-26 00:58:47 UTC
I don't know much about X, is there any other place you can seek help on this? BTW, did you try the example xorg.conf provided in comment #16?
Comment 20 Aaron Lu 2013-06-28 06:02:18 UTC
ping...
Comment 21 To Do 2013-06-28 06:14:17 UTC
I'm rather busy at the moment. I'll try it in a couple of weeks time. I did not forget this issue. Please be patient with me.
Comment 22 Aaron Lu 2013-06-28 06:17:05 UTC
No problem
Comment 23 Aaron Lu 2013-07-08 05:46:07 UTC
ACPI video's ACPI interface is broken. Use xorg.conf to tell X intel_backlight should be used instead.

Since the remaining of the problem is to figure out how to write the xorg.conf file to specify a driver option(backlight in this case), I'll close this bug.

Note You need to log in before you can comment on or make changes to this bug.