ubuntu亮度无法自动调节终极解决方法
发布时间:2013-06-28 17:27:27 作者:佚名 我要评论
关于ubuntu亮度无法自动调节的问题,纠结了我快两年,主要是自己懒,写了个脚本来调节亮度,不过还是稍显不便。近日兴起折腾了一番,终于找到问题根结了
There are many ways to control brightness. According to this discussion[1] and this wiki page [2], the control method could be divided into these categories:
brightness is controlled by vendor specified hotkey. And there is no interface for OS to adjust brightness.
brightness is controlled by OS:
brightness could be controlled by ACPI
brightness could be controlled by graphic driver.
All methods expose themselves to the user by /sys/class/brightness. And xrandr/xbacklight could use this folder and choose one method to control brightness. But it is still not very clear which one xbacklight prefers by default. See FS#27677 for xbacklight, if you get "No outputs have backlight property." There is a temporary fix if xrandr/xbacklight does not choose the right directory in /sys/class/brightness: You can specify the one you want in xorg.conf by setting the "Backlight" option of the Device section to the name of that directory
brightness is controlled by HW register throught setpci
ACPIIt is often possible to adjust the backlight by ACPI. This controls the actual LEDs or cathodes of the screen. When this ACPI option is available, the illumination is controllable using a GUI slider in the Display/Screen system settings or by simple commands on the CLI.
Different cards might manage this differently. Check /sys/class/backlight to find out:
# ls /sys/class/backlight/intel_backlight
So this particular backlight is managed by an Intel card. It is called acpi_video0 on an ATI card. In the following example, acpi_video0 is used.
The directory contains the following files and folders:
actual_brightness brightness max_brightness subsystem/ uevent
bl_power device/ power/ type
The maximum brightness (often 15) can be found by running cat:
# cat /sys/class/backlight/acpi_video0/max_brightness
15
Brightness can then be set (as root) with echo. Obviously you cannot go any higher than your screen's maximum brightness. The values for maximum brightness and brightness in general vary wildly among cards.
# echo 5 > /sys/class/backlight/acpi_video0/brightness
Sometimes ACPI does not work well due to different motherboard implementations and ACPI quirks. This include some models with dual graphics (e.g. Nvidia-optimus/Radeon with intel (i915)) and some examples with this problem in notebooks such as Dell Studio, Dell XPS 14/15/17 and some Lenovo series, Kamal Mostafa kernel developer make patches for solved this issue included after 3.1 kernel version. You can try adding the following kernel parameters in your bootloader(grub, syslinux...) to adjust ACPI model:
acpi_osi=Linux acpi_backlight=vendor
or
acpi_osi=Linux acpi_backlight=legacy
acpi_backlight=vendor will prefer vendor specific driver (e.g. thinkpad_acpi, sony_acpi, etc.) instead of the ACPI video.ko driver.
看了这个之后,很显然,问题就在于acpi_backlight=vendor will prefer vendor specific driver (e.g. thinkpad_acpi, sony_acpi, etc.) instead of the ACPI video.ko driver.
所以我们只要sudo nano /etc/default/grub,
GRUB_CMDLINE_LINUX="“改为GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor"重启即可,注意大小写Linux的L为大写。
然后sudo update-grub && sudo reboot
本文来源:博客园 作者:浮沉雄鹰
brightness is controlled by vendor specified hotkey. And there is no interface for OS to adjust brightness.
brightness is controlled by OS:
brightness could be controlled by ACPI
brightness could be controlled by graphic driver.
All methods expose themselves to the user by /sys/class/brightness. And xrandr/xbacklight could use this folder and choose one method to control brightness. But it is still not very clear which one xbacklight prefers by default. See FS#27677 for xbacklight, if you get "No outputs have backlight property." There is a temporary fix if xrandr/xbacklight does not choose the right directory in /sys/class/brightness: You can specify the one you want in xorg.conf by setting the "Backlight" option of the Device section to the name of that directory
brightness is controlled by HW register throught setpci
ACPIIt is often possible to adjust the backlight by ACPI. This controls the actual LEDs or cathodes of the screen. When this ACPI option is available, the illumination is controllable using a GUI slider in the Display/Screen system settings or by simple commands on the CLI.
Different cards might manage this differently. Check /sys/class/backlight to find out:
# ls /sys/class/backlight/intel_backlight
So this particular backlight is managed by an Intel card. It is called acpi_video0 on an ATI card. In the following example, acpi_video0 is used.
The directory contains the following files and folders:
actual_brightness brightness max_brightness subsystem/ uevent
bl_power device/ power/ type
The maximum brightness (often 15) can be found by running cat:
# cat /sys/class/backlight/acpi_video0/max_brightness
15
Brightness can then be set (as root) with echo. Obviously you cannot go any higher than your screen's maximum brightness. The values for maximum brightness and brightness in general vary wildly among cards.
# echo 5 > /sys/class/backlight/acpi_video0/brightness
Sometimes ACPI does not work well due to different motherboard implementations and ACPI quirks. This include some models with dual graphics (e.g. Nvidia-optimus/Radeon with intel (i915)) and some examples with this problem in notebooks such as Dell Studio, Dell XPS 14/15/17 and some Lenovo series, Kamal Mostafa kernel developer make patches for solved this issue included after 3.1 kernel version. You can try adding the following kernel parameters in your bootloader(grub, syslinux...) to adjust ACPI model:
acpi_osi=Linux acpi_backlight=vendor
or
acpi_osi=Linux acpi_backlight=legacy
acpi_backlight=vendor will prefer vendor specific driver (e.g. thinkpad_acpi, sony_acpi, etc.) instead of the ACPI video.ko driver.
看了这个之后,很显然,问题就在于acpi_backlight=vendor will prefer vendor specific driver (e.g. thinkpad_acpi, sony_acpi, etc.) instead of the ACPI video.ko driver.
所以我们只要sudo nano /etc/default/grub,
GRUB_CMDLINE_LINUX="“改为GRUB_CMDLINE_LINUX="acpi_osi=Linux acpi_backlight=vendor"重启即可,注意大小写Linux的L为大写。
然后sudo update-grub && sudo reboot
本文来源:博客园 作者:浮沉雄鹰
相关文章
- Canonical 昨日发布新闻稿,正式推出代号为 Oracular Oriole 的 Ubuntu 24.10 发行版,新版在内核方面升级到最新 6.11 版本,并采用 GNOME 47 桌面环境2024-10-12
Ubuntu 24.04 LTS 怎么安装和卸载Docker?
Docker 是一个免费的开源工具,设计用于在容器中构建、部署和运行应用程序,我们将逐步介绍如何在 Ubuntu 24.04 LTS 上安装 Docker2024-09-14- Java是最受欢迎的编程语言之一,怎么在Ubuntu 24.04 LTS中安装和卸载java呢?详细请看下文介绍2024-09-14
- 在Ubuntu 24.04 LTS上设置固定IP地址可以通过图形界面和命令行两种方式来完成,下面我们就来看看详细的教程2024-09-14
Ubuntu 24.04 LTS和22.04 LTS有什么区别? 安装/界面/新功能等对比
2022 年 4 月发布的 Ubuntu 22.04 LTS 相较于 20.04 LTS 带来了诸多引人注目的创新,下面我们从安装、界面、新功能等来介绍区别2024-09-14怎么隐藏Ubuntu顶部状态栏? Ubuntu不显示屏幕上方状态栏的技巧
在Ubuntu系统中,顶部状态栏包括时间显示、网络连接、电源图标等,我们可能需要隐藏顶部状态栏,详细请看下文介绍2024-09-13Ubuntu24.04LTS怎么配置? 安装Ubuntu 24.04 LTS后的10项基本建议
电脑安装完Ubuntu 24.04 LTS后,为了有更好的体验,可以进行必要设置,下面我们来看看系统安装完成后,有哪些设置工作需要做一下2024-09-02老用户如何就地升级到 Ubuntu 24.04 LTS 桌面版?
Canonical 发布了最新的操作系统 Ubuntu 24.04,代号为 Noble Numbat,这是一个 LTS (长期支持)版本,意味着我们将获得未来 长达 5 年更新和支持,详细请看下文安装教程2024-09-02Ubuntu备份全指南:Deja Dup 和 Timeshift 全攻略
对于使用Ubuntu操作系统的用户来说,定期备份数据是确保信息安全和数据完整性的重要举措之一,本文将介绍如何在Ubuntu系统上设置定期备份,确保数据的安全性和可靠性2024-09-02如何制作ubuntu启动盘? 3招教你轻松创建Ubuntu启动盘教程
今天我们就来介绍如何在 Windows、macOS 和 Ubuntu 系统中,制作 Ubuntu 启动盘的几种简单方法,都很简单,详细请看下文介绍2024-09-02
最新评论