[mythtv-users] Suspend to RAM

Rich West Rich.West at wesmo.com
Mon Oct 29 20:45:56 UTC 2012


On 10/29/2012 1:54 PM, Joey Morris wrote:
> Josu Lazkano <josu.lazkano at gmail.com> wrote on Mon, Oct 29, 2012 at 03:45:08PM +0100:
>> 2012/10/29 Joey Morris <rjmorris at nc.rr.com>:
>>> Thomas Boehm <mythtv-users at lists.boehmi.net> wrote on Mon, Oct 29, 2012 at 01:12:10PM +0000:
>>>> Josu Lazkano wrote:
>>>>> Hello all, I am trying to suspend to RAM from the remote, I read the
>>>>> wiki page: http://www.mythtv.org/wiki/MCE_Remote#S3_.2F_Suspend_To_RAM
>>>>>
>>>>> I am using Debian Wheezy with 3.2 kernel. I try to enable the wakeup this way:
>>>>>
>>>>> # echo enabled > /sys/bus/usb/devices/4-1/power/wakeup
>>>>>
>>>>> Then I can check that it is enabled:
>>>>>
>>>>> $ cat /sys/bus/usb/devices/4-1/power/wakeup
>>>>> enabled
>>>>>
>>>>> But if I reboot the machine, then it is "disabled", how could I fix it?
>>>> Put this command in your /etc/rc.local file before the "exit 0" line.
>>>> Then it will be executed on every boot.
>>> This may work, but the device could change on each reboot (just like
>>> the OPs LIRC receiver, when I also suggested creating a udev rule:
>>> http://www.gossamer-threads.com/lists/mythtv/users/504888#504888).
>> Thanks again, xD.
>>
>> Sorry for my newby question, but I don't understand why I must add a
>> udev rule if the device is always connected in the same USB port (4-1
>> in my case).
> If it's always assigned to device 4-1, then you could get by without a
> udev rule.

Mucking around with the same thing these past few days.  The udev rule is
helpful if written without hard-coding the device and makes it such that you
don't need an rc.local (since Linux is moving away from that design, you'll
have to evolve eventually anyhow):
# enable wake from S3 for MCE USB device 0609:031d
SUBSYSTEM=="usb", ENV{ID_VENDOR_ID}=="0609", ENV{ID_MODEL_ID}=="031d"
RUN+="/bin/sh -c 'echo enabled > /sys
$env{DEVPATH}/../power/wakeup'"

This works when the device is added to the system.  However, when resuming
from suspend mode, the device is already there (udev doesn't kick off). So,
the original poster is correct... the acpi device is reset back to
"disabled" when the system is resumed from sleep/suspend.  You will want to
put a script, equivalent to what you put in your rc.local, in
/etc/pm/sleep.d.  Check
https://wiki.archlinux.org/index.php/Pm-utils#Creating_your_own_hooks for
details on how to do this.

-Rich



More information about the mythtv-users mailing list