PDA

View Full Version : [FIX] For MCE not working after sleep


sensei73
2008-11-19, 23:47
1-edit /usr/lib/pm-utils/sleep.d/50modules

You should see this:

#!/bin/sh

. "${PM_FUNCTIONS}"

suspend_modules()
{
[ -z "$SUSPEND_MODULES" ] && return 0
for x in $SUSPEND_MODULES ; do
modunload $x
done
return 0
}

2-Kill lirc service and insert and unload your lirc modules likes this (for me lirc_mceusb2 and lirc_dev) WARNING --->lirc_dev MUST be unloaded after your remote module

#!/bin/sh

. "${PM_FUNCTIONS}"

suspend_modules()
{
/etc/init.d/lirc stop
rmmod -k lirc_mceusb2
rmmod -k lirc_dev
[ -z "$SUSPEND_MODULES" ] && return 0
for x in $SUSPEND_MODULES ; do
modunload $x
done
return 0
}
-3- Insert these lines to reload needed modules and restart lirc and resume, like this:
resume_modules()
{
modprobe lirc_mceusb2
modprobe lirc_dev
sleep 1
/etc/init.d/lirc start
modreload
}

And voilà!!!! Resume work with Mce still working!!! Please comment!!!:nod:

sensei73
2008-11-19, 23:51
Please could an Administrator change the tread name to [FIX] For MCE Remote not working after sleep

althekiller
2008-11-20, 00:34
This isn't exactly the correct approach. See /etc/defaults/acpi-support, more specifically the MODULES and STOP_SERVICES variables. If these don't work for pm there's another file /etc/pm/defaults (may need copied from /usr/lib/pm-utils/) which has similar function. For more info, Google is your friend. This is effectively the same thing you're doing, but in the intended way rather than hacking a system script that may well be overwritten on an update.

sensei73
2008-11-20, 01:30
I did try but lirc service sould be off when unloading module. I will change the script by creating a new one like 39remote if it's free.

Ticko
2008-11-20, 23:40
Great work!
I really need this :-), try it later on.

soder
2008-11-21, 10:06
This "sleep" (in the file to edit), is it for "hibernate" or "suspend"?

I have the problem with hibernate, but when the htpc have been in "suspend", the remote works...

/Söder

BLKMGK
2008-11-22, 01:26
No, sleep in that sense is a pause in execution - normally to allow other things to occur. Think of it as a 1 second pause or wait state.

Kryspy
2008-12-03, 00:42
The above didn't work for me.

This works:

Add to top of Suspend section

UnloadLirc() {
/etc/init.d/lirc stop
if [ -f /etc/lirc/hardware.conf ];then
. /etc/lirc/hardware.conf
rmmod $MODULES
fi
}


Add to top of Resume

StartLirc() {
/etc/init.d/lirc start
}


Kryspy