First longpress after input device standby/resume not working
#1
Problem
The first longpress of a button on the Sony Android TV remote control  after not having used it for >30s always fails. The action of the shortpress is executed instead

Detailed Description
The Sony remote combines 2 functions:
- infrared for the buttons (keyboard from a Kodi point of view)
- Bluetooth for voice input (joystick from a Kodi point of view)

The Bluetooth part is detected as Joystick inside Kodi, which is suspended after a 30s idle time (see here) and is  woken up again when pressing any button, causing the Joystick to be re-detected by Kodi. If the button press which wakes the Bluetooth part is a longpress, the Joystick re-detection seems to reset the key early, effectively resulting in a shortpress. So the Joystick detection seems to have some influence on the keyboard input.

I created a log of the incident:

- play video
- longpress OK: pause
- longpress OK: play
- wait >30 seconds until remote device gets removed
- longpress OK: player controls (shortpress) instead of pause (longpress)

Code:
17:44:53.440 DEBUG: Keyboard: scancode: 0x17, sym: 0x000d, unicode: 0x0000, modifier: 0x0
17:44:53.937 DEBUG: Previous line repeats 1 times.
17:44:53.938 DEBUG: OnKey: long-return (0x100f00d) pressed, action is PlayPause
17:44:53.967 DEBUG: GOT ANNOUNCEMENT, type: 1, from xbmc, message OnPause
...
17:44:53.988 DEBUG: Keyboard: scancode: 0x17, sym: 0x000d, unicode: 0x0000, modifier: 0x0
17:44:56.791 DEBUG: Previous line repeats 17 times.
17:44:56.791 DEBUG: OnKey: long-return (0x100f00d) pressed, action is PlayPause
17:44:56.794 DEBUG: CAnnouncementManager - Announcement: OnPlay from xbmc
...
17:45:27.750  INFO: CPeripheralBusAndroid: input device "SONY TV RC MIC 001" with ID 21 removed
...
17:45:35.689   DEBUG: Keyboard: scancode: 0x17, sym: 0x000d, unicode: 0x0000, modifier: 0x0
17:45:35.733   DEBUG: CPeripheralBusAndroid: input device with ID 22 added
17:45:35.734   DEBUG: GetMappingForDevice - device (054C:0B91) mapped to  (type = joystick)
17:45:35.736 WARNING: Button mapping add-on not present for android/inputdevice/22 (SONY TV RC MIC 001), skipping
17:45:35.737   ERROR: CPeripheralJoystick: Invalid location (android/inputdevice/22)
17:45:35.737   DEBUG: CreatePeripheral - failed to initialise peripheral on 'android/inputdevice/22'
17:45:38.845   DEBUG: OnKey: return (0xf00d) pressed, action is OSD

[FULL LOG]


Workaround
Disabling Bluetooth on the Sony Android TV works around the issue, preventing the (re-)detection of the Joystick on a button press inside Kodi. But it obviously kills voice input, therefore rendering the workaround useless.
Reply


Messages In This Thread
First longpress after input device standby/resume not working - by CiNcH - 2017-10-09, 17:47
Logout Mark Read Team Forum Stats Members Help
First longpress after input device standby/resume not working1