解决ubuntu(Linux)桌面/应用不插电掉帧问题

news2024/9/27 9:24:42

解决ubuntu(Linux)桌面/应用不插电掉帧问题

笔记本安装的ubuntu的gnome桌面,插电状态下触摸板动画丝滑,翻看浏览器文章的时候也不会有延迟掉帧的情况,但是离开了充电器,电池供电就会掉帧。

思路:在插电模式下,由AC供电。我们只需要设置电脑在电池供电的情况下也保持AC的供电模式
在这里插入图片描述tlp就可以很好的就解决这个问题
安装启用tlp

sudo apt install tlp tlp-rdw
sudo tlp start

执行完上述命令,如果你当前接通电源就会看到如下提示
我安装tlp并启用之后,重启了之后就算是电源模式下也很流畅了,不会掉帧。如果还是不行可能得调整后面的一些配置了
在这里插入图片描述
电池供电如下提示
在这里插入图片描述

我们修改tlp的相关配置
sudo gedit /etc/default/tlp
找到TLP_DEFAULT_MODE选项,设置为AC
此选项表示在无电源下的工作模式

# Operation mode when no power supply can be detected: AC, BAT
# Concerns some desktop and embedded hardware only.
TLP_DEFAULT_MODE=AC

在这里插入图片描述

如果你的这个tlp文件是空白,单独设置这一项也可以,或者可以参考如下链接,查看其他tlp的设置
https://developer.aliyun.com/article/278396

我根据如上这篇帖子自己改了一下自己电脑的

# ------------------------------------------------------------------------------
# tlp - Parameters for power save
# See full explanation: http://linrunner.de/en/tlp/docs/tlp-configuration.html

# Hint: some features are disabled by default, remove the leading # to enable
# them.

# Set to 0 to disable, 1 to enable TLP.
TLP_ENABLE=1

# Operation mode when no power supply can be detected: AC, BAT
# Concerns some desktop and embedded hardware only.
TLP_DEFAULT_MODE=AC

# Seconds laptop mode has to wait after the disk goes idle before doing a sync.
# Non-zero value enables, zero disables laptop mode.
DISK_IDLE_SECS_ON_AC=0
DISK_IDLE_SECS_ON_BAT=2

# Dirty page values (timeouts in secs).
# 开启
MAX_LOST_WORK_SECS_ON_AC=30
MAX_LOST_WORK_SECS_ON_BAT=90

# Hint: CPU parameters below are disabled by default, remove the leading #
# to enable them, otherwise kernel default values are used.

# Select a CPU frequency scaling governor:
#   ondemand, powersave, performance, conservative
# Intel Core i processor with intel_pstate driver:
#   powersave, performance
# Important:
#   You *must* disable your distribution's governor settings or conflicts will
#   occur. ondemand is sufficient for *almost all* workloads, you should know
#   what you're doing!
# 开启
CPU_SCALING_GOVERNOR_ON_AC=ondemand
CPU_SCALING_GOVERNOR_ON_BAT=powersave

# Set the min/max frequency available for the scaling governor.
# Possible values strongly depend on your CPU. For available frequencies see
# tlp-stat output, Section "+++ Processor".
#CPU_SCALING_MIN_FREQ_ON_AC=0
#CPU_SCALING_MAX_FREQ_ON_AC=0
#CPU_SCALING_MIN_FREQ_ON_BAT=0
#CPU_SCALING_MAX_FREQ_ON_BAT=0

# Set Intel P-state performance: 0..100 (%)
# Limit the max/min P-state to control the power dissipation of the CPU.
# Values are stated as a percentage of the available performance.
# Requires an Intel Core i processor with intel_pstate driver.

# 开启
CPU_MIN_PERF_ON_AC=0
CPU_MAX_PERF_ON_AC=100
CPU_MIN_PERF_ON_BAT=1
CPU_MAX_PERF_ON_BAT=30

# Set the CPU "turbo boost" feature: 0=disable, 1=allow
# Requires an Intel Core i processor.
# Important:
# - This may conflict with your distribution's governor settings
# - A value of 1 does *not* activate boosting, it just allows it

# 开启
CPU_BOOST_ON_AC=1
CPU_BOOST_ON_BAT=1

# Minimize number of used CPU cores/hyper-threads under light load conditions
SCHED_POWERSAVE_ON_AC=0
SCHED_POWERSAVE_ON_BAT=1

# Kernel NMI Watchdog:
#   0=disable (default, saves power), 1=enable (for kernel debugging only)
NMI_WATCHDOG=0

# Change CPU voltages aka "undervolting" - Kernel with PHC patch required
# Frequency voltage pairs are written to:
#   /sys/devices/system/cpu/cpu0/cpufreq/phc_controls
# CAUTION: only use this, if you thoroughly understand what you are doing!
#PHC_CONTROLS="F:V F:V F:V F:V"

# Set CPU performance versus energy savings policy:
#   performance, normal, powersave
# Requires kernel module msr and x86_energy_perf_policy from linux-tools
ENERGY_PERF_POLICY_ON_AC=normal
ENERGY_PERF_POLICY_ON_BAT=powersave

# Hard disk devices; separate multiple devices with spaces (default: sda).
# Devices can be specified by disk ID also (lookup with: tlp diskid).
DISK_DEVICES="sda sdb"

# Hard disk advanced power management level: 1..254, 255 (max saving, min, off)
# Levels 1..127 may spin down the disk; 255 allowable on most drives.
# Separate values for multiple devices with spaces.
DISK_APM_LEVEL_ON_AC="254 254"
DISK_APM_LEVEL_ON_BAT="128 128"

# Hard disk spin down timeout:
#   0:        spin down disabled
#   1..240:   timeouts from 5s to 20min (in units of 5s)
#   241..251: timeouts from 30min to 5.5 hours (in units of 30min)
# See 'man hdparm' for details.
#DISK_SPINDOWN_TIMEOUT_ON_AC="0 0"
#DISK_SPINDOWN_TIMEOUT_ON_BAT="0 0"

# Select IO scheduler for the disk devices: noop, deadline, cfq (Default: cfq);
# Separate values for multiple devices with spaces.

# 开启
DISK_IOSCHED="deadline cfq"

# SATA aggressive link power management (ALPM):
#   min_power, medium_power, max_performance
SATA_LINKPWR_ON_AC=medium_power
SATA_LINKPWR_ON_BAT=min_power

# PCI Express Active State Power Management (PCIe ASPM):
#   default, performance, powersave
PCIE_ASPM_ON_AC=default
PCIE_ASPM_ON_BAT=powersave

# Radeon graphics clock speed (profile method): low, mid, high, auto, default;
# auto = mid on BAT, high on AC; default = use hardware defaults.
# (Kernel >= 2.6.35 only, open-source radeon driver explicitly)
RADEON_POWER_PROFILE_ON_AC=high
RADEON_POWER_PROFILE_ON_BAT=low

# Radeon dynamic power management method (DPM): battery, performance
# (Kernel >= 3.11 only, requires boot option radeon.dpm=1)
RADEON_DPM_STATE_ON_AC=performance
RADEON_DPM_STATE_ON_BAT=battery

# Radeon DPM performance level: auto, low, high; auto is recommended.
RADEON_DPM_PERF_LEVEL_ON_AC=auto
RADEON_DPM_PERF_LEVEL_ON_BAT=auto

# WiFi power saving mode: 1=disable, 5=enable; not supported by all adapters.
WIFI_PWR_ON_AC=1
WIFI_PWR_ON_BAT=5

# Disable wake on LAN: Y/N
WOL_DISABLE=Y

# Enable audio power saving for Intel HDA, AC97 devices (timeout in secs).
# A value of 0 disables, >=1 enables power save.
SOUND_POWER_SAVE_ON_AC=0
SOUND_POWER_SAVE_ON_BAT=1

# Disable controller too (HDA only): Y/N
SOUND_POWER_SAVE_CONTROLLER=Y

# Set to 1 to power off optical drive in UltraBay/MediaBay when running on
# battery. A value of 0 disables this feature (Default).
# Drive can be powered on again by releasing (and reinserting) the eject lever
# or by pressing the disc eject button on newer models.
# Note: an UltraBay/MediaBay hard disk is never powered off.
BAY_POWEROFF_ON_BAT=0
# Optical drive device to power off (default sr0).
BAY_DEVICE="sr0"

# Runtime Power Management for PCI(e) bus devices: on=disable, auto=enable
RUNTIME_PM_ON_AC=on
RUNTIME_PM_ON_BAT=auto

# Runtime PM for *all* PCI(e) bus devices, except blacklisted ones:
#   0=disable, 1=enable
RUNTIME_PM_ALL=1

# Exclude PCI(e) device adresses the following list from Runtime PM
# (separate with spaces). Use lspci to get the adresses (1st column).
#RUNTIME_PM_BLACKLIST="bb:dd.f 11:22.3 44:55.6"

# Exclude PCI(e) devices assigned to the listed drivers from Runtime PM
# (should prevent accidential power on of hybrid graphics' discrete part).
# Default is "radeon nouveau"; use "" to disable the feature completely.
# Separate multiple drivers with spaces.
RUNTIME_PM_DRIVER_BLACKLIST="radeon nouveau"

# Set to 0 to disable, 1 to enable USB autosuspend feature.
USB_AUTOSUSPEND=1

# Exclude listed devices from USB autosuspend (separate with spaces).
# Use lsusb to get the ids.
# Note: input devices (usbhid) are excluded automatically (see below)
#USB_BLACKLIST="1111:2222 3333:4444"

# WWAN devices are excluded from USB autosuspend:
# 0=do not exclude / 1=exclude
USB_BLACKLIST_WWAN=1

# Include listed devices into USB autosuspend even if already excluded
# by the driver or WWAN blacklists above (separate with spaces).
# Use lsusb to get the ids.
#USB_WHITELIST="1111:2222 3333:4444"

# Set to 1 to disable autosuspend before shutdown, 0 to do nothing
# (workaround for USB devices that cause shutdown problems).
#USB_AUTOSUSPEND_DISABLE_ON_SHUTDOWN=1

# Restore radio device state (Bluetooth, WiFi, WWAN) from previous shutdown
# on system startup: 0=disable, 1=enable.
# Hint: the parameters DEVICES_TO_DISABLE/ENABLE_ON_STARTUP/SHUTDOWN below
#   are ignored when this is enabled!
RESTORE_DEVICE_STATE_ON_STARTUP=0

# Radio devices to disable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_DISABLE_ON_STARTUP="bluetooth wifi wwan"

# Radio devices to enable on startup: bluetooth, wifi, wwan.
# Separate multiple devices with spaces.
#DEVICES_TO_ENABLE_ON_STARTUP="wifi"

# Radio devices to disable on shutdown: bluetooth, wifi, wwan
# (workaround for devices that are blocking shutdown).
#DEVICES_TO_DISABLE_ON_SHUTDOWN="bluetooth wifi wwan"

# Radio devices to enable on shutdown: bluetooth, wifi, wwan
# (to prevent other operating systems from missing radios).
#DEVICES_TO_ENABLE_ON_SHUTDOWN="wwan"

# Radio devices to enable on AC: bluetooth, wifi, wwan
#DEVICES_TO_ENABLE_ON_AC="bluetooth wifi wwan"

# Radio devices to disable on battery: bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT="bluetooth wifi wwan"

# Radio devices to disable on battery when not in use (not connected):
# bluetooth, wifi, wwan
#DEVICES_TO_DISABLE_ON_BAT_NOT_IN_USE="bluetooth wifi wwan"

# Battery charge thresholds (ThinkPad only, tp-smapi or acpi-call kernel module
# required). Charging starts when the remaining capacity falls below the
# START_CHARGE_TRESH value and stops when exceeding the STOP_CHARGE_TRESH value.
# Main / Internal battery (values in %)
# 开启
START_CHARGE_THRESH_BAT0=40
STOP_CHARGE_THRESH_BAT0=93
# Ultrabay / Slice / Replaceable battery (values in %)
#START_CHARGE_THRESH_BAT1=40
#STOP_CHARGE_THRESH_BAT1=80

# ------------------------------------------------------------------------------
# tlp-rdw - Parameters for the radio device wizard
# Possible devices: bluetooth, wifi, wwan

# Hints:
# - Parameters are disabled by default, remove the leading # to enable them.
# - Separate multiple radio devices with spaces.

# Radio devices to disable on connect.
#DEVICES_TO_DISABLE_ON_LAN_CONNECT="wifi wwan"
#DEVICES_TO_DISABLE_ON_WIFI_CONNECT="wwan"
#DEVICES_TO_DISABLE_ON_WWAN_CONNECT="wifi"

# Radio devices to enable on disconnect.
#DEVICES_TO_ENABLE_ON_LAN_DISCONNECT="wifi wwan"
#DEVICES_TO_ENABLE_ON_WIFI_DISCONNECT=""
#DEVICES_TO_ENABLE_ON_WWAN_DISCONNECT=""

# Radio devices to enable/disable when docked.
#DEVICES_TO_ENABLE_ON_DOCK=""
#DEVICES_TO_DISABLE_ON_DOCK=""

# Radio devices to enable/disable when undocked.
#DEVICES_TO_ENABLE_ON_UNDOCK="wifi"
#DEVICES_TO_DISABLE_ON_UNDOCK=""

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/127117.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

Spring Boot三种跨域解决方案与Spring Security跨域解决方案

跨域解决方案1、什么是跨域2、Spring Boot跨域解决方案1、服务端代码2、前端页面3、运行服务3、Spring Security跨域解决方案1、什么是跨域 什么是跨域,首先可以参考我之前写的这篇文章:JavaWeb跨域问题及解决方案 ,另外我下面会做补充。 很…

unreal中actor的property replicate简单小节

首先参考的网址是官网中的: https://docs.unrealengine.com/5.1/en-US/multiplayer-programming-quick-start-for-unreal-engine/ unreal引擎的版本是5.1 还原的过程相对比较简单,主要的精力花在了编译报错和调试的过程。 属性复制的流程如下&#xff…

尚医通-MongDB简介-安装-概念-操作(十六)

目录 (1)MongDB-简介和安装 (2)MongDB-概念和操作 (1)MongDB-简介和安装 1、NoSQL简介 MongDB为什么要用呢?之前我们用MySQL数据库,如果数据达到一定的量级,或者有高…

QT 之SQLite数据库

文章目录一、windows下使用命令行方法操作db文件1、 安装sqlite2、 使用sqlite二、QT操作sqlite1、 建立数据库2、 打开数据库3 、关闭数据库4、 创建数据表5 、插入数据6、 删除表数据7、 修改表数据8、 查询数据——遍历查询、条件查询一、windows下使用命令行方法操作db文件…

计算机网络期中考试部分题目

1. (1)以太网帧的数据部分是IP数据报,只要数出相应字段所在的字节即可。由图可知以太网帧头部有6+6214字节,IP数据报首部的目的P地址字段前有4x4 16字节,从帧的第1字节开始数141630字节,得目的P…

java怎么完成输出语句

我们在前面的文章和案例中,其实早就知道Java是如何实现输出功能的了。没错,就是利用System.out.println()语句来实现的!接下来壹哥就给大家详细解读一下这个语句的作用及其含义。 1. System 我们先来看看System是个什么东东。 System是Jav…

不推荐别的了,IDEA 自带的数据库工具就很牛逼!

MySQL 等数据库客户端软件市面上非常多了,别的栈长就不介绍了, 其实 IntelliJ IDEA 自带的数据库工具就很牛逼,不信你继续往下看。 本文以 IntelliJ IDEA/ Mac 版本作为演示,其他版本的应该也差距不大! 1、打开数据库…

JPE驱动器维修印刷机驱动器维修JV4-380-1410

印刷机水辘/墨辘/墨斗辊电机马达驱动器维修、墨控电机驱动器维修、JPE驱动器维修。 三菱印刷机电路板维修范围:东洋变频器维修,油墨电机维修,水辊变频器维修,电眼控制板维修,接口板维修,电源维修等。 小森…

【结构型】外观模式(Facade)

目录外观模式(Facade)适用场景外观模式实例代码(Java)外观模式(Facade) 为子系统中的一组接口提供一个一致的界面,外观模式 (Facade) 定义了一个高层接口,这个接口使得这一子系统更加容易使用。 适用场景 要为一个复杂子系统提…

【C++】初级面试整理

C基础 四种类型转换 static_cast:用于良性转换,一般不会导致意外发生,风险很低。常用于基本类型转换到 void,转换父类指针到子类不安全; const_cast:一般用于去掉const属性以及volatile,但是…

如何进行深度数据恢复?分享详细的恢复方法

有时我们会发现保存已久的照片,因为某些误操作导致它们消失了。通过多种方法都没有办法找回,这时该怎么办?不妨尝试下深度数据恢复的方法。它可以帮助我们找到更深层次的数据! 一、恢复数据前的一些问题 很多人都会遇到数据丢失的…

windows环境下安装RocketMQ

文章目录前言一、下载二、环境变量配置三、启动RocketMq1.启动nameserver2.启动broker四、RocketMq控制台安装1.下载2.修改配置文件3.打包4.启动前言 环境要求:JDK1.8Maven 3.2x;64为操作系统 一、下载 官网下载地址:https://rocketmq.apache.org/zh/…

xxljob 的路由策略如何理解,他的选择逻辑是什么(小白阅读)

目录 1 需求2 路由策略2.1 第一个 FIRST2.2 最后一个 LAST2.3 ROUND 轮询2.4 RANDOM :随机2.5 CONSISTENT_HASH:一致性HASH2.6 LEAST_FREQUENTLY_USED:最不经常使用2.7 LEAST_RECENTLY_USED :最近最久未使用2.8 FAILOVER :故障转移2.9 BUSYOVER :忙碌转移1 需求 xxljob …

Ansible变量定义和使用

剧本中使用变量 在playbook中,可以直接定义变量,如下所示: vars:变量名变量值,也可以写在下一级将改成冒号空格值的形式 debug:debug模块,msg消息 引用变量:使用两对{{ }} vim juben.yml - hosts: allvars:bianliang…

extern关键字以及加了头文件引用的作用

0.前言 xdm,今天是阳了的第一天,昨天是高烧,浑身酸痛,今天好多了。。。祝大家健康。 推荐一首歌《不是因为寂寞才想你》。看了《阿凡达2》,感觉没第一部好看哎。 1.extern 之前写过一篇博客extern关键字。今天讲一下和…

fpga实操训练(ip ram和ip fifo)

【 声明:版权所有,欢迎转载,请勿用于商业用途。 联系信箱:feixiaoxing 163.com】 所有的fpga ip当中,用的最多的ip一般有pll、rom、ram和fifo。前面,我们讨论过了rom,rom相比较ram和fifo而言&am…

弹性盒子(flex)

一、什么是弹性盒子 弹性盒子是一种用于按行或按列布局元素的一维布局方法。元素可以膨胀以填充额外的空间,收缩以适应更小的空间。 二、flex 模型说明 主轴(main axis): 是沿着 flex 元素放置的方向延伸的轴(比如页…

【vue】关于vuex的一点补充

1.vuex的基本和下载 1.vuex是一种集中管理模式,举个详细一点的例子就是公共的数据,函数和计算属性,允许任何组件来使用,修改这里面的数据,vuex也可以成为store处理模式,其中一个store示例有state&#xff…

hadoop大数据入门HDFS、MapReduce、YARN的个人通俗理解

大数据时代,在数据量,计算量,计算时间上都是单机无法胜任的,通过简单的增强单机已经无法解决。普遍的解决方案为将多个单机组合起来进行存储和计算的分布式集群来处理。 Hadoop支持使用普通机器组成可拓展的分布式主从集群实现了对大数据的分布式存储(HD…

SpringCloud之Hystrix服务熔断

Hystrix服务熔断1. 服务雪崩2. Hystrix 的概念3. Hystrix 的作用4. 服务熔断4.1 概念4.2 服务熔断解决哪些问题?4.3 案例5. 服务降级5.1 概念5.2 案例6. 服务熔断和降级的区别7. Dashboard 流监控分布式系统面临的问题复杂分布式体系结构中的应用程序有数十个依赖关…