{"id":770,"date":"2015-05-03T10:00:17","date_gmt":"2015-05-03T09:00:17","guid":{"rendered":"http:\/\/thogersens.net\/?p=770"},"modified":"2015-05-03T15:34:02","modified_gmt":"2015-05-03T14:34:02","slug":"kodi-mce-remote-and-ubuntu","status":"publish","type":"post","link":"https:\/\/jakobsens.net\/?p=770","title":{"rendered":"Kodi, MCE Remote and Ubuntu"},"content":{"rendered":"<p>I have always had problems with wakeup of my media PC&#8217;s after a suspend or hibernation using my MCE (Microsoft media center) remote.<\/p>\n<p>The problem was solved by enabling wakeup on the USB bus device. On some of my devices I also had to enable port on the ACPI (Advanced Configuration and Power Interface). The grub bootloader parameters might also need some changes.<\/p>\n<p>The first thing to do is finding out which usb port Infrared reciever is connected.<\/p>\n<p>lsusb will list your attached usb devices:<\/p>\n<pre>$ lsusb\r\n Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\r\n Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\n Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\n Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\n Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\r\n Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\n Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\n Bus 003 Device 005: ID 046d:c71f Logitech, Inc. diNovo Mini Wireless Keyboard\r\n Bus 003 Device 004: ID 046d:c71e Logitech, Inc.\r\n Bus 003 Device 003: ID 046d:0b07 Logitech, Inc.\r\n <strong>Bus 003 Device 002: ID 1784:0008 TopSeed Technology Corp. eHome Infrared Transceiver<\/strong>\r\n Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub\r\n Bus 009 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub\r\n Bus 010 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub<\/pre>\n<p>The bold line of text is my usb ir receiver. Use the device id (0008 in my case) with the following command to find your device in \/sys\/bus\/usb\/devices<\/p>\n<pre>$ grep 0008 \/sys\/bus\/usb\/devices\/*\/idProduct\r\n \/sys\/bus\/usb\/devices\/3-1\/idProduct:0008<\/pre>\n<p>Now use that location to check if wakeup from the device is enabled with:<\/p>\n<pre>$ cat \/sys\/bus\/usb\/devices\/3-1\/power\/wakeup\r\n disabled<\/pre>\n<p>The following command will change this setting to enabled:<\/p>\n<pre>$ sudo sh -c 'echo \"enabled\" &gt; \/sys\/bus\/usb\/devices\/3-1\/power\/wakeup'<\/pre>\n<p>This setting will be reset on boot so to enable it on every boot you have to add the line to your \/etc\/rc.local file. You must be root to update the rc.local file.<\/p>\n<pre>$ sudo nano \/etc\/rc.local<\/pre>\n<p>and add the below below line before exit(0):<\/p>\n<pre>echo enabled &gt; \/sys\/bus\/usb\/devices\/3-1\/power\/wakeup<\/pre>\n<p>Save with &lt;Ctrl&gt;o and exit with &lt;Ctrl x&gt;.<\/p>\n<p>Make sure \/etc\/rc.local is executable with the command<\/p>\n<pre>$ sudo chmod +x \/etc\/rc.local<\/pre>\n<p>The next is the ACPI needs to up updated as well. First inspect the ACPI wakeup configuration:<\/p>\n<pre>$ cat \/proc\/acpi\/wakeup \r\nDevice\u00a0 S-state\u00a0\u00a0 Status\u00a0\u00a0 Sysfs node\r\nPCI0\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\u00a0 no-bus:pci0000:00\r\nPEX0\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\u00a0 pci:0000:00:1c.0\r\nPEX1\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\r\nPEX2\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\r\nPEX3\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\u00a0 pci:0000:00:1c.3\r\nPEX4\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\u00a0 pci:0000:00:1c.4\r\nPEX5\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\r\nHUB0\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled\u00a0 pci:0000:00:1e.0\r\n<strong>USB0\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *disabled \u00a0 pci:0000:00:1d.0<\/strong>\r\nUSB1\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *enabled\u00a0\u00a0 pci:0000:00:1d.1\r\n<strong>USB2\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *disabled \u00a0 pci:0000:00:1d.2<\/strong>\r\nUSB3\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *enabled\u00a0\u00a0 pci:0000:00:1a.0\r\nUSB4\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *enabled\u00a0\u00a0 pci:0000:00:1a.1\r\nUSB5\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *enabled\u00a0\u00a0 pci:0000:00:1a.2\r\nUSBE\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *enabled\u00a0\u00a0 pci:0000:00:1d.7\r\n<strong>USE2\u00a0\u00a0\u00a0\u00a0\u00a0 S3\u00a0\u00a0\u00a0 *disabled \u00a0 pci:0000:00:1a.7<\/strong>\r\nAZAL\u00a0\u00a0\u00a0\u00a0\u00a0 S5\u00a0\u00a0\u00a0 *disabled<\/pre>\n<p>As you can see is USB0,USB2 and USE3 not enabled. For you is might be different.<br \/>\nI added the below lines\u00a0 as root to rc.local before exit(0):<\/p>\n<p>$ sudo nano \/etc\/rc.local<\/p>\n<p>The lines add is different to what others recommend. This is because you cat switch enable and disable by executing the <strong>echo\u00a0 &#8220;USB0&#8221; &gt;\u00a0\u00a0 \/proc\/acpi\/wakeup<\/strong> twice.<\/p>\n<pre>status=`cat \/proc\/acpi\/wakeup | grep \"USB0\" | awk {'print $3}'`\r\nif [ \"$status\" = \"disabled\" -o \"$status\" = \"*disabled\" ]; then\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 echo \"USB0\" &gt; \/proc\/acpi\/wakeup\r\nfi\r\nstatus=`cat \/proc\/acpi\/wakeup | grep \"USB2\" | awk {'print $3}'`\r\nif [ \"$status\" = \"disabled\" -o \"$status\" = \"*disabled\" ]; then\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 echo \"USB2\" &gt; \/proc\/acpi\/wakeup\r\nfi\r\nstatus=`cat \/proc\/acpi\/wakeup | grep \"USE2\" | awk {'print $3}'`\r\nif [ \"$status\" = \"disabled\" -o \"$status\" = \"*disabled\" ]; then\r\n\u00a0\u00a0\u00a0\u00a0\u00a0 echo \"USE2\" &gt; \/proc\/acpi\/wakeup\r\nfi\r\n\r\n<\/pre>\n<p>The last thing was changing the grub startup paramerters.<\/p>\n<pre>$ cat \/etc\/default\/grub\r\n# If you change this file, run 'update-grub' afterwards to update\r\n# \/boot\/grub\/grub.cfg.\r\n# For full documentation of the options in this file, see:\r\n#\u00a0\u00a0 info -f grub -n 'Simple configuration'\r\n\r\nGRUB_DEFAULT=0\r\nGRUB_HIDDEN_TIMEOUT=0\r\nGRUB_HIDDEN_TIMEOUT_QUIET=true\r\nGRUB_TIMEOUT=10\r\nGRUB_DISTRIBUTOR=`lsb_release -i -s 2&gt; \/dev\/null || echo Debian`\r\n<strong>GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\"<\/strong>\r\nacpi_enforce_resources=lax\"\r\nGRUB_CMDLINE_LINUX=\"\"\r\n\r\n# Uncomment to enable BadRAM filtering, modify to suit your needs\r\n# This works with Linux (no patch required) and with any kernel that obtains\r\n# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)\r\n#GRUB_BADRAM=\"0x01234567,0xfefefefe,0x89abcdef,0xefefefef\"\r\n\r\n# Uncomment to disable graphical terminal (grub-pc only)\r\n#GRUB_TERMINAL=console\r\n\r\n# The resolution used on graphical terminal\r\n# note that you can use only modes which your graphic card supports via VBE\r\n# you can see them in real GRUB with the command `vbeinfo'\r\n#GRUB_GFXMODE=640x480\r\n\r\n# Uncomment if you don't want GRUB to pass \"root=UUID=xxx\" parameter to Linux\r\n#GRUB_DISABLE_LINUX_UUID=true\r\n\r\n# Uncomment to disable generation of recovery mode menu entries\r\n#GRUB_DISABLE_RECOVERY=\"true\"\r\n\r\n# Uncomment to get a beep at grub start\r\n#GRUB_INIT_TUNE=\"480 440 1\"<\/pre>\n<p>You will have to change the GRUB_CMDLINE_LINUX_DEFAULT (marked bold).<\/p>\n<pre>$ sudo nano \/etc\/default\/grub<\/pre>\n<p>and change<\/p>\n<pre>GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash\"<\/pre>\n<p>to<\/p>\n<pre>GRUB_CMDLINE_LINUX_DEFAULT=\"quiet splash usbcore.autosuspend=-1 acpi_enforce_resources=lax\"\r\n\r\n<\/pre>\n<p>At last you will have to update grub:<\/p>\n<pre>$ sudo update-grub<\/pre>\n<p>Reboot and test.<\/p>\n<p>Enjoy (some of) your suspend problems is over.<\/p>\n<p>&nbsp;<\/p>\n<p>Sources:<\/p>\n<ul>\n<li><a href=\"http:\/\/www.loggn.de\/linux-xbmc-aus-bereitschaftsmodus-per-mce-fernbedienung-aufwecken\/\" target=\"_blank\">http:\/\/www.loggn.de\/linux-xbmc-aus-bereitschaftsmodus-per-mce-fernbedienung-aufwecken\/<\/a><\/li>\n<li><a href=\"http:\/\/forum.kodi.tv\/showthread.php?tid=140123\" target=\"_blank\">http:\/\/forum.kodi.tv\/showthread.php?tid=140123<\/a><\/li>\n<li><a href=\"http:\/\/askubuntu.com\/questions\/129148\/resume-from-suspend-with-mce-remote-doesnt-work-after-mythbuntu-upgrade\" target=\"_blank\">http:\/\/askubuntu.com\/questions\/129148\/resume-from-suspend-with-mce-remote-doesnt-work-after-mythbuntu-upgrade<\/a><\/li>\n<li><a href=\"http:\/\/kodi.wiki\/view\/HOW-TO:Suspend_and_wake_in_Ubuntu\" target=\"_blank\">http:\/\/kodi.wiki\/view\/HOW-TO:Suspend_and_wake_in_Ubuntu<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I have always had problems with wakeup of my media PC&#8217;s after a suspend or hibernation using my MCE (Microsoft media center) remote. The problem was solved by enabling wakeup on the USB bus device. On some of my devices I also had to enable port on the ACPI (Advanced Configuration and Power Interface). The [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[64,65,62,63,4],"class_list":["post-770","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-infrared","tag-kodi","tag-mce","tag-remote","tag-ubuntu"],"_links":{"self":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts\/770","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=770"}],"version-history":[{"count":9,"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts\/770\/revisions"}],"predecessor-version":[{"id":780,"href":"https:\/\/jakobsens.net\/index.php?rest_route=\/wp\/v2\/posts\/770\/revisions\/780"}],"wp:attachment":[{"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=770"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=770"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jakobsens.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=770"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}