[x86-64] Suspend & Resume

  • Hi, with the demise of W10 I am at last switching my Kodi installation to Linux but so far have had little success with standard Linux distributions due to an issue with HDMI. I have just tried LibreELEC and must admit I am impressed, no HDMI issue so far and it very nearly works perfectly for me. My only issue is suspend and resume....hence this post

    When I suspend the system it more or less immediately resumes.
    I have tried the fundamental fix at the start of the thread [x86-64] Setup for XHCI Suspend/Wakeup, [echo XHC > /proc/acpi/wakeup] to disable XHC wake up, and with that the system suspends and resumes. HOWEVER because XHC is inhibited I can no longer wake the system up though my remote (which is USB connected) and have to press the button on the laptop, a bit of a pain (literally) as its in a cupboard under the TV.

    Any suggestions as to how I can get my systems to suspend and then resume using the USB connected remote?

  • I have chased this and now have a solution.

    The problem was that when I suspended the system it immediately resumed. Lots og Googling and many a dead end but I discovered that the issue was to do with XHC [I didn't have XHCI]. Looking at /proc/acpi/wakeup I had:

    Code
    XHC       S3    *enabled   pci:0000:00:14.0

    I disabled it:

    Code
    echo XHC > /proc/acpi/wakeup

    This allowed suspend to work BUT the remote & USB keyboard didn't cause a resume and I had to physically press the power button. Both my remote and keyboard are USB connected. A bit more digging and I started to question the setting of EHC1 & EHC2, both were disabled in /proc/acpi/wakeup

    Code
    EHC1      S3    *disabled  pci:0000:00:1d.0
    EHC2      S3    *disabled

    I enabled both:

    Code
    echo EHC1 > /proc/acpi/wakeup
    echo EHC2 > /proc/acpi/wakeup

    Suspend worked as did resume when pressing a remote control key or USB keyboard key. I refined this to discover that only EHC1 effected my remote & USB keyboard . Of course my changed settings were lost after a reboot.

    Time to systemd.

    I created a service wakeControl.service in .config/systemd:

    I enabled this service and started it:

    Code
    systemctl enable wakeControl.service
    systemctl start wakeControl.service

    /proc/acpi/wakeup now had this:

    Code
    EHC1      S3    *enabled   pci:0000:00:1d.0
    EHC2      S3    *disabled
    XHC       S3    *disabled  pci:0000:00:14.0

    Happily this state remained after a reboot.