Unable to map PROG+/- (CH+/-) buttons in KODI as for SPMC
#1
Hi guys,

I'm using Kodi 18(v. 20171107) and I would need your help to configure the remote control "SONY TV RC MIC 001" for the Android TV KD 49XD8077. I would like to use PROG +/-  buttons to switch channels when using the PVR client from Zattoo or Teleboy. Actually I'm not sure if the remote control is recognized as a keyboard or as a joystick, I have tried the following .xml files under .kodi/userdata/keymaps::


<keymap>
  <FullscreenLiveTV>
    <joystick profile="SONY TV RC MIC 001 (054C:0B91)">
      <button id="166">ChannelUp</button>
      <button id="167">ChannelDown</button>
    </joystick>
  </FullscreenLiveTV>
</keymap>

<keymap>
  <FullscreenLiveTV>
    <keyboard>
      <key id="166">ChannelUp</key>
      <key id="167">ChannelDown</key>
    </keyboard>
  </FullscreenLiveTV>
</keymap>

but both solutions did not work. The key IDs were taken connecting to the TV in debug mode using adb under linux but I'm not sure if they are the right one.
Quote:Tvx-TvPlayer: onUnhandledInputEvent(): event=KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_CHANNEL_UP, scanCode=402, metaState=0, flags=0x8, repeatCount=0, eventTime=191736862, downTime=191736862, deviceId=5, source=0x301 }
11-19 18:58:23.274  3748  3748 I SonyIrbServiceWrapper: isKeyPassThrough keyCode:166

Tvx-TvPlayer: onUnhandledInputEvent(): event=KeyEvent { action=ACTION_DOWN, keyCode=KEYCODE_CHANNEL_DOWN, scanCode=403, metaState=0, flags=0x8, repeatCount=0, eventTime=191830121, downTime=191830121, deviceId=5, source=0x301 }
11-19 19:08:24.122  3128  3128 D SonyIrbServiceWrapper: isKeyPassThrough keyCode:167


I have also tried to use keymap editor but as soon as I press PROG +/- buttons in Kodi the TV goes out from the app and open the HDMI 1 input. The official Zattoo app itself is able to use the PROG +/- buttons to change channels, so I believe it would be possible to use them within Kodi.

I have traced all the mesg related to Joystick Support, Kodi keeps adding and removing configuration and then it fails adding the map for the SONY TV RC MIC 001 remote control as you can see from the log. But at the end it shows this message:

NOTICE: Register - new joystickemulation device registered on application->1: keyboard player (0000:0000)

Does it mean that the remote is seen as keyboard? Can anyone help me?
Log part: https://pastebin.com/raw/qXQUaUDD
Reply
#2
Please do not post log files/snippets directly into our forum, but use websites like pastebin.com instead.
Reply
#3
Ok sorry was my first post.
Reply
#4
Hello guys,

I have test the SPMC app because people from Sony forum did not experienced the same problem with that. In fact by looking at the spmc.log there is nothing about the "SONY TV RC MIC 001" device, so I guess is not recognized and automatically set to keyboard. If I click on PROG +/- in the log file I can now see:
 
Quote:23:16:39.459 T:18446744071701535008   DEBUG: webserver: request received for /acr_enabled
23:16:39.614 T:18446744072058964256   DEBUG: Keyboard: scancode: 0xa6, sym: 0x0158, unicode: 0x0000, modifier: 0x0
23:16:39.614 T:18446744072058964256   DEBUG: OnKey: channel_up (0xf0ed) pressed, action is
23:16:40.432 T:18446744072058964256   DEBUG: Keyboard: scancode: 0xa7, sym: 0x0159, unicode: 0x0000, modifier: 0x0
23:16:40.432 T:18446744072058964256   DEBUG: OnKey: channel_down (0xf0ee) pressed, action is 
And by using keymap editor addon I can map the PROG +/- buttons to channel up/down action under FullscreenLiveTV->PVR. Now the question is what is wrong in the mapping of Kodi Leila? I can I force Kodi behaving as SPMC.
Reply
#5
For your information, the keymap setting that works on SMPC is:
Quote:<keymap>
    <fullscreenlivetv>
    <keyboard>
      <key id="61677">channelup</key>
      <key id="61678">channeldown</key>
    </keyboard>
  </fullscreenlivetv>
</keymap>
I have tried to do the same on Kodi 18 latest nightly but no luck. I have been tracing all CPeripheralBusAndroid calls and I have found that the device is added and removed continuously
Quote:INFO: CPeripheralBusAndroid: input device "SONY TV RC MIC 001" with ID 46 detected
DEBUG: Failed to load button map for "SONY TV RC MIC 001"
INFO: CPeripheralBusAndroid: input device "SONY TV RC MIC 001" with ID 46 removed
DEBUG: CPeripheralBusAndroid: input device with ID 47 added
DEBUG: GetMappingForDevice - device (054C:0B91) mapped to  (type = joystick)
DEBUG: Failed to load button map for "SONY TV RC MIC 001"
INFO: CPeripheralBusAndroid: input device "SONY TV RC MIC 001" with ID 47 removed
DEBUG: CPeripheralBusAndroid: input device with ID 48 added
DEBUG: GetMappingForDevice - device (054C:0B91) mapped to  (type = joystick)
DEBUG: Failed to load button map for "SONY TV RC MIC 001"
but then if I press two recognized buttons like stop and play they seem to be mapped as keybord:
Quote:DEBUG: Keyboard: scancode: 0x7e, sym: 0x00b3, unicode: 0x0000, modifier: 0x0
DEBUG: Previous line repeats 1 times.
DEBUG: HandleKey: play_pause (0xf0bd) pressed, action is PlayPause
DEBUG: Keyboard: scancode: 0x56, sym: 0x00b2, unicode: 0x0000, modifier: 0x0
DEBUG: HandleKey: stop (0xf0bc) pressed, action is Stop
DEBUG: Keyboard: scancode: 0x56, sym: 0x00b2, unicode: 0x0000, modifier: 0x0
Is there a bug on the mapping in Kodi Leia? If so, I could stop playing with that
Reply
#6
Still, I don't manage to make some buttons working as I would. Anybody who could help me?
Reply
#7
Did you fix that issue with Kodi18?
Reply
#8
Don't you have to use the keyboard scancode to map the action? My keymap for CH+/CH- would therefore look like that:
Code:
<keymap>
  <fullscreenlivetv>
    <keyboard>
      <key id="166">channelup</key>
      <key id="167">channeldown</key>
    </keyboard>
  </fullscreenlivetv>
</keymap>
Reply
#9
If I'm not mistaken, this is the first test I did at the beginning and described in my first post but it did not work. Is Kodi case-sensitive? Did the map work for you? In my case as soon as I press CH up or down the TV goes to the HDMI input. On SPMC the keymap did not work neither but at least CH +/- buttons do not close the app.
Reply
#10
(2018-01-16, 11:57)aesthetiker Wrote: Did you fix that issue with Kodi18?
 Not yet. Are the default keymaps stored somewhere? I would like to compare them against SPMC to see first of all how they manage to reserve the usage of the CH+/- buttons
Reply
#11
(2018-01-17, 00:51)Hìr0 Wrote:
(2018-01-16, 11:57)aesthetiker Wrote: Did you fix that issue with Kodi18?
 Not yet. Are the default keymaps stored somewhere? I would like to compare them against SPMC to see first of all how they manage to reserve the usage of the CH+/- buttons

https://github.com/xbmc/xbmc/tree/master/system/keymaps
https://github.com/kodi-game/peripheral....onmaps/xml

Those are the keymap (wiki) files as installed. If you have any locally generated ones they will be in the keymaps folder in your userdata (wiki) folder, and entries in those will override equivalent entries in the default ones. You can have multiple keymap files, and they are loaded in order (so they can also override each other, last one loaded wins if they all have the same entry set in them). You can find more details on the linked wiki pages.
|Banned add-ons (wiki)|Forum rules (wiki)|VPN policy (wiki)|First time user (wiki)|FAQs (wiki) Troubleshooting (wiki)|Add-ons (wiki)|Free content (wiki)|Debug Log (wiki)|

Kodi Blog Posts
Reply
#12
I have almost tried all possible combinations. I did another attempt trying to remap the number 0 to 9 for testing purpose and it worked. There might be something wrong in Kodi for CH+/- buttons or I'm still missing something. Other apps like xplore or zattoo are able to use those buttons to scroll Up/Down a page or change channels. 
Quote:<keymap>
  <FullscreenLiveTV>
    <keyboard>
      <channel_up>ChannelUp</channel_up>
      <channel_down>ChannelDown</channel_down>
      <key id="166">ChannelUp</key>
      <key id="167">ChannelDown</key>
      <pageplus>ChannelUp</pageplus>
      <pageminus>ChannelDown</pageminus>
      <zero>Number9</zero>
    </keyboard>
    <remote>
      <pageplus>ChannelUp</pageplus>
      <pageminus>ChannelDown</pageminus>
      <channel_up>ChannelUp</channel_up>
      <channel_down>ChannelDown</channel_down>
      <key id="166">ChannelUp</key>
      <key id="167">ChannelDown</key>
      <zero>Number9</zero>
    </remote>
  </FullscreenLiveTV>  
</keymap>
Reply
#13
I did a further test. I have overloaded all keymaps files from spmc in Kodi but still when I press PROG+/- buttons the TV goes out from the app and opens the last watched HDMI input. I have installed again SPMC and nothing happens when I press those buttons allowing me to use for instance keymaps editor. On kodi I cannot really use keymaps editor addon because as soon as I press the buttons it goes out.

It is now clear that is a keymap problem but it has to be solved within the app itself. As I said before other apps like xPlore, ExpressVPN , etc... can uses PROG+/- buttons to scroll up/down or as for the Zattoo app to change channels.

What Koying does to reserve the remote controller buttons to the app? I have seen that he is also active in this forum.

Update: I can confirm that I can switch channels with PROG+/- buttons on SPMC. I have added the file sony.xml under keymaps with the following lines:
Quote:<keymap>
  <FullscreenLiveTV>
    <keyboard>
      <channel_up>ChannelUp</channel_up>
      <channel_down>ChannelDown</channel_down>
    </keyboard>
  </FullscreenLiveTV>  
</keymap>
Since we do not have access to the new PVR client from Teleboy or Zattoo within SPMC I did the test using the addon PVR Demo Client.
Reply

Logout Mark Read Team Forum Stats Members Help
Unable to map PROG+/- (CH+/-) buttons in KODI as for SPMC0