HP Envy 14 从睡眠状态唤醒

HP Envy 14 从睡眠状态唤醒

我对笔记本电脑的电源管理内部结构不太熟悉,Ubuntu 11.10 和 HP Envy 14 有点问题。从睡眠状态唤醒(打开盖子)会导致冷却器以最大速度旋转,声音非常大,令人不快。我应该从哪里开始查找?我想其中一个设备在唤醒时会开始耗电?

答案1

这对我运行 11.10 的 HP Envy 14 有效,从http://linuxenvy.blogspot.com/2011/09/ive-been-being-lazy.html?showComment=1315427419402#c4396376300869253470

我在 /usr/lib/pm-utils/sleep.d 中放置了一个脚本,该脚本在挂起时打开独立 GPU,然后将其关闭(如果挂起时是关闭的)。现在,我的功耗在挂起前后相同。就像在 bios 中禁用独立 GPU 时一样。我首先尝试将脚本放入 /etc/pm/sleep.d,但它没有在我的系统(Ubuntu 11.04/lenvyx 64 位 + ugr)上执行。不确定在其他发行版上将其放在哪里。如果感兴趣,您可以在此处获取脚本http://dl.dropbox.com/u/5227387/09_toggle_discrete_gpu,使用风险自负。

将脚本复制到后/usr/lib/pm-utils/sleep.d,使其可执行:

sudo chmod +x /usr/lib/pm-utils/sleep.d/09_toggle_discrete_gpu

如果 DropBox 链接消失,请使用以下代码09_toggle_discrete_gpu

#!/bin/sh
#Script to switch on discrete graphics at suspend to avoid suspend bug on ENVY 14, 
#causing increased power consumption after suspend.
#Author Tinux, line 11-39 stolen almost directly from RM's "switch_between_cards.sh" 
#from at http://asusm51ta-with-linux.blogspot.com/
#DISCLAIMER: I only tested this on my own system and I take no responsibility for any
#harm it might cause to your hardware or software


. "${PM_FUNCTIONS}"

suspend_nm()
{
    pci_integrated=$(lspci | grep VGA | sed -n '1p' | cut -f 1 -d " ")
    pci_discrete=$(lspci | grep VGA | sed -n '2p' | cut -f 1 -d " ")

    integrated=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_integrated | grep -o -P ':.:...:')
    discrete=$(cat /sys/kernel/debug/vgaswitcheroo/switch | grep $pci_discrete | grep -o -P ':.:...:')



    if [ "$integrated" = ":+:Pwr:" ]
    then
     integrated_condition=1
    elif [ "$integrated" = ": :Pwr:" ]
    then
     integrated_condition=1
    elif [ "$integrated" = ": :Off:" ]
    then
     integrated_condition=0
    fi

    if [ "$discrete" = ":+:Pwr:" ]
    then
     discrete_condition=1
    elif [ "$discrete" = ": :Pwr:" ]
    then
     discrete_condition=1
    elif [ "$discrete" = ": :Off:" ]
    then
     discrete_condition=0
    fi

    #Switch ON discrete graphics
    if [ $discrete_condition = 0 ]
    then
        echo ON >  /sys/kernel/debug/vgaswitcheroo/switch
    fi

    echo $discrete_condition > /tmp/condition

}

resume_nm()
{
    #Swtich OFF discrete graphics
    if [ -e /tmp/condition ]
    then
        discrete_condition=`cat /tmp/condition`
        rm /tmp/condition
    fi

    if [ $discrete_condition = 0 ]
    then
        echo OFF > /sys/kernel/debug/vgaswitcheroo/switch
    fi
}

case "$1" in
    hibernate|suspend)
        suspend_nm
        ;;
    thaw|resume)
        resume_nm
        ;;
    *) exit $NA
        ;;
esac

相关内容