Android TV Remote Control keymap
#31
That's due to differences between keyboard.xml and joystick.xml. What's the correct behavior? I'll update the other keymap so these actions can stay in sync.
Reply
#32
There is no correct behavior. SPMC for example always does a stop on backspace key in fullscreen video. I don't like that behavior. Kodi default backspace behavior for shortpress is conventional Back in fullscreen video, not stop:
xml:
<FullscreenVideo>
  <keyboard>
    <backspace>Fullscreen</backspace>
    <backspace mod="longpress">Stop</backspace>

OK, it is actually Fullscreen action. It probably makes sense to have a consistent behavior. I prefer the Kodi keyboard behavior over SPMC.
Reply
#33
Longpress back to stop as Kodi currently does gets my vote, the amount of times I pressed back by accident in SPMC and it stopped the bloody video Smile
Reply
#34
I still don't get how this whole input stuff really works...

Android TV Remote Control

When I disable peripheral.joystick, all buttons are keyboard buttons. The default mapping is perfect.
When I enable peripheral.joystick, some buttons are keyboard and joystick buttons, and some joystick only:

Back button:
Code:
DEBUG: CAndroidJoystickState:: ProcessEvent(type = key, keycode = 4, action = 1): unpressed
DEBUG: CAndroidJoystickState: setting value for button [4 | 109] to 0
DEBUG: BUTTON [ 4 ] on "virtual-remote" released
DEBUG: FEATURE [ b ] on game.controller.default released
OK/Select button:
Code:
DEBUG: CAndroidJoystickState:: ProcessEvent(type = key, keycode = 23, action = 0): pressed
DEBUG: CAndroidJoystickState:: ProcessEvent(type = key, keycode = 23, action = 1): unpressed
DEBUG: Keyboard: scancode: 0x17, sym: 0x000d, unicode: 0x0000, modifier: 0x0


SONY TV RC MIC 001 (Sony remote control)

All buttons are keyboard buttons no matter whether I enable or disable peripheral.joystick. The difference probably is that the Android TV Remote Control always had some kind of default mapping for the joystick while the Sony remote had none?

The only problem with the Sony remote is that if the remote is in standby, first longpress does not work as the joystick re-detection on remote-resume interrupts the keyboard longpress (see here). Is it somehow possible to completely disable joystick detection?
Reply
#35
(2017-11-13, 20:39)CiNcH Wrote: Is it somehow possible to completely disable joystick detection?

That's ignoring the problem, not fixing it. I've almost got the Back button in joystick mode working like Backspace.
 
(2017-11-13, 20:39)CiNcH Wrote: The only problem with the Sony remote is that if the remote is in standby, first longpress does not work as the joystick re-detection on remote-resume interrupts the keyboard longpress (see here).

I couldn't reproduce with a Shield TV and shield controller. What's the minimum hardware I need to reproduce this?
Reply
#36
Quote:What's the minimum hardware I need to reproduce this?
You probably need a remote that is both, a keyboard and a joystick. Then this remote should suspend itself after some idle time. A keyboard button press then has to wake up the joystick part which triggers a re-detection in Kodi.

I have a Sony TV with Sony RMF-TX200E remote (detected as 'Sony TV RC MIC 001'). I created a video where you can see that the remote is removed after 30s idle time (suspended). It gets re-detected when pressing a button. Buttons are keyboard however, not joystick. If this button press after remote suspend, which effectively wakes up the joystick part again, is a longpress, this longpress becomes a shortpress due to the re-detection. If I disable Bluetooth in the TV, longpress always works properly, as the remote is not detected as joystick anymore. So the joystick detection does not interrupt the remote keyboard button longpress anymore. Buttons are transmitted via infrared, so the remote still works after disabling Bluetooth, however without voice support...

The problem only affects Kodi. Longpress works properly in other parts of the system after remote suspend.

Please also read my summary of the problem here. I did my best to explain the issue as good as I could.
Reply
#37
I have a feeling that fixing the code so that the remote is always detected as a joystick will fix the problem. This seems to happen when a device that was previously connected is reconnected. Once I can reproduce this I'll track down the issue.

The fix for the Back button in Android TV Remote Control app has been merged into master and well be in tonight's nightly.
Reply
#38
(2017-11-17, 22:31)garbear Wrote: The fix for the Back button in Android TV Remote Control app has been merged into master and well be in tonight's nightly.
Looks nice now. Keyboard and joystick behavior are exactly the same now.
 
(2017-11-17, 22:31)garbear Wrote: I have a feeling that fixing the code so that the remote is always detected as a joystick will fix the problem. This seems to happen when a device that was previously connected is reconnected. Once I can reproduce this I'll track down the issue.
Don't get that. The remote is always detected as joystick. Button presses are never jostick though, they are always keyboard. Button presses however wake-up the joystick part of the remote.
Reply
#39
(2017-11-18, 09:27)CiNcH Wrote:
(2017-11-17, 22:31)garbear Wrote: The fix for the Back button in Android TV Remote Control app has been merged into master and well be in tonight's nightly.
Looks nice now. Keyboard and joystick behavior are exactly the same now.  

There's still a difference. Lots of windows in keyboard.xml override the Backspace key. For example, in some windows and dialogs, holding Backscreen goes home via ActivateWindow(Home). In joystick.xml, I didn't include these overrides because I wanted the experience to be the same throughout the GUI. This means no surprises for users.

Do you think we should import any of these to joystick.xml?
 
  • Holding back in TV and Radio guides window sends a 0 keypress
  • Holding back in media windows and their dialogs goes Home
 
(2017-11-18, 09:27)CiNcH Wrote:
(2017-11-17, 22:31)garbear Wrote: I have a feeling that fixing the code so that the remote is always detected as a joystick will fix the problem. This seems to happen when a device that was previously connected is reconnected. Once I can reproduce this I'll track down the issue.
Don't get that. The remote is always detected as joystick. Button presses are never joystick though, they are always keyboard. Button presses however wake-up the joystick part of the remote.   

9 days ago I merged a fix for another bug (PR:12996) where joystick and keyboard code was entangled, causing joystick buttons in games to be delayed until the keyboard longpress timed out. Fixing that may have inadvertently fixed this problem. Have you tried a nightly within the last 8 nights?
Reply
#40
(2017-11-18, 19:00)garbear Wrote: Do you think we should import any of these to joystick.xml?
No strong feelings about that. They sound like some nice shortcuts though. Just didn't know about them which is why I never used them.
 
(2017-11-18, 19:00)garbear Wrote: Have you tried a nightly within the last 8 nights?
Just tried it. Still the same problem unfortunately.
Reply
#41
(2017-11-18, 20:27)CiNcH Wrote:
(2017-11-18, 19:00)garbear Wrote: Do you think we should import any of these to joystick.xml?
No strong feelings about that. They sound like some nice shortcuts though. Just didn't know about them which is why I never used them.
 

K, I'll open a PR for them and get some more opinions.

(2017-11-18, 20:27)CiNcH Wrote:
(2017-11-18, 19:00)garbear Wrote: Have you tried a nightly within the last 8 nights?
Just tried it. Still the same problem unfortunately. 
 
I went through the source and there's a lot of additional info that Android reports. I'll improve the logging to see if we can identify virtual joysticks sooner. This might avoid joystick code interfering with the longpress.

Is your problem occurring both with and without peripheral.joystick enabled?
Reply
#42
(2017-11-18, 20:39)garbear Wrote: Is your problem occurring both with and without peripheral.joystick enabled?
Yes.
Reply
#43
Hey guys,

I have a Sony Android TV KD49X8077 but most likely the same remote control SONY TV RC MIC 001.

I have found some difficulties mapping the PROG+/- buttons for PVR client in full screen live tv mode. Actually if I press PROG+ or - every where in Kodi the TV close the app and switch to HDMI 1 input which is quite annoying (please see: https://forum.kodi.tv/showthread.php?tid=324342).

I have taken SPMC and I could map those buttons but not in KODI Leia and I'm suspecting it comes from the joystick. I found in this thread the suggestion to deactivate the joystick peripheric as workaround. I might try that too.
Reply
#44
@garbear 

I updated to latest nightly and realized that the BACK button in the Android TV Remote Control app is again non-functional. Has this button map been changed? Or do things work differently now?

After disabling the Joystick add-on, Kodi refuses to start. Here is a logcat with crash dump. [DOWNLOAD]


Code:
09-13 17:12:48.977  9877  9917 F libc    : /usr/local/google/buildbot/src/android/ndk-release-r16/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type fmt::v5::format_error: invalid format string" failed
09-13 17:12:48.977  9877  9916 D Kodi    : uncaught exception of type fmt::v5::format_error: invalid format string" failed
09-13 17:12:48.977  9877  9917 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 9917 (Thread-3)
09-13 17:12:48.977  1108  1108 W         : debuggerd: handling request: pid=9877 uid=10167 gid=10167 tid=9917
09-13 17:12:49.082 10033 10033 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-13 17:12:49.082 10033 10033 F DEBUG   : Build fingerprint: 'Sony/BRAVIA_ATV3_4K_EU/BRAVIA_ATV3_4K:7.0/NRD91N.S139/1.6.0.56.29.1.00:user/release-keys'
09-13 17:12:49.082 10033 10033 F DEBUG   : Revision: '0'
09-13 17:12:49.082 10033 10033 F DEBUG   : ABI: 'arm'
09-13 17:12:49.083 10033 10033 F DEBUG   : pid: 9877, tid: 9917, name: Thread-3  >>> org.xbmc.kodi <<<
09-13 17:12:49.083 10033 10033 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
09-13 17:12:49.088 10033 10033 F DEBUG   : Abort message: '/usr/local/google/buildbot/src/android/ndk-release-r16/external/libcxx/../../external/libcxxabi/src/abort_message.cpp:73: abort_message: assertion "terminating with uncaught exception of type fmt::v5::format_error: invalid format string" failed'
09-13 17:12:49.088 10033 10033 F DEBUG   :     r0 00000000  r1 000026bd  r2 00000006  r3 00000008
09-13 17:12:49.088 10033 10033 F DEBUG   :     r4 a4980978  r5 00000006  r6 a4980920  r7 0000010c
09-13 17:12:49.088 10033 10033 F DEBUG   :     r8 a497ffe0  r9 a4980098  sl a4980028  fp a4980080
09-13 17:12:49.088 10033 10033 F DEBUG   :     ip 00000011  sp a497fac8  lr ada14447  pc ada16ca4  cpsr 28000010
09-13 17:12:49.124 10033 10033 F DEBUG   :
09-13 17:12:49.124 10033 10033 F DEBUG   : backtrace:
09-13 17:12:49.126 10033 10033 F DEBUG   :     #00 pc 00049ca4  /system/lib/libc.so (tgkill+12)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #01 pc 00047443  /system/lib/libc.so (pthread_kill+34)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #02 pc 0001d745  /system/lib/libc.so (raise+10)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #03 pc 00019291  /system/lib/libc.so (__libc_android_abort+34)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #04 pc 00017034  /system/lib/libc.so (abort+4)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #05 pc 0001b73f  /system/lib/libc.so (__libc_fatal+22)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #06 pc 0001948b  /system/lib/libc.so (__assert2+18)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #07 pc 0006c005  /data/app/org.xbmc.kodi-2/lib/arm/libc++_shared.so
09-13 17:12:49.126 10033 10033 F DEBUG   :     #08 pc 0006c195  /data/app/org.xbmc.kodi-2/lib/arm/libc++_shared.so
09-13 17:12:49.126 10033 10033 F DEBUG   :     #09 pc 0007c291  /data/app/org.xbmc.kodi-2/lib/arm/libc++_shared.so
09-13 17:12:49.126 10033 10033 F DEBUG   :     #10 pc 0007ba2b  /data/app/org.xbmc.kodi-2/lib/arm/libc++_shared.so (__cxa_throw+86)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #11 pc 00cd60b4  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN3fmt2v520basic_printf_contextINSt6__ndk120back_insert_iteratorINS0_8internal12basic_bufferIcEEEEcNS0_20printf_arg_formatterINS0_17back_insert_rangeIS6_EEEEE6formatEv+1524)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #12 pc 00cd5a5c  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN3fmt2v56printfIcNS0_20basic_printf_contextINSt6__ndk120back_insert_iteratorINS0_8internal12basic_bufferIcEEEEcNS0_20printf_arg_formatterINS0_17back_insert_rangeIS7_EEEEEEEEvRNS6_IT_EENS0_17basic_string_viewISE_EENS0_17basic_format_argsIT0_EE+76)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #13 pc 00cd5978  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN3fmt2v58vsprintfENS0_17basic_string_viewIcEENS0_17basic_format_argsINS0_20basic_printf_contextINSt6__ndk120back_insert_iteratorINS0_8internal12basic_bufferIcEEEEcNS0_20printf_arg_formatterINS0_17back_insert_rangeIS9_EEEEEEEE+88)
09-13 17:12:49.126 10033 10033 F DEBUG   :     #14 pc 00cc5cc4  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN3fmt2v57sprintfIJPKcEEENSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEENS0_17basic_string_viewIcEEDpRKT_+92)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #15 pc 00cc5a6c  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11StringUtils6FormatIJPKcEEENSt6__ndk112basic_stringIcNS3_11char_traitsIcEENS3_9allocatorIcEEEERKS9_DpOT_+364)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #16 pc 00cbdc40  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN4CLog3LogIJPKcEEEviS2_DpOT_+108)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #17 pc 016a8130  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS19CPeripheralJoystick17InitialiseFeatureENS_17PeripheralFeatureE+472)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #18 pc 0169e418  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS11CPeripheral10InitialiseEv+1376)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #19 pc 016c4840  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS12CPeripherals16CreatePeripheralERNS_14CPeripheralBusERKNS_20PeripheralScanResultE+936)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #20 pc 016b1268  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS14CPeripheralBus18RegisterNewDevicesERKNS_21PeripheralScanResultsE+96)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #21 pc 016b12fc  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS14CPeripheralBus14ScanForDevicesEv+112)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #22 pc 016b1ce8  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS14CPeripheralBus17TriggerDeviceScanEv+84)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #23 pc 016c3460  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN11PERIPHERALS12CPeripherals10InitialiseEv+652)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #24 pc 01509034  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN15CServiceManager14InitStageThreeEv+32)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #25 pc 0148aee4  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN12CApplication10InitializeEv+3248)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #26 pc 011eaae8  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (XBMC_Run+124)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #27 pc 00cb7620  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_ZN8CXBMCApp3runEv+88)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #28 pc 00cbd9e8  /data/app/org.xbmc.kodi-2/lib/arm/libkodi.so (_Z10thread_runI8CXBMCAppXadL_ZNS0_3runEvEEEPvS1_+8)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #29 pc 00046f13  /system/lib/libc.so (_ZL15__pthread_startPv+22)
09-13 17:12:49.127 10033 10033 F DEBUG   :     #30 pc 00019cdd  /system/lib/libc.so (__start_thread+6)
Reply
#45
Try again with tomorrows nightly. The bug was fixed at https://github.com/xbmc/xbmc/pull/14430.
Reply

Logout Mark Read Team Forum Stats Members Help
Android TV Remote Control keymap1