Linux laptop-mode 电池供电时鼠标间歇失灵问题解决

警告

根据 ArchWiki - Laptop Mode Tools,USB 自动休眠功能已经从 usb-autosuspend 模块移动到了 runtime-pm,这篇文章已经过时。

这个问题网上已经有很多人讨论过了。例如解决 Ubuntu 在 laptop-mode(用电池的模式)下 USB 鼠标失效问题一文,把 USB 设备添加到了 AUTOSUSPEND_USBID_BLACKLIST 黑名单中。

我的目的则相对简单,完全禁用 usb-autosuspend 功能,就不必搞这么复杂了。

首先,

sudo vim /etc/laptop-mode/conf.d/usb-autosuspend.conf

找到接近末尾的位置(deivce 的拼写原文如此):

# Trigger auto-suspension of the USB deivce under conditional circumstances
BATT_SUSPEND_USB=0
LM_AC_SUSPEND_USB=0
NOLM_AC_SUSPEND_USB=0

# USB Auto-Suspend timeout in seconds
# Number of seconds after which the USB devices should suspend
AUTOSUSPEND_TIMEOUT=2

BATT_SUSPEND_USBLM_AC_SUSPEND_USBNOLM_AC_SUSPEND_USB 的值改为 0 即可禁用。

或者可以把下面的 AUTOSUSPEND_TIMEOUT 的数值改大一些,毕竟 2 秒钟太短了。


Comments

您可以匿名发表评论,无需登录 Disqus 账号,勾选“我更想匿名评论”后,姓名和电子邮件分别填写“匿名”和“someone@example.com”然后发表评论即可。您也可以登录 Disqus 账号后发表评论。您的评论可能需要经过我审核后才能显示。点赞投票按钮(Reactions)无需登录即可点击。Disqus 评论系统在中国大陆可能无法正常加载和使用。

Statements

Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License

本作品采用知识共享署名—非商业性使用—禁止演绎 4.0 许可协议国际版(CC BY-NC-ND 4.0)进行许可。

This work is licensed under the Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License (CC BY-NC-ND 4.0).

Written by a Human, Not by AI

本作品由人类创作,整体内容符合 Not By AI 90% 规则。人工智能工具仅在有限程度上提供灵感启发、错别字与语法检查,以及在不改变原意的前提下进行润色。所有修改在采纳前均经过作者仔细审阅。

This work was created by a human author, and the overall content complies with the Not By AI 90% Rule. Artificial intelligence tools were used only to a limited extent for idea inspiration, typo and grammar checking, and stylistic refinement without altering the original meaning. All modifications were carefully reviewed by the author before adoption.

Top