Plex HTPC ignores controller

Server Version#: 4.63.0
Player Version#:1.38.0.2734

Hello, I have a problem with the inputmaps for Plex HTPC. The inputs of my controller are not recognized or not logged in Plex HTPC, although it works fine with Plax Media Player. Accordingly, I can also not map the buttons. The inputs should also be logged if the inputmap file is corrupted. So I don’t understand why it is not displayed.

Plex Media Player log file:
PlexMediaPlayer.log (77.1 KB)
Plex HTPC log file:
Plex HTPC.log (107.8 KB)

I don’t think so. If the inputmap file is damaged or invalid, it simply ceases to work.
You might want to post the inputmap file itself.

I tried it with the keyboard. When I delete the keyboard inputmap the log file will still show the keyboard inputs. Same with an intact keyboard inputmap but with a wrong idmatcher.

This is my raw inputmap for my controller:

{
  "name": "Xbox",
  "idmatcher": "Xbox 360 Controller",
  "mapping":  {
    "KEY_HAT_LEFT": "left",
    "KEY_HAT_RIGHT": "right",
    "KEY_HAT_UP": "up",
    "KEY_HAT_DOWN": "down"
  }
}

What happens if you delete your custom controller input map?

Nothing. It does not matter whether the file exists or not. It doesn’t matter what the file contains.

I’ll have to relay the question to the developers.

Unfortunately I have no experience with game controllers on PCs.
I can only assume that perhaps a different app on your PC is interfering and is grabbing all the input signals for itself :man_shrugging:

Like I said, it works with Plex Media Player, the predecessor of Plex HTPC. It is unlikely that the problem is not coming from Plex. :confused:

Okay, this is a bug. It works when I connect the controller after I start Plex HTPC. Like here: Xbox Controller not working Plex HTPC

Where is the best place to report the bug?

libSDL is used for controllers: https://www.libsdl.org/ HTPC has libSDL 2.0.16 which was the latest until yesterday. Though I don’t see the release notes of the newest mentioning anything about controllers on Windows.

So the bug doesn’t come from Plex directly, but from SDL, which is what Plex uses for controllers?

Correct. We use libSDL to read data from controllers. We do ignore libSDL when the app isn’t in the foreground but otherwise every button press/joystick move we get from libSDL is logged. Given the behavior you’ve seen (works if you connect the controller after the app started), it looks like a libSDL bug.

My Xbox Series X controller works perfectly in the old PMP. In Plex HTPC, I need to turn off my controller, launch the application, and then reconnect my controller before it works properly. If this is a libSDL bug, is there any chance of it being fixed?

Experiencing the same issue here – it’s a rather big problem when in a home theatre environment where the controller is the sole input device for the HTPC. Controller has to be on to launch the client; but controller can’t be on when the client launches or input doesn’t work. I basically can’t use the HTPC client in my usual use case until this is fixed, so for now I have to go back to PMP.

I did notice something peculiar: The axis count changes if the controller is connected before the application starts vs if it’s connected after it has started.

Connected before client start (not working):

Apr 05, 2022 16:17:52.734 [4356] INFO - [InputManager] Loading inputmaps from: C:/Program Files/Plex/Plex HTPC/inputmaps
Apr 05, 2022 16:17:52.752 [4356] INFO - [InputManager] Loading inputmaps from: C:/Users/Puulis/AppData/Local/Plex HTPC/inputmaps
Apr 05, 2022 16:17:52.752 [4356] INFO - [InputManager/Keyboard] Successfully inited input
Apr 05, 2022 16:17:52.752 [4356] DEBUG - [InputManager/QHotkey/QHotkeyInput] Initializing.
Apr 05, 2022 16:17:52.752 [4356] WARN - [InputManager/QHotkey/QHotkeyInput] Unable to map shortcut to native keys. Key: Qt::Key_MediaPause Modifiers: QFlags<Qt::KeyboardModifier>(NoModifier)
Apr 05, 2022 16:17:52.752 [4356] WARN - [InputManager/QHotkey/QHotkeyInput] Unable to map shortcut to native keys. Key: Qt::Key_MediaTogglePlayPause Modifiers: QFlags<Qt::KeyboardModifier>(NoModifier)
Apr 05, 2022 16:17:52.752 [4356] INFO - [InputManager/QHotkey] Successfully inited input
Apr 05, 2022 16:17:52.822 [12692] INFO - [Input/SDL] Found 1 joysticks
Apr 05, 2022 16:17:52.824 [12692] INFO - [Input/SDL] JoyStick #0 is Xbox One S Controller with 16 buttons and 6 axes
Apr 05, 2022 16:17:52.824 [4356] INFO - [InputManager/SDL] Successfully inited input
Apr 05, 2022 16:17:52.824 [12692] INFO - [Input/SDL] Detected device was added.
Apr 05, 2022 16:17:52.824 [12692] INFO - [Input/SDL] Found 1 joysticks
Apr 05, 2022 16:17:52.825 [12692] INFO - [Input/SDL] JoyStick #0 is Xbox One S Controller with 16 buttons and 6 axes
Apr 05, 2022 16:17:52.825 [14196] INFO - libCEC was successfully initialized, found version 262151
Apr 05, 2022 16:17:52.826 [4356] INFO - [InputManager/CEC] Successfully inited input

Connected after client start (working):

Apr 05, 2022 16:34:27.196 [13636] DEBUG - [MPVEngine/mpv] cplayer: Done loading scripts.
Apr 05, 2022 16:34:27.196 [19640] INFO - [InputManager] Loading inputmaps from: C:/Program Files/Plex/Plex HTPC/inputmaps
Apr 05, 2022 16:34:27.200 [19640] INFO - [InputManager] Loading inputmaps from: C:/Users/Puulis/AppData/Local/Plex HTPC/inputmaps
Apr 05, 2022 16:34:27.200 [19640] INFO - [InputManager/Keyboard] Successfully inited input
Apr 05, 2022 16:34:27.200 [19640] DEBUG - [InputManager/QHotkey/QHotkeyInput] Initializing.
Apr 05, 2022 16:34:27.200 [19640] WARN - [InputManager/QHotkey/QHotkeyInput] Unable to map shortcut to native keys. Key: Qt::Key_MediaPause Modifiers: QFlags<Qt::KeyboardModifier>(NoModifier)
Apr 05, 2022 16:34:27.200 [19640] WARN - [InputManager/QHotkey/QHotkeyInput] Unable to map shortcut to native keys. Key: Qt::Key_MediaTogglePlayPause Modifiers: QFlags<Qt::KeyboardModifier>(NoModifier)
Apr 05, 2022 16:34:27.200 [19640] INFO - [InputManager/QHotkey] Successfully inited input
Apr 05, 2022 16:34:27.253 [1776] INFO - [Input/SDL] Found 0 joysticks
Apr 05, 2022 16:34:27.253 [19640] INFO - [InputManager/SDL] Successfully inited input
Apr 05, 2022 16:34:27.254 [20108] INFO - libCEC was successfully initialized, found version 262151
Apr 05, 2022 16:34:27.255 [19640] INFO - [InputManager/CEC] Successfully inited input

Apr 05, 2022 16:34:35.789 [19640] INFO - [Web] [AppSplash] Destroying splash screen.
Apr 05, 2022 16:34:39.236 [1776] INFO - [Input/SDL] Detected device was added.
Apr 05, 2022 16:34:39.236 [1776] INFO - [Input/SDL] Found 1 joysticks
Apr 05, 2022 16:34:39.240 [1776] INFO - [Input/SDL] JoyStick #0 is Xbox One S Controller with 16 buttons and 5 axes
Apr 05, 2022 16:34:39.470 [19640] DEBUG - [InputManager] Input received: source: Xbox One S Controller keycode: KEY_HAT_DOWN:0
Apr 05, 2022 16:34:39.470 [19640] DEBUG - [InputManager] Emit input action: ["down"]

The only program I have running on my computer that might be conflicting is Steam, but it doesn’t seem to affect any other programs.

EDIT: Controller is an Xbox One controller model 1708 connected via an XBox Wireless Adapter for Windows, and my OS is Windows 11 21H2 22000.556

I really hope this proves useful (even if you just forward it to the libSDL team) as I’d really like to start using this over PMP and from what I’ve tried so far it seems great.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.