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
本文来源:博客园 作者:浮沉雄鹰
相关文章

新特性抢先看! Ubuntu 25.04 Beta 发布:Linux 6.14 内核
Canonical公司近日发布了Ubuntu 25.04 Beta版,这一版本被赋予了一个活泼的代号——“Plucky Puffin”(勇敢的海雀),据悉,正式的稳定版预计将在2025年4月17日与广大用户2025-03-29
如何让 Ubuntu 居中显示窗口? 3种方法实现Ubuntu窗口居中显示
个人习惯不管打开终端窗口还是文件管理器窗口,都希望居中显示,不太喜欢Linux下自动随意的摆放位置,下面我们就来看看详细设置方法2025-03-11
Ubuntu 24.04.2 LTS 正式发布: 带来全新硬件支持启用堆栈HWE
buntu 24.04 LTS 的第 2 个小版本Ubuntu 24.04.2 LTS 正式发布,出了修复漏洞以外,它还带来了全新的硬件支持启用堆栈(HWE),让系统性能和硬件兼容性更上一层楼2025-02-25
怎么关闭Ubuntu无人值守升级? Ubuntu禁止自动更新的技巧
Ubuntu Linux系统禁止自动更新的时候,提示“无人值守升级在关机期间,请不要关闭计算机进程”,该怎么解决这个问题?详细请看下文介绍2025-01-20
高效管理你的Linux系统: Debian操作系统常用命令指南
在Debian操作系统中,了解和掌握常用命令对于提高工作效率和系统管理至关重要,本文将详细介绍Debian的常用命令,帮助读者更好地使用和管理Debian系统2025-01-20
debian更新系统的命令怎么用? 轻松配置Debian自动更新的技巧
Debian不手动更新怎么体验新系统?Debian提供了一个既简单又高效的解决办法——自动更新,该怎么用呢?详细请看下文介绍2025-01-20
如何配置Ubuntu无人值守升级? 手动操作实现Ubuntu自动升级技巧
无人值守升级是一个用于自动更新 Debian 和 Ubuntu 系统的开源项目,该项目的主要目的是确保系统能够定期自动安装安全更新,从而保持系统的安全性和稳定性2025-01-20
Ubuntu系统怎么安装Warp? 新一代AI 终端神器安装使用方法
Warp是一款使用Rust开发的现代化AI 终端工具,该怎么再Ubuntu系统中安装使用呢?下面我们就来看看详细教程2025-01-20
Debian如何查看系统版本? 7种轻松查看Debian版本信息的实用方法
Debian是一个广泛使用的Linux发行版,用户有时需要查看其版本信息以进行系统管理、故障排除或兼容性检查,在Debian系统中,有几种不同的方法可以查看版本信息2025-01-17
解决VMware中Ubuntu虚拟机鼠标闪烁或指针位置不正确的方案
刚下载虚拟机后,电脑在虚拟机内出现了鼠标闪烁或者鼠标指针位置不对的问题,该怎么解决呢?下面我们就来看看详细教程2025-01-09







最新评论