休眠后笔记本放电影和mp3没有声音 (x31+ubuntu8.04)

本文提供了解决x31在休眠后播放音乐或电影时无声的问题,包括通过修改配置文件和创建自定义脚本来自动重启音频混音器的方法。此外,还详细介绍了如何避免在gnome-power-manager运行时执行/etc/acpi/resume.d或/etc/acpi/suspend.d中的命令。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

症状就是每次让x31自己休眠后再启动后放音乐或者电影没声音,程序也不能正常退出。简单的解决方法就是

alsa force-reload

还有更复杂但是应该差不多是全自动的方法

 

After pulling hair trying to figure out what's going on, I've found a slightly more elegant solution to the problem.
The big hint is the fact that nothing under /etc/acpi/resume.d or /etc/acpi/suspend.d is actually executed if the gnome-power-manager is running.

Note: The problem of reloading the mixer still applies. I haven't yet figured out how to programatically reload it after a resume.

Step 1: Modify /etc/default/alsa and change "force_unload_modules_before_suspend" to:

Code:
force_unload_modules_before_suspend="snd_hda_intel"

Step 2: Create /usr/lib/pm-utils/sleep.d/45sound

Code:
#!/bin/bash

if [ ! -x /sbin/alsa ]; then
        exit 0;
fi

case "$1" in
        hibernate|suspend)
                /sbin/alsa suspend
                ;;
        thaw|resume)
                /sbin/alsa resume
                ;;
        *)
                ;;
esac

exit $?

Step 3: Make /usr/lib/pm-utils/sleep.d/45sound executable:

Code:
chmod +x /usr/lib/pm-utils/sleep.d/45sound

That's it. Sound should now work after resuming a suspended eeepc 900 w/ hardy.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值