RasPlex / OpenPHT

OpenPHT is a community driven fork of Plex Home Theater
Other
596 stars 110 forks source link

Inconsistent Remote keymap on Ubuntu/Debian (vs. Embedded OpenPHT/Rasplex), multiple remote issues #221

Open jwittlincohen opened 7 years ago

jwittlincohen commented 7 years ago

Background: I have been using Rasplex and OpenPHT for years and have generally had an excellent experience. However, in the past I used the embedded Generic version of OpenPHT. I decided to try OpenPHT on Debian because I wanted to use the same system both as a Plex frontend and as a a ZFS backup server. This required a full-featured Linux OS.

I began with Debian, as it is the distribution I'm most accustomed to using. However, I ran into two significant issues. First, I experienced freezing after pausing video for an extended period (more than a minute or two). This also occurred occasionally while navigating menus. When this occurred, Plex was completely non-responsive to keyboard and remote input, requiring me to restart GDM from a SSH terminal. I reported this issue in a separate bug report. The second set of issues relate to OpenPHT's handling of remote input with my Logitech Harmony 650 as well as a standard MCE I use for testing.

The first remote issue I noticed was that the OpenPHT versions for Debian and Ubuntu aren't mapped to the standard MCE keymap, but rather than Plex Home Theater mapping found here: https://support.plex.tv/hc/en-us/articles/201670487-Keyboard-Shortcuts. This was trivial to resolve on Debian, but not so on Ubuntu. I discovered that at least some keys on Ubuntu were not being properly transmitted as keyboard presses. For example, "X" to stop and "Esc" to exit playback/go back to a prior menu work from the keyboard, but do not work when mapped on my Logitech remote. Yet, the same mapping works fine in Debian. As such, the remote simply cannot be used effectively in Ubuntu. The MCE remote is also unusable for these functions. Finally, I experienced some odd remote behavior in Debian such as delayed pausing and unpausing as well as repeated clicking noises (without indication that the remote was second multiple key presses). I did not experience these issues in Ubuntu.

I have spent more than a week trying to troubleshoot these issues. I have tried to be as detailed as possible regarding my setup and the problems I encountered. If any additional details or testing are necessary, please do not hesitate to ask.

Issues:

1) The Debian Jessie (8.0) and Ubuntu Xenial (16.04) OpenPHT binaries do not work with a standard MCE remote keymap. Rather, they use the keymap found at https://support.plex.tv/hc/en-us/articles/201670487-Keyboard-Shortcuts. In contrast, I have tested RasPlex 1.6.2 and 1.7.1 as well as OpenPHT Embedded Generic 1.6.2, 17.1, and 1.8.0. On each of these embedded versions based on OpenELEC/LibreELEC, the standard MCE keymapping works. In each instance, I have used the same remote (Logitech Harmony 650 mapped with MCE keyboard for a custom Plex activity) and IR receiver. I have also used a standard MCE Remote for testing to confirm that my Logitech remote behaves consistently with the MCE remote. All of the testing with OpenPHT have been performed on identical hardware, listed below.

2) Ubuntu Xenial (16.04) with the 4.4.0-66-generic kernel does not appear to be sending remote key presses as keyboard input. I mapped the "Back" button to "Esc", the Stop button to "X", and the pause button to "Space." While pressing these keys on a USB keyboard achieved the desired result, sending the same keypresses via the remote did not do anything. In contrast, the same remote mapping works properly on Debian Jessie with the 3.16 kernel.

3) Debian's IR behavior is buggy. In some instances, when returning to the main menu, I hear an endless stream of clicking. Nonetheless, there is no indication the remote is sending multiple key presses as navigation through menus is otherwise normal. Another annoyance is that pausing and unpausing video in Debian Jessie results in an inconsistent and excessive delay, which is not reproduced on RasPlex, OpenPHT Embedded, or Ubuntu. These issues were all experienced on the stock 3.16 kernel which comes with Debian Jessie. The backports kernel (4.9.0-0.bpo.1-amd64 #1 SMP Debian 4.9.2-2~bpo8+1) is even less functional. It does not work at all, appearing to send no keypresses to OpenPHT. However, I was able to verify that keypresses were being sent and were received by irrecord.

Partial Resolution: If the Play and/or Pause button is bound to the "Play" MCE function rather than to "Spacebar", pausing is smooth and undelayed, in contrast to the stuttering and freezing experienced when binding to Spacebar. However, pressing space on a USB keyboard does not induce these issues.

Expected Behavior:

I expected functionality to be equivalent between Rasplex, OpenPHT Embedded, and the OpenPHT versions for Ubuntu and Debian. As the MCE remote mapping worked on Rasplex and the embedded version of OpenPHT, I expected the same mapping to work with Debian and Ubuntu.

How to Reproduce:

These issues are easy to reproduce as they occurred on stock installs of Debian Jessie and Ubuntu Xenial with multiple versions of OpenPHT. I have provided dmesg output on both Debian and Ubuntu for my IR receiver, in case it is the cause of these issues. However, that is unlikely given that I see normal behavior in Rasplex and OpenPHT Embedded.

Hardware:

OpenPHT Client
Asus P8B WS Motherboard with Latest BIOS (Workstation board for ECC support)
8 GB Crucial DDR3-1333 Unbuffered ECC Memory
Nvidia GT720 passively cooled GPU
OS installed to a mirror of Lexar S77 64GB USB 3.0 flash drives using ZFS
6 x 3TB drives for a backup ZFS pool (not used for OpenPHT)
2 x Intel® 82574L Gigabit ports, single port in use
Corsair TX650 Power Supply with Single 12V rail (85W idle with all drives spinning, 45W with no drives spinning, 115W peak on startup)
Network setup:  All devices are connected to a Cisco Managed Gigabit switch via Cat6 cabling. 
Remote: Logitech Harmony 650 
Note: Using Default Skin

Server: Plex Server 1.3.4.3285 running on Debian Jessie

OS Versions Tested: 
Debian Jessie 8.7 with the standard 3.16.0-4-amd64 (3.16.39-1+deb8u2) kernel.  I also tested with the backports kernel (4.9.0-0.bpo.1-amd64 #1 SMP Debian 4.9.2-2~bpo8+1).

Ubuntu 16.04.2 LTE with the standard 4.4.0-66-generic AMD64 kernel.

OpenPHT 1.6.2, 1.7.1, and 1.8.0 - Genericx86 version

Rasplex 1.62 and 1.7.1 on a Rasberry Pi 3

Dmesg Output for IR Receiver on Ubuntu 16.04.2:

[   43.323360] Registered IR keymap rc-rc6-mce
[   43.323464] input: Media Center Ed. eHome Infrared Remote Transceiver (147a:e042) as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/rc/rc0/input7
[   43.324316] rc0: Media Center Ed. eHome Infrared Remote Transceiver (147a:e042) as /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1.5/2-1.5:1.0/rc/rc0
[   43.334643] IR NEC protocol handler initialized
[   43.335882] IR RC6 protocol handler initialized
[   43.337244] IR RC5(x/sz) protocol handler initialized
[   43.338320] IR JVC protocol handler initialized
[   43.340987] IR SANYO protocol handler initialized
[   43.342001] IR Sony protocol handler initialized
[   43.343985] IR Sharp protocol handler initialized
[   43.346289] input: MCE IR Keyboard/Mouse (mceusb) as /devices/virtual/input/input8
[   43.346697] IR MCE Keyboard/mouse protocol handler initialized
[   43.347062] lirc_dev: IR Remote Control driver registered, major 241
[   43.352778] IR XMP protocol handler initialized
[   43.356006] rc rc0: lirc_dev: driver ir-lirc-codec (mceusb) registered at minor = 0
[   43.356010] IR LIRC bridge handler initialized

Dmesg Output for IR Receiver on Debian Jessie:

[   34.736159] Registered IR keymap rc-rc6-mce
[   34.736326] input: Media Center Ed. eHome Infrared Remote Transceiver (147a:e042) as /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.5/3-1.5:1.0/rc/rc0/input6
[   34.736467] rc0: Media Center Ed. eHome Infrared Remote Transceiver (147a:e042) as /devices/pci0000:00/0000:00:1d.0/usb3/3-1/3-1.5/3-1.5:1.0/rc/rc0
[   34.748456] IR JVC protocol handler initialized
[   34.749100] IR NEC protocol handler initialized
[   34.749962] IR RC6 protocol handler initialized
[   34.749962] IR SANYO protocol handler initialized
[   34.750836] IR RC5(x) protocol handler initialized
[   34.751588] input: MCE IR Keyboard/Mouse (mceusb) as /devices/virtual/input/input7
[   34.751757] IR MCE Keyboard/mouse protocol handler initialized

lsmod output on Debian Jessie:

ir_mce_kbd_decoder     12574  0
ir_rc5_decoder         12433  0
ir_sanyo_decoder       12437  0
ir_rc6_decoder         12433  0
ir_nec_decoder         12433  0
ir_jvc_decoder         12433  0
rc_rc6_mce             12396  0
mceusb                 25194  0
rc_core                22404  13 ir_sharp_decoder,lirc_dev,ir_lirc_codec,ir_rc5_decoder,ir_nec_decoder,ir_sony_decoder,mceusb,ir_mce_kbd_decoder,ir_jvc_decoder,ir_rc6_decoder,ir_sanyo_decoder,rc_rc6_mce

ubuntu-openpht-1.6.2.txt ubuntu-openpht-1.8.0.txt debian-openpht-1.8.0.txt