Changing input language crashes Kodi

Hi, I sometimes need to type in languages other than English, so I have this script mapped to a button and it “randomly” hangs and crashes kodi.

the script is at:
https://paste.kodi.tv/raw/uqevokiluh
the relevant part of the debug log is:
https://paste.kodi.tv/raw/jaxejoloru
and then it crashes.
the relevant part of the crashlog is:
http://ix.io/2qE7

I notice that it happens more frequently when I’m in kodi’s debug mode - e.g. it crashes on the first/second toggle, while it can take 5-10 toggles without debug mode.

any suggestion?
it’s the only way for me to change the input method on this device.

(I was told on Kodi’s forums that it’s a libxkbcommon related issue and they don’t provide support for it.)

Where in Kodi I can see different language?

if I understand you correctly, you can open any input dialog (for example a youtube search), type a few letters, then run the script, type a few more letters and they should be in a different language.
repeating this like 8 times hangs and shortly after crashes my Kodi.

I think something else doesn’t work for me because on right side of input dialog I always see English QUERTY. I assume this button should be changed? I can change it even manually.

nope, that button (that says English QWERTY) changes the onscreen keyboard language.
the script that I use changes the physical keyboard typing language.

so even if it says English QWERTY, when I click the f11 on my keyboard, and start typing, the typed letters will be in Russian/Hebrew, and that button will still say English QWERTY.

Nope, nothing. Letters just doesn’t change when I run script. I’m out of luck for help then :frowning:

strange, maybe you should first add those typing languages to Kodi’s keyboard layout like I have, under settings -> interface -> regional -> keyboard layouts:

and only then you can toggle those languages?

1 Like

From crashlog it’s libxkbcommon
May be your script crash it somehow. I could try you script in the evening as will be at home.

Now I can select manually different layout with a button but script doesn’t change layout. And I see it runs correctly. Strange.

that’s very strange.
I can’t think of another setting that is required for this to work…
but it does change the input language on my CE.

Are you using a physical keyboard?

I tried your script and it works on S922X device without issues.
I don’t see Hebrew symbols, but it switch normally and I receive correct English and Russian symbols.

thanks for testing!
I am running CE on a s905x2 box.
like I said, it’s the only way to switch input languages with a physical keyboard and I have to use it.
is there a way to debug the crash?

You could try to update to 9.2.3 version. As I see you still have 9.2.2.
Or try fresh install of CE(without additional addons) on different sd/usb card and check if it works or not.

1 Like

took me a while to find time to do a fresh install - sorry.
anyway - the problem is happening in a fresh install as well - although in the fresh install, the system is MUCH snappier (default skin, no content at all, etc), and so to reproduce it, I have to do multiple clicks very quickly, but sure enough after about 8-10 very rapid clicks it happens - system freeze and restart.
my box is Magicsee N5 Max - s905x2 with 4GB RAM and 1Gbit lan.

any additional logs I can provide?

this is a really big issue for me - I’m youtubing a lot with great need for multi language input in HW keyboard and in the regular setup I have, it happens sometimes even after 1 click (I can’t say which race condition is exactly going on in the code, but it’s pretty obvious there is one from these symptoms).

Maybe You better use any PC/tablet/notebook
An Amlogic box isn´t the best hardware for Your usecase.

May be libxkbcommon bump could help…
It’s strange that I couldn’t repeat your issue, so something is different

yeah something’s got to be different.
unless I’m forcibly trying to reproduce the issue in a way you didn’t (like I wrote - I had repeatedly press the button very quickly to reproduce it on a clean empty installation).

As a workaround install yatse on your phone and input text from there.

back to update after a few months for anyone that might come across a similar issue.
after changing the keymap to a longpress action, the script works without issues.
this leads me to believe there’s an issue with libxkbcommon, the usb drivers in the system, or the remote itself.
anyway - I can live with longpressing to change the input language.