airpost
Posts: 1
Joined: Fri Apr 23, 2021 2:56 pm

ubuntu 21.04 -- keyboard not typing in apps [SOLVED]

Fri Apr 23, 2021 3:08 pm

hello,
I installed ubuntu on RPi 8gb, initially keyboard was working well, but for some reason, it stops working in terminal, or browser address bars. It only work in login screen and main search windows. I re write SD card and boot again and it still continues. On screen keyboard also same , not activating in terminal or browser address bars, but working well in search or login windows, pleae help why this happened and why it repeates after reinstalltion of linux again ?
Thanks

mehdi.hsny
Posts: 1
Joined: Sat Apr 24, 2021 5:29 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Sat Apr 24, 2021 5:34 pm

i am also facing the same issue.
rbp 4 -8gig - logitech touchpad keyboard.

darylt
Posts: 1
Joined: Wed Apr 28, 2021 1:19 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Thu Apr 29, 2021 1:30 pm

Same issue here. Fresh install of Ubuntu 21.04 on Raspberry Pi 4 (4GB) with Logitech wireless keyboard TK820 (not BT).

It worked at first, but after installing available updates and Python3, keyboard input stopped working in terminal, Firefox, etc. Password can be typed on the initial login screen and mouse moves the cursor, but no keyboard input :(

Seems to be a Wayland problem. If I login using Xorg, everything works as expected, so sticking with Xorg for now.

User avatar
pasman1
Posts: 241
Joined: Mon Aug 10, 2020 3:01 pm
Location: Poland

Re: ubuntu 21.04 -- keyboard not typing in apps

Sat May 01, 2021 7:00 am

Usb keyboard with pi4/4 works ok, sometimes are lags.
Ubuntu is on usb memory.

Btw, anybody knows, how to activate/deactivate screen keyboard ?
Pi4-4G RaspiOS 32 BuLlSeYe

n00btube
Posts: 1
Joined: Mon May 03, 2021 11:36 am

Re: ubuntu 21.04 -- keyboard not typing in apps

Mon May 03, 2021 11:39 am

I am having this problem as well. Starting from a fresh install of Ubuntu desktop as of 4/24/2021, simply going through the initial setup steps and restarting reproduces this problem. Ctrl-Alt-F3 at the login screen takes me to a terminal where the keyboard works just fine. I can also successfully log in to gnome, but at that point the keyboard stops working in text boxes. Interestingly enough, Ctl-Alt-t in gnome still brings up a terminal window, which of course, I can't type in... FWIW, logging in using Xorg instead of Wayland worked for me as well. Not sure what the implications of that are?
Last edited by n00btube on Mon May 03, 2021 2:58 pm, edited 3 times in total.

User avatar
pasman1
Posts: 241
Joined: Mon Aug 10, 2020 3:01 pm
Location: Poland

Re: ubuntu 21.04 -- keyboard not typing in apps

Wed May 12, 2021 6:33 pm

In ubuntu impish keyboard works.
Pi4-4G RaspiOS 32 BuLlSeYe

Bart31f
Posts: 2
Joined: Fri May 14, 2021 10:07 am

Re: ubuntu 21.04 -- keyboard not typing in apps

Fri May 14, 2021 10:11 am

Logitech Wireless KB235 same problem with ubuntu

blade777
Posts: 69
Joined: Thu Oct 29, 2020 2:49 am

Re: ubuntu 21.04 -- keyboard not typing in apps

Sun May 16, 2021 4:01 am

i never really had any real issues on my first rpi-4..using ubuntu 19-04 or 19-10 i think also mine was a first revision board,,,really i think it may be a combination of the revision changes and the driver ...i got my rpi -4 in mid 2019 from mem i still have the board although not working any more.
i do remember however that i was using an M-2 usb drive on it different hard ware from the argon one i got later

i also remember that i was using a gigabyte key board atr the time this was back in the times we had to limit the ram to 3 gig for the usb 3 ports to work.. so
is it usb driver ..etc. Vs mouse driver..etc.. kernel parameters .. whatever the change it seems to me..that mostly it must be software related.. past and present..

i actually use 2 dongles one for k-b and one for mouse..still i often have issues..ios my rpi-4 faulty..?

good question..???
late 2020
20-20 i never really got into using my rpi-4 until 2020

wondering how much corona had to do with more than just the people..

Anskynaf
Posts: 1
Joined: Thu May 20, 2021 4:31 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Thu May 20, 2021 4:33 pm

Had very same issue. Solution was to use USB keyboard and mouse.

cylemmulo
Posts: 4
Joined: Sat Nov 25, 2017 6:05 am

Re: ubuntu 21.04 -- keyboard not typing in apps

Tue Jun 01, 2021 4:42 am

I'm having the same issue with a wireless mouse/kb after doing an os upgrade. Not finding any fixes.

drtechno
Posts: 261
Joined: Fri Apr 09, 2021 6:33 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Tue Jun 01, 2021 12:01 pm

Doesn't seem to be an issue on the one I compiled away from distro channels.

Flashed usb stick with raspi pi imager versions:
Tried Ubuntu server + ubuntu-stido desktop - wireless mouse times out
The same with ubuntu-desktop

Someone will have to look at the APCI calls because I think its associated with power management I'm going to try a few things here disabling or removing some APci functions away and let you know if I find the fix. Switching to desktop images

Trying out Ubuntu desktop 64 bit loaded up with Pi imager...
Trying XFCE with lightdm as the manager..... still freezes up
changing back display manager manually

Code: Select all

 ( sudo dpkg-reconfigure gdm3)
Also to help me out, if you guys are using auto-login feature, which time to time breaks the wireless mouse in Gnome.

I find changing this in users caused it to lock up. Because /etc/gdm3/custom.conf has autologin set so I put a # to comment the lines out Its funny because it looks like a second script added that entry on line 8 and the normal entries are entered about 10 lines below, but commented out.

Run:

Code: Select all

systemctl status display-manager.service 
And tell me what lines of text you have in yellow and red

Also, run:

Code: Select all

echo $XDG_RUNTIME_DIR
because the ones loaded by PI Loader are empty even though the error we are trying to fix is not caused by this error, but should be fixed

should be:

Code: Select all

$XDG_RUNTIME_DIR=/run/user/1000
But I can't remember where that entry is or generated from.... still looking

Switched window managers back and forth (by logging out) the problem went away. Which was most likely fixed by running:

Code: Select all

 sudo dpkg-reconfigure gdm3
There are still things not correct, as user id should be 1000 instead of 0 To look at it pass this at a command shell:

Code: Select all

echo $UID

drtechno
Posts: 261
Joined: Fri Apr 09, 2021 6:33 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Wed Jun 02, 2021 11:34 am

airpost wrote:
Fri Apr 23, 2021 3:08 pm
hello,
I installed ubuntu on RPi 8gb, initially keyboard was working well, but for some reason, it stops working in terminal, or browser address bars. It only work in login screen and main search windows. I re write SD card and boot again and it still continues. On screen keyboard also same , not activating in terminal or browser address bars, but working well in search or login windows, pleae help why this happened and why it repeates after reinstalltion of linux again ?
Thanks
I remember about a decade ago we had the similar thing go on with Ubuntu when gnome started playing with the idea of 3d accelerated desktop. Back then all you had to do is:

Code: Select all

sudo dpkg -reconfigure ubuntu-desktop
This fixes the compositing issues that causes this. Other problems that can cause the user to lose control of the desktop is PAM not assigning the UID to the user session, and xorg user pool of uids are configured and refuse input because it is not listening to the user who is outside the assigned UID pool. There is only a few instances that this happens, but are mitigated if power management is disabled properly (since there is no acpi controller/microprocessor on board) Example:

default user pool is UID 1000-3000 but if you look at the environment variable on the terminal window with the command:

Code: Select all

echo $UID
it should return a number between 1000-3000 This Pi images return:

Code: Select all

0
Which is not a proper nor valid UID for it on any platform.
normally, it is:

Code: Select all

1000
on any platform.

Another command that comes in handy from time to time to reset the whole system (literally a true reset)

Code: Select all

sudo -i 
dconf reset -f /

User avatar
jojopi
Posts: 3628
Joined: Tue Oct 11, 2011 8:38 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Wed Jun 02, 2021 4:01 pm

drtechno wrote:
Wed Jun 02, 2021 11:34 am
This Pi images return:
0
Which is not a proper nor valid UID for it on any platform.
Zero is the uid of the superuser. Did you use sudo -i again ?

drtechno
Posts: 261
Joined: Fri Apr 09, 2021 6:33 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Wed Jun 02, 2021 4:42 pm

jojopi wrote:
Wed Jun 02, 2021 4:01 pm
[Zero is the uid of the superuser. Did you use sudo -i again ?
It will return 0 if you are @root but if PAM is broke entirely and the window manager doesn't load a "Home" or "root" as its home it will be 0 @pi which it shouldn't do under any normal circumstances
Its a small error in PAM that all debian installations have. It is from this error: "gkr-pam: unable to locate daemon control file"

when someone runs

Code: Select all

systemctl status display-manager.service
Which the error returned from the window manager when it is starting. When it errors, its error catch assumes "user ingroup nopasswdlogin" and the first entry of suoders is used and since sudoers are assigned UID of 0 the return response from the software is:

"pam_unix(lightdm:session): session opened for user pi by (uid=0)"

Then the system is unlocked by "sudo" instead of a password login Then UID is switch to user UID afterwards when it looks for a "home" directory to load any window management options.
Like I said this is a small error that most debian systems have especially if a gui is configured. Regardless if autologin was ever used.

User avatar
jojopi
Posts: 3628
Joined: Tue Oct 11, 2011 8:38 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Thu Jun 03, 2021 9:19 pm

drtechno wrote:
Wed Jun 02, 2021 4:42 pm
"gkr-pam: unable to locate daemon control file"
Your distribution has pam_gnome_keyring enabled, but you are not running gnome-keyring? No need to check environment variables unless there is a problem.
"pam_unix(lightdm:session): session opened for user pi by (uid=0)"
That is not an error, and there is no mistake in the wording. A session was opened for user pi by user root. Identical messages occur for sshd logins.
Which the error returned from the window manager when it is starting. When it errors, its error catch assumes "user ingroup nopasswdlogin" and the first entry of suoders is used […]

Then the system is unlocked by "sudo" instead of a password login Then UID is switch to user UID afterwards when it looks for a "home" directory to load any window management options.
Absolute nonsense. A window manager is not the same as a display manager. The switch to user happens before the window manager starts. sudo uses pam, but pam does not use sudo.

Your suggestion to check that "echo $UID" is non-zero is based on misunderstanding and confabulation.

DrakeGD
Posts: 49
Joined: Fri Jan 08, 2021 1:44 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Tue Jun 15, 2021 6:06 pm

The Official Ubuntu Desktop that you install with Raspberry pi Imager does indeed work for keyboard input, up untill you do a sudo apt update && sudo apt upgrade.

Please do not confuse people by saying that it's working, i have tested this with multible keyboards, multible raspberry pies and multible installs
the issue is the same, as soon as you do a sudo apt update && sudo apt upgrade you are unable to type in browser, terminal and basicly anywhere within the ubuntu desktop. you can still bring up the terminal with the shortcuts, so it's registering the keyboard input, but it's not transferring any inputs into any text based application within the desktop enviroment.

Forward this to both raspberry pi officials and to the Raspberry pi Ubuntu Desktop Developers, since it's a big issue when it comes to security, without updating Ubuntu i can't see how i can secure my setup. :!:

DrakeGD
Posts: 49
Joined: Fri Jan 08, 2021 1:44 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Tue Jun 15, 2021 6:09 pm

drtechno wrote:
Wed Jun 02, 2021 11:34 am
airpost wrote:
Fri Apr 23, 2021 3:08 pm
hello,
I installed ubuntu on RPi 8gb, initially keyboard was working well, but for some reason, it stops working in terminal, or browser address bars. It only work in login screen and main search windows. I re write SD card and boot again and it still continues. On screen keyboard also same , not activating in terminal or browser address bars, but working well in search or login windows, pleae help why this happened and why it repeates after reinstalltion of linux again ?
Thanks
I remember about a decade ago we had the similar thing go on with Ubuntu when gnome started playing with the idea of 3d accelerated desktop. Back then all you had to do is:

Code: Select all

sudo dpkg -reconfigure ubuntu-desktop
This fixes the compositing issues that causes this. Other problems that can cause the user to lose control of the desktop is PAM not assigning the UID to the user session, and xorg user pool of uids are configured and refuse input because it is not listening to the user who is outside the assigned UID pool. There is only a few instances that this happens, but are mitigated if power management is disabled properly (since there is no acpi controller/microprocessor on board) Example:

default user pool is UID 1000-3000 but if you look at the environment variable on the terminal window with the command:

Code: Select all

echo $UID
it should return a number between 1000-3000 This Pi images return:

Code: Select all

0
Which is not a proper nor valid UID for it on any platform.
normally, it is:

Code: Select all

1000
on any platform.

Another command that comes in handy from time to time to reset the whole system (literally a true reset)

Code: Select all

sudo -i 
dconf reset -f /
this would be helpfull, if i could type in the terminal :roll:

parandandrd
Posts: 4
Joined: Tue Aug 22, 2017 4:02 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Wed Jun 16, 2021 2:06 pm

This isn't really a fix, as such, but if you change from Wayland to X11, by clicking the icon in the lower right corner of the login screen, the issue is resolved (but then you are running X11 instead of Wayland, for what that may be worth to you).

matzelchen
Posts: 1
Joined: Wed Jun 30, 2021 8:19 pm

Re: ubuntu 21.04 -- keyboard not typing in apps found a workaround

Wed Jun 30, 2021 9:07 pm

I found a workaround for this problem (at least for me).

It seems as if the kernel module hid_logitech_dj prevents keyboard and mouse events from reaching apps in Wayland when using Logitech unifying receivers.

I could not (at least for now) get module blacklisting to work (either by modprobe.d or by udev rules).

Thats why I just remove the module to get this working again (as root):
  • sudo rmmod hid_logitech_dj && sudo rm /lib/modules/$(uname -r)/kernel/drivers/hid/hid-logitech-dj.ko
  • Remove receiver
  • Reconnect receiver

Does anyone have a suggestion where to file this bug?

User avatar
pasman1
Posts: 241
Joined: Mon Aug 10, 2020 3:01 pm
Location: Poland

Re: ubuntu 21.04 -- keyboard not typing in apps

Sat Jul 03, 2021 7:16 am

Pi4-4G RaspiOS 32 BuLlSeYe

tjobson
Posts: 2
Joined: Sun Apr 07, 2013 7:30 am

Re: ubuntu 21.04 -- keyboard not typing in apps

Tue Jul 06, 2021 12:04 am

Same issue. Noticed, USB "wired" keyboard that system was setup with works fine and gets focus in all windows for text input (eg. Chromium, Terminal..). However, when switching to a functioning USB unifying logitech keyboard (tried 2 diff unifying receiver/keyboard combo's from other working computers) ,and same thing.. the K400 Plus and K860 .. both with unifying receiver FW updates.. do the same : They can type text for the login password, and also if I touchpad/mouse click the search.. can type in that.. but can't get the keyboard to gain focus within a new terminal, nor chromium window. For the K400 plus, the touchpad works fine and keyboard works only like I said.. login and search screen, etc.. but no focus into core apps (terminal input, chromium, etc..). Please update when a Fix is coming.. else , back to the long-azz wired USB keyboard for Ubuntu 21.. and separate mouse. .. and JUST NOTICED !! : ** Once you plug back in the wired USB keyboard, you CAN type from the wireless USB/unifying receiver keyboard !!?.. so just the USB wired keyboard plugged in somehow gets recognized and allows input/focus typing from EITHER keyboard !??.. bizzare.

User avatar
CvH
Posts: 1
Joined: Sat Sep 07, 2019 10:13 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Thu Jul 08, 2021 8:14 am

matzelchen wrote:
Wed Jun 30, 2021 9:07 pm
I could not (at least for now) get module blacklisting to work (either by modprobe.d or by udev rules).
I have exactly the same problem at RPi4 + Ubuntu 21.04 (latest updates) and a Logitech K235 mouse/keyboard combo.

I added this to blacklist and it works now (included workaround to disallow dynamic loading).

Code: Select all

echo "blacklist hid_logitech_dj" >> /etc/modprobe.d/local-dontload.conf
echo "install hid_logitech_dj /bin/false" >> /etc/modprobe.d/local-dontload.conf
depmod -a
update-initramfs -u
reboot
Last edited by CvH on Thu Jul 08, 2021 8:43 am, edited 1 time in total.

KunalGautam
Posts: 2
Joined: Sat Oct 05, 2013 4:59 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Tue Jul 13, 2021 2:00 am

CvH wrote:
Thu Jul 08, 2021 8:14 am

Code: Select all

echo "blacklist hid_logitech_dj" >> /etc/modprobe.d/local-dontload.conf
echo "install hid_logitech_dj /bin/false" >> /etc/modprobe.d/local-dontload.conf
depmod -a
update-initramfs -u
reboot
I can confirm this worked for me.

For those who are wondering how to use keyboard input, you can go to settings > Accessibility > and use On screen Keyboard OR press CTRL + ALT + F3 to get terminal.

satadru
Posts: 44
Joined: Thu Apr 18, 2013 5:18 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Thu Jul 15, 2021 1:45 pm

Also FYI, another way to get keyboard back to do the modprobe steps above without using the on-screen menu is to just login with the regular Xorg/X11 session, which doesn't have a broken keyboard with the Logitech unified receiver.

(You want to go back to using Wayland afterwards though since good things are coming down the pipeline in the mutter wayland display server gnome uses.)

1. Use the mouse to use the menu a the top right of the screen to logout.
2. At the gdm3 login screen use the gear icon at bottom right to select Gnome Xorg Session
3. Login.
4. Open a terminal
5. Run:
sudo -s
echo "blacklist hid_logitech_dj" >> /etc/modprobe.d/local-dontload.conf
echo "install hid_logitech_dj /bin/false" >> /etc/modprobe.d/local-dontload.conf
depmod -a
update-initramfs -u
reboot
6. Once you get back to your session, logout using the top right menu.
7. Use the bottom right gear to select the regular Gnome Session
8. Login.
9. Profit!

jonovos
Posts: 1
Joined: Fri Dec 22, 2017 8:24 pm

Re: ubuntu 21.04 -- keyboard not typing in apps

Wed Jul 21, 2021 1:00 pm

THIS WORKED FOR ME! (satadru's procedure of 15-Jul-2021)

Return to “Ubuntu”