Engine crashes with USB Bluetooth Mouse & Keyboard plugged in (DEF-1992) (SOLVED)

Hello there,

When I plug my Microsoft Wireless Keyboard 3000 USB Transceiver to my laptop and try to launch a defold project from the IDE, the game instantly crashes. HTML5 export works fine. As soon as I unplug the Wireless transceiver, it works again.

Steps to reproduce

  • Plug in Wireless Keyboard 3000 USB Tranceiver
  • Launch Defold, open project
  • Try to run the project

I’m on Ubuntu 16.04 using Defold 1.2.84 x64.

INFO:ENGINE: Defold Engine 1.2.84 (5eb478d)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device 'default'

WARNING:INPUT: No gamepad map found for gamepad 0 (Microsoft Microsoft® 2.4GHz Transceiver v7.0), it will not be used.
INFO:DLIB: SSDP: Started on address 172.17.0.1
INFO:DLIB: SSDP: Started on address 192.168.0.22
INFO:CRASH: Successfully wrote Crashdump to file: /home/fbx/.Defold/_crash

Crashdump:
https://docs.google.com/uc?id=0B9a5z-JBMAVvUEVFZXhHdTVfcTQ&export=download

As you can see, defold seems to mistake the tranceiver as gamepad; Is there any option to blacklist certain devices?

Cheers,
Felix

1 Like

There was another user with keyboard issues on Linux a while back: Linux 64bit support - ready for alpha testing!

Not sure if any of the things discussed in that thread is of any help. Otherwise @sven and @jakob.pogulis will have to take a look.

Hello! Theres no option to blacklist a device, and there’s currently no fix for this issue which seems to only affect the Linux platform. When this issue was previously reported we were unable to get a crash dump due to an error within the Linux crash dump code, but this has been fixed.

I think fixing the crash should be an easy fix now that we have a trace, fixing the underlying problem with incorrect identification might be harder. @Mathias_Westerdahl, could you create an issue for this? I have an idea what could be wrong and how we can test it.

Regards,
Jakob

2 Likes

I have now added issue DEF-1992 for this.

1 Like

I actually find resolve to this problem, which i think will be uselles
in your case, but what what worked in my case. Buy totally featureless
keyboard or mouse, which one cause the crash. But it’s better if
developers fix that bug on their side, of course

1 Like

That was me :wink:. Today, I plugged my ErgoDox EZ keyboard, compiled the default platform project with the latest version of Defold, launched it and got the same crash, but now with a crash dump! If that can help, here is the zipped _crash file.

crash.zip (878 Bytes)

1 Like

Thanks @lstep, I’ve added your crash dump to the ticket too. I’m sure it will help!

Same problem on Linux Mint 17.3 (64)
Linux katyusha 3.19.0-64-lowlatency #72~14.04.1-Ubuntu SMP PREEMPT Fri Jun 24 19:54:37 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

INFO:ENGINE: Defold Engine 1.2.85 (69b592c)
INFO:ENGINE: Loading data from: build/default
INFO:ENGINE: Initialised sound device ‘default’

INFO:DLIB: SSDP: Started on address 192.168.1.17
INFO:CRASH: Successfully wrote Crashdump to file: /home/jordan/.Defold/_crash

Can’t attach the crashdump, uploaded it http://s000.tinyupload.com/index.php?file_id=11682658548267982294

Wireless Keyboard 2000 USB Tranceiver pluged in

Help @Mathias_Westerdahl @jakob.pogulis

Any news ?
@Mathias_Westerdahl @jakob.pogulis

Unfortunately most of the team is away on vacation (including Jakob), and I simply didn’t have the time to look into this (currently working on the next release). Hopefully I can look into this sometime next week. I also need to get hold of some hardware to try it out with.

Any news ?
@Mathias_Westerdahl @jakob.pogulis

Hi @Aquazus!

The good news is that we got some hardware to test on the other day, so my plan was to test it quickly tomorrow to try to reproduce the issue.

2 Likes

Hello everyone!

Could you try running jstest to see if your keyboard is detected as a gamepad or a keyboard. I understand that your keyboard is working in other applications and the idea might seem a bit silly, but it would help us diagnose the issue.

A graphical version of jstest can be found at https://github.com/Grumbel/jstest-gtk.

1 Like

Hello!

Having the same issue here on my laptop(Build and run within editor, or bundle linux build), with archlinux 64bit.
My usb device is A4 X7 mouse (model X-748K)

It is possible to work when you plug the mouse out, but it is really a pain. I hope this issue will be fixed or at least could be worked around.

Here is my app log (some debug logs is from my current project, but I hope it is not the issue here):

INFO:ENGINE: Defold Engine 1.2.90 (5d25bd7)
INFO:ENGINE: Loading data from: build/default
connect(2) call to /dev/shm/jack-1000/default/jack_0 failed (err=No such file or directory)
attempt to connect to server failed
INFO:ENGINE: Initialised sound device 'default'

DEBUG:SCRIPT: AI Controller: switching states: nil->idle
DEBUG:SCRIPT: idle_state: MESSAGE [begin]
DEBUG:SCRIPT: prev_state: nil; curr_state: idle; facing_dir: -1
INFO:DLIB: SSDP: Started on address 192.168.1.34
INFO:CRASH: Successfully wrote Crashdump to file: /home/grozamorei/.Defold/_crash

Here is my crashdump:
_crash.zip (1.1 KB)

@jakob.pogulis, here is my jstest results:

4 Likes

Thank you! As you can see your keyboard registers as a joystick with 37 axes and 69 buttons. This is an issue with your drivers, have you installed any specific drivers for your keyboard, or are you using the default drivers?

The engine crashes because we’re making an incorrect assumption about the maximum buttons on a gamepad. We have an idea of how to fix the crash and I hope we will get to it soon, but as long as the driver identifies the HID as something other than an actual keyboard we will be unable to correctly map it.

1 Like

I would like to bring to attention that I have not the keyboard but a mouse. With extra buttons, though.

Okay so this information forwarded me in the right direction and I found a workaround.

Seems like this situation is very common with multimedia devices and linux. Whole point is that drivers detect one device as two devices. for example, look at my

xinput list

⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ ELAN0501:00 04F3:300B Touchpad id=14 [slave pointer (2)]
⎜ ↳ A4TECH USB Device id=11 [slave pointer (2)]
⎜ ↳ A4TECH USB Device id=12 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]

two devices! however, i’m using only one.

another way to look at input device is

cat /proc/bus/input/devices


I: Bus=0003 Vendor=09da Product=9090 Version=0111
N: Name="A4TECH USB Device"
P: Phys=usb-0000:00:14.0-1/input0
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.0/0003:09DA:9090.0004/input/input19
U: Uniq=
H: Handlers=sysrq kbd leds event11 js1
B: PROP=0
B: EV=12001f
B: KEY=3007f 0 0 4c3ffff17aff32d bf54445600000000 c00000000000001 130c130b17c007 ffa67bfad951dfff febeffdfffefffff fffffffffffffffe
B: REL=40
B: ABS=ffffff01000701ff
B: MSC=10
B: LED=1f

I: Bus=0003 Vendor=09da Product=9090 Version=0111
N: Name="A4TECH USB Device"
P: Phys=usb-0000:00:14.0-1/input1
S: Sysfs=/devices/pci0000:00/0000:00:14.0/usb1/1-1/1-1:1.1/0003:09DA:9090.0005/input/input20
U: Uniq=
H: Handlers=event13 mouse1
B: PROP=0
B: EV=17
B: KEY=ffff0000 0 0 0 0
B: REL=143
B: MSC=10

again, two devices.

If you look at the handlers section you can determine which is which. In my case "H: Handlers=sysrq kbd leds event11 js1 " points that mouse is detected as joystick1. I can find it and kill it (via rm):

sudo rm /dev/input/js1

problem solved. Unfortunately, you will have to do that every time computer starts.

overall seems like a problem with linux itself, not the engine.

Here is my references:
http://steamcommunity.com/app/102840/discussions/0/846945955368427026
https://bbs.archlinux.org/viewtopic.php?id=189901

3 Likes

Interesting. I would have expected this to work better on Linux now that Linux is becoming a more common gaming platform.

This is really interesting, because if this is the case for everyone with this problem, fixing the crash might fix the overall problem as well.

Take a look at this solution: https://github.com/denilsonsa/udev-joystick-blacklist

Good luck :wink:

1 Like

The problem has been given issue number DEF-2331 and the fix will be available through the alpha channel later today. It is planned to be released in 1.2.95.

2 Likes