我有一个令人沮丧的谜团,我希望有人能指出我正确的方向。
s-tui我主要使用和 来评估手动测试中的频率和负载stress。lsmod | grep intel
snd_soc_intel_hda_dsp_commonintel_tcc_coolingintel_rapl_msrintel_powerclampsnd_sof_pci_intel_cnlsnd_sof_intel_hda_commonsoundwire_intelsoundwire_generic_allocationsoundwire_cadencesnd_sof_intel_hdasnd_sof_pcisnd_sof_xtensa_dspsnd_sofsnd_soc_hdac_hdasnd_hda_ext_coresnd_soc_acpi_intel_matchsnd_soc_acpisoundwire_bussnd_soc_corekvm_intelkvmsnd_hda_intelsnd_intel_dspcfgbtintelsnd_intel_sdw_acpibluetoothsnd_hda_codecintel_cstateintel_wmi_thunderboltsnd_hda_coresnd_pcmintel_rapl_commonintel_soc_dts_iosfintel_pch_thermalsndintel_hidsparse_keymapghash_clmulni_intelaesni_intelcrypto_simdcryptdwmilsmod | grep acpi
snd_soc_acpi_intel_matchsnd_soc_acpisnd_intel_sdw_acpithinkpad_acpinvramledtrig_audioucsi_acpitypec_ucsisndplatform_profileacpi_thermal_relacpi_padvideosudo cpupower frequency-infoanalyzing CPU 0:
driver: acpi-cpufreq
CPUs which run at the same hardware frequency: 0
CPUs which need to have …Run Code Online (Sandbox Code Playgroud) 我在/etc/acpi/events和 中有以下文件/etc/udev/rules.d。
/etc/acpi/events/lidclose
# Pass all events to our one handler script
event=button/lid
action=/etc/acpi/monitors.sh
Run Code Online (Sandbox Code Playgroud)/etc/udev/rules.d/80-monitor.rules
# change monitor settings when monitor is plugged in or o$
ACTION=="change", SUBSYSTEM=="drm", HOTPLUG=="1", RUN+="/etc/acpi/monitors.sh"
Run Code Online (Sandbox Code Playgroud)现在,(可执行并由 root 拥有) /etc/acpi/monitors.sh
#!/bin/sh
# default monitor is LVDS1
STATE=internal
INTERNAL=LVDS1
EXTERNAL=HDMI3
# functions to switch from LVDS1 to VGA and vice versa
function internal {
echo "Switching to internal"
xrandr --output $EXTERNAL --off --output $INTERNAL --auto
STATE=internal
}
function external {
echo "Switching to …Run Code Online (Sandbox Code Playgroud)我使用的是 Linux 发行版,即使在电池充满后我也没有收到任何通知。
是否有任何自定义脚本来运行电池充电状态并在电池充满电时输出声音通知?
我在 Debian 上使用 LXDE。当以用户身份登录 LXDE 时,我可以单击logout菜单中的图标并选择以下选项之一:
shutdownrebootlogoutsuspend但是当我在终端中输入reboot或输入时shutdown -r now,这不起作用。
如何从终端内以用户身份关闭我的系统?我需要一个命令,当我的电池电量严重不足时将执行该命令,以便我的系统可以干净地关闭。
我们正在使用带有默认 GNOME 3 安装的 Debian 7 机器在信息显示器上显示内容。该显示器需要保持打开状态,直到连接的计算机关闭。但是,GNOME 3 会在几分钟后关闭显示。
我似乎无法在系统设置工具或使用 dconf-editor 中找到控制这种行为的方法。有一个突出的谷歌热门建议改变
org.gnome.settings-daemon.plugins.power sleep-display-ac
org.gnome.settings-daemon.plugins.power sleep-display-battery
org.gnome.desktop.session idle-delay
Run Code Online (Sandbox Code Playgroud)
键,但这并没有改变任何东西。
那么,如何在 GNOME 3 中控制和禁用屏幕消隐?
它们似乎都在接收和处理内核事件,那么为什么它们都存在呢?据我所知,与 udev 相比,ACPI 似乎更高级,但除此之外并不能真正说明。
kworker进程消耗一个 CPU 的 75%。有问题的kworker线程与 ACPI 的东西有关:
sudo cat /proc/THE_PID_OF_KWORKER_PROCESS/stack
[<ffffffff85c0c705>] acpi_ns_evaluate+0x1bc/0x23a
[<ffffffff85bffe09>] acpi_ev_asynch_execute_gpe_method+0x98/0xff
[<ffffffff85be4e30>] acpi_os_execute_deferred+0x10/0x20
[<ffffffff8588dc21>] process_one_work+0x181/0x370
[<ffffffff8588de5d>] worker_thread+0x4d/0x3a0
[<ffffffff85893f1c>] kthread+0xfc/0x130
[<ffffffff8588de10>] process_one_work+0x370/0x370
[<ffffffff85893e20>] kthread_create_on_node+0x70/0x70
[<ffffffff858791ba>] do_group_exit+0x3a/0xa0
[<ffffffff85e6a2b5>] ret_from_fork+0x25/0x30
[<ffffffffffffffff>] 0xffffffffffffffff
Run Code Online (Sandbox Code Playgroud)
所以我通过使用一些与 acpi 相关的内核参数重新启动来开始调试,例如:
acpi=off : Completely solves the high cpu usage, but computer no longer suspends.
acpi=ht : no effect, still high cpu usage
pci=noacpi : not booting at all
pnpacpi=off : no effect, still high cpu usage
noapic : worse, 100% cpu usage …Run Code Online (Sandbox Code Playgroud) 在awesome关闭盖子时,WM不会自动停止,所以我跟着一些指示得到它的工作。我只是添加了一个/etc/acpi/local/lid.sh.post包含以下内容的文件:
#!/bin/sh
pm-suspend
Run Code Online (Sandbox Code Playgroud)
暂停现在有效,但是在我打开盖子并按下电源按钮后,它会在再次暂停之前显示桌面几分之一秒!我第二次按下电源按钮时,它会正常恢复。之后,每当我暂停时,我都必须按下电源按钮并等待3次才能正常恢复。我试过连续四次暂停,似乎没有变得更糟。
编辑:我使用的是简单的屏幕锁定服务而不是原始脚本:
[Unit]
Description=Lock X session
Before=sleep.target
[Service]
Environment=DISPLAY=:0
ExecStart=/usr/bin/xautolock -locknow
[Install]
WantedBy=sleep.target
Run Code Online (Sandbox Code Playgroud)
解决了!如果其他人想要它,我制作了一个脚本来在一个命令中执行此操作:
#!/usr/bin/env bash
#
# NAME
# suspend-on-close.sh - Enable suspend when closing laptop lid
#
# SYNOPSIS
# suspend-on-close.sh [options]
#
# DESCRIPTION
# Adds a new "post" event to the ACPI lid close handler
#
# BUGS
# https://github.com/l0b0/tilde/issues
#
# COPYRIGHT
# Copyright © 2013-2014 Victor Engmark. …Run Code Online (Sandbox Code Playgroud) 我有康柏 CQ60-120ec 笔记本。我发现有一个目录/sys/class/thermal/cooling_device2。类型表示LCD。我试图控制冷却设备,它使我的笔记本电脑背光变暗。但我有一个问题,我在互联网上找不到任何地方。为什么它显示为热设备?为什么不作为acpi背光?
拜托,如果你知道为什么会这样,不要怪我不知道 linux。我对 linux 相当了解,但这件事在我的梦想中打上了问号。
当 Linux 内核启动时,它会从系统固件中检索 ACPI 表。系统启动后,我可以使用实用程序从正在运行的内核内存中检索表,例如acpidump
也许这个问题并不是真正针对 Linux 的,因为其他操作系统必须遵循一些类似的过程,但我仍然对 Linux 内核最初如何从系统固件中检索它们感兴趣。我查看了一些内核源代码,但无法直接回答它是如何工作的。