#17313 new Bugs

kodi-wiiremote does not work any more with Kodi 17 (at least on Ubuntu)

Reported by: mossroy Owned by: jhsrennie
Priority: 4 - Normal
Component: Keymapping (Remote Control / Gamepad Controller) Version: 17.0 "Krypton" Final
Severity: Normal Keywords: wii wiimote wiiremote
Cc: Blocked By:
Blocking: Platform: Linux

Description

I'm using kodi-wiiremote since many versions to control Kodi with a wiimote, on Ubuntu. It was working fine (except a very minor issue : see #12751) on versions 11 to 16.

But it stopped working for me with Kodi 17.

When running kodi-wiiremote, it successfully connects to the wiimote. Kodi also detects it correctly : "NOTICE: Successfully connected a WiiRemote" in the logs and in the GUI

But using the buttons of the wiimote has no effect any more on Kodi. Tried with Aeon and Estuary skins. I have the exact same behavior on 2 different machines : one on Ubuntu Trusty (64-bit), the other one on Ubuntu Xenial (64-bit).

Steps to reproduce :

  • install Kodi 17 on Ubuntu through the team-xbmc PPA (version 2:17.0~git20170210.1529-final of packages kodi, kodi-bin, kodi-eventclients-common, kodi-eventclients-wiiremote. I also use kodi-pvr-hts)
  • run "kodi-wiiremote &" and push the 1 and 2 buttons of your wiimote to connect it
  • start kodi : the wiimote is detected and connected
  • try to move through the menus with the arrow of the wiimote : nothing happens

After manually downgrading to Kodi 16.1 (for all the packages, by using the archived .deb files of the PPA), the wiimote works fine.

I attach the log file of Kodi, but there does not seem to be any relevant error in it.

Please tell me if I can help testing/debugging.

Attachments (6)

kodi.log (57.4 KB) - added by mossroy at 2017-02-12T19:11:03Z.
Log file when trying to use the wiimote (in debug mode), without touching the keyboard
0001-xbmcclient-fix-cut-off-trailing-0.patch (751 bytes) - added by chr[] at 2017-09-04T22:07:08+01:00.
0002-wiimote-make-it-going-again-as-custom-controller.patch (1021 bytes) - added by chr[] at 2017-09-04T22:07:18+01:00.
0003-wiimote-bugfixes-and-features.patch (8.3 KB) - added by chr[] at 2017-09-04T22:07:28+01:00.
WiiRemote.custom.xml (1.1 KB) - added by chr[] at 2017-09-04T22:08:01+01:00.
example keymap file
WiiRemote.custom.2.xml (1.3 KB) - added by mossroy at 2017-09-10T22:23:21+01:00.
keymaps that are closer to the ones of Kodi 16

Change History (23)

comment:1 Changed at 2017-02-11T22:19:14Z by mossroy

In the attached log, I was using an empty kodi profile (after removing my ~/.kodi folder), and I pressed the up/down/right/left arrow buttons of the wiimote. These events seem to appear as keyboard events in the debug log, but they do not have any effect on the GUI.

Could it "simply" be a problem of keymap? (I only used the default settings)

comment:2 Changed at 2017-02-12T10:20:06Z by mossroy

I see that the joystick support code has been significantly reworked in Kodi 17.

After reading http://kodi.wiki/view/HOW-TO:Share_button_maps , I'm wondering if the wiimote is simply not supported yet by the new joystick library?

Changed at 2017-02-12T19:11:03Z by mossroy

Log file when trying to use the wiimote (in debug mode), without touching the keyboard

comment:3 Changed at 2017-02-12T19:15:49Z by mossroy

I replaced the attached debug log with a new one, that I made without touching the keyboard at all. I don't see the keyboard events in the debug log any more. So I suppose the ones I saw were due to when I used the keyboard to exit from Kodi.

So, after all, it looks like no events are received by Kodi when using the wiimote (even if it detects it as connected).

comment:4 Changed at 2017-03-25T11:01:09Z by mossroy

Same problem with Kodi 17.1.

What else can I do to help solve this issue?

comment:5 Changed at 2017-03-26T15:37:30+01:00 by mossroy

In fact, I found out (by accident) that the wiimote works with the infrared sensor, as a mouse emulation : if you point to the sensor bar (or another bright light), you can move the cursor in Kodi... but you cannot select anything, so it's useless.

I used the wiimote as a "simple" remote control by using the buttons to move inside the menus, and would like to keep doing so.

I tried disabling the mouse emulation by running :

kodi-wiiremote --disable-mouseemulation --disable-nunchuck

instead of

kodi-wiiremote

In this case, the mouse emulation does not work any more (as expected), but the buttons are still not working.

It looks like some people report the same issue on the forums : http://forum.kodi.tv/showthread.php?tid=308243

comment:6 Changed at 2017-05-24T14:10:08+01:00 by mossroy

Same problem with Kodi 17.2

comment:7 Changed at 2017-09-04T22:06:41+01:00 by chr[]

Hi ppl,

here is some hope.

0001-xbmcclient-fix-cut-off-trailing-0.patch - fixes logging to stdout

0002-wiimote-make-it-going-again-as-custom-controller.patch This simple patch engages the wii as a customcontroller:

<keymap>
  <global> 
    <customcontroller name="WiiRemote"> 
      <button id="1">Up</button>

Reminder: shift+ctrl+k reloads keymaps ;)

0003-wiimote-bugfixes-and-features.patch

  • do not use shared ressources while callback thread is running
  • led indicates battery level
  • and switch off after 5 seconds idle
  • output bt-address

giving btaddr speeds up connection.

Changed at 2017-09-04T22:08:01+01:00 by chr[]

example keymap file

comment:8 follow-up: Changed at 2017-09-06T15:57:14+01:00 by mossroy

Hi chr[]

Thanks a lot for these patches. I managed to apply them, and compile WiiUse_WiiRemote (on Ubuntu 16.04 x64). But I still don't manage to use the wiimote with Kodi 17.4.

It's probably because I missed something.

Here is what I did :

  • apply the patches on the "Krypton" git branch of Kodi
  • go into tools/EventClients/Clients/WiiRemote directory, and run "make"
  • put the WiiRemote.custom.xml inside the .kodi/userdata/keymaps directory
  • run ./WiiUse_WiiRemote and connect the wiimote with 1+2 buttons (it finds the wiimote and says "Connected to wiimote")
  • start Kodi

But the Wii buttons still have no effect. (and ctrl-shift-k does not help either)

NB : I only compiled WiiUse_WiiRemote, not the whole Kodi software (I used the version from the team-xbmc PPA)

comment:9 in reply to: ↑ 8 Changed at 2017-09-06T16:23:10+01:00 by chr[]

Replying to mossroy:

Hi chr[]

  • go into tools/EventClients/Clients/WiiRemote directory, and run "make"

Hi mossroy,

I also run into this trap ;) this compiles "WiiUse" which seems to be outdated. That WiiRemote directory can use some cleanup.

Run make clean(!) and make from "tools/EventClients" that will create the binary "Clients/WiiRemote/WiiRemote" (ignore the install fail message)

NB: did you apply all patches?

NB: just wondering if anyone still uses libcwiid < 0.6.0

Last edited at 2017-09-06T16:32:57+01:00 by chr[] (previous) (diff)

comment:10 follow-up: Changed at 2017-09-06T17:10:52+01:00 by mossroy

Excellent, it works!

Many many thanks. I'll test it more completely later.

I find it a bit strange to still have the wii leds blinking after being connected to kodi. And the key mappings are a bit different than with Kodi 16 (at least in FullscreenVideo, I'll try to propose a keymap version that matches the previous behavior). But it seems to be working pretty well anyway.

NB : I applied all your 3 patches, and also had to add a strdup on line 104 of tools/EventClients/Clients/WiiRemote/WiiUse_WiiRemote.h to allow compilation (maybe the string JS0 should also be replaced by CC:, like in your patch 2, but if this code is really deprecated, it should be removed instead?)

NB2 : libcwiid1 package is in version 0.6.00+svn201-3.2 on Ubuntu 16.04 and in 0.6.00+svn201-3.1 on Ubuntu 14.04. I did not try on other OS/versions

comment:11 in reply to: ↑ 10 Changed at 2017-09-06T17:53:55+01:00 by chr[]

Replying to mossroy:

Excellent, it works!

Many many thanks. I'll test it more completely later.

I find it a bit strange to still have the wii leds blinking after being connected to kodi.

restart the wii (remove batteries).

The LED blinking on connect (which indicates battery level) is a wii build-in, and they shall go off on a successfully connection. So I picked up the battery level feature: On a keypress LED go on and shall go off after 5 seconds idle.

using --btaddr option speeds up the connection.

And the key mappings are a bit different than with Kodi 16 (at least in FullscreenVideo, I'll try to propose a keymap version that matches the previous behavior). But it seems to be working pretty well anyway.

Great.

I'm testing a variant sending button_down and button_up events (instead of a single button_press event). But actually the features on kodi side are limited. No longpress and no meta-key support to handle multi button combinations. I'll get at least a repeat function on holding down a button. Works well with VolumeUp/Down but it repeats to fast for Up/Down action.

NB : I applied all your 3 patches, and also had to add a strdup on line 104 of tools/EventClients/Clients/WiiRemote/WiiUse_WiiRemote.h to allow compilation (maybe the string JS0 should also be replaced by CC:, like in your patch 2, but if this code is really deprecated, it should be removed instead?)

All the "WiiUse"* files seems to be outdated and dead code. CWIID* is the stuff.

NB2 : libcwiid1 package is in version 0.6.00+svn201-3.2 on Ubuntu 16.04 and in 0.6.00+svn201-3.1 on Ubuntu 14.04. I did not try on other OS/versions

libcwiid0.6 is from 2010 ... and bug free since then I guess ;) so we can get rid of the #ifdef CWIID_OLD code.

However, I'm already lucky how it works now for me.

Last edited at 2017-09-06T17:58:36+01:00 by chr[] (previous) (diff)

comment:12 Changed at 2017-09-10T22:22:13+01:00 by mossroy

I managed to compile it on Ubuntu 14.04, and it works too.

I'm very thankful for this patch : it allows me to use my wiimote again on Kodi 17 (I previously had to downgrade to Kodi 16). This patch also solves #12751.

One minor issue is that my wiimote LEDs are still blinking after a successful connection. The wiimote is working fine, but it seems to indicate the wiimote is not connected (even if it is). I have this same behavior on my 2 wiimotes, and with 2 computers (one on ubuntu 14.04, the other one on ubuntu 16.04).

I've modified a bit the keymaps to match the behavior I had with Kodi 16 (see attached file). It might not be exactly the same, but it's very close (I only modified the FullscreenVideo tag).

Will you submit a Pull Request on Github for this fix? So that it might be merged upstream, and solve the issue in next versions of Kodi.

Changed at 2017-09-10T22:23:21+01:00 by mossroy

keymaps that are closer to the ones of Kodi 16

comment:13 Changed at 2017-09-23T13:30:34+01:00 by mossroy

Regarding the blinking LEDs issue, I'm trying to investigate but don't have enough C skills.

If I add a "sleep(1);" before the cwiid_set_led call, the LEDs are set correctly (indicating battery power). But after a few seconds, it outputs "Mesg pipe overflow", and does not seem to handle the pressed buttons any more.

This is no a fix nor a workaround, just a test to (hopefully) help you understand why the LEDs are not set as expected.

comment:14 Changed at 2017-10-02T19:46:45+01:00 by mossroy

I've made a blog post (in French) with the x64 binaries for Ubuntu 14.04 and 16.04, and the directions on how to compile and use them : https://blog.mossroy.fr/2017/10/01/refaire-fonctionner-sa-wiimote-avec-kodi-17/

I hope your patches will end up in a pull request, and be integrated into next version of Kodi (if possible with the blinking LED issue fixed, but it's not compulsory)

comment:15 Changed at 2017-11-19T12:51:59Z by mossroy

Same issue on Kodi 17.6. But the patched binaries still work. I've been using them for 2 months now, and it works pretty well (except the blinking LEDs issue).

chr[] : I still think it would be worth creating a pull request with your patches.

If you don't want to create it (for any reason), would you allow me to do it? (I would of course be clear on the fact that you are the author). The main problem is that I might not be able to refactor the code if they ask me to.

comment:16 Changed at 2017-11-20T16:05:48Z by chr[]

Hi all,

The code is a crap that just works too well ... maybe better rewrite it. I found more bugs ...

I'm wondering about the "WiiUse*" stuff which seems to be obsolete: delete?

Is anyone using or tested the mouse/joystick feature, the nunchuck?

comment:17 Changed at 2017-11-23T21:22:06Z by mossroy

Hi,

All right : I can help on testing if you need.

I never used the nunchuck with Kodi. I think that the wiimote alone is enough as a Kodi remote controller.

Note: See TracTickets for help on using tickets.