Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Strange problems with USB keyboard & mouse
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
davidbryant
Apprentice
Apprentice


Joined: 11 Jun 2020
Posts: 167
Location: Canyon Lake, Texas

PostPosted: Tue Feb 22, 2022 9:33 pm    Post subject: Strange problems with USB keyboard & mouse Reply with quote

I have been working to remove superfluous stuff from my kernel .config file. I got too aggressive about eliminating some items in the USB section -- or maybe in the "input devices" section -- and procuced a kernel that boots just fine, but leaves the mouse & keyboard inoperable.

Fine, I thought to myself. I make a backup file of .config at the end of each day's work. I'll just plug in yesterday's configuration file, which worked just fine, and regenerate the kernel and the associated modules. Oops! The mouse and keyboard still won't work.

Here are the commands I am using.
Code:
cd /usr/src/linux
cp /home/backup/.config .config
make clean
make -j9
make modules_install
make install

Is there some other magic I need to use to get my old kernel back?

I did some additional digging around, and it looks as if my problem is with the X-server. Here's the tail-end of the X-server's log fi;le where the mouse and keyboard won't work.
Code:
[    39.330] (II) config/udev: Adding input device USB Optical Mouse (/dev/input/mouse0)
[    39.330] (II) No input driver specified, ignoring this device.
[    39.330] (II) This device may have been added with another device file.
[    39.380] (EE) Failed to open authorization file "/var/run/sddm/{a7cc164d-97d5-4c3a-9923-4204fffe56b8}": No such file or directory
[    49.057] (II) modeset(0): Disabling kernel dirty updates, not required.

Here's what a successful mouse initialization looks like.
Code:
[    40.589] (II) config/udev: Adding input device USB Optical Mouse (/dev/input/event8)
[    40.589] (**) USB Optical Mouse: Applying InputClass "libinput pointer catchall"
[    40.589] (II) Using input driver 'libinput' for 'USB Optical Mouse'

followed by a bunch of stuff about the keyboard.

I appreciate any helpful hints. Thanks!
_________________
David Bryant
Canyon Lake, Texas


Last edited by davidbryant on Mon Feb 28, 2022 3:53 pm; edited 1 time in total
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5600
Location: Bavaria

PostPosted: Tue Feb 22, 2022 9:43 pm    Post subject: Re: Strange problems with USB keyboard & mouse Reply with quote

davidbryant wrote:
Here are the commands I am using.
Code:
cd /usr/src/linux
cp /home/backup/.config .config
make clean
make -j9
make modules_install
make install

Thats wrong. Do instead:
Code:
cd /usr/src/linux
cp /home/backup/.config .config
make oldconfig
make -j9
make modules_install
make install
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5600
Location: Bavaria

PostPosted: Tue Feb 22, 2022 9:52 pm    Post subject: Reply with quote

P.S.: If you have an USB-Keyboard and an USB-Mouse you need only kernel settings from these two articles:
https://wiki.gentoo.org/wiki/Libinput
https://wiki.gentoo.org/wiki/USB/Guide#Config_options_for_the_kernel

Here is mine:
Code:
Device drivers ---> Input device support --->
-*- Generic input layer (needed for keyboard, mouse, ...)
[*]   Export input device LEDs in sysfs
[ ]   Support for memoryless force-feedback devices
[ ]   Sparse keymap support library
[ ]   Matrix keymap support library
      *** Userland interfaces ***
[*]   Mouse interface
[*]     Provide legacy /dev/psaux device
(1024)  Horizontal screen resolution
(768)   Vertical screen resolution
[ ]   Joystick interface
[*]   Event interface
[ ]   Event debugging
      *** Input Device Drivers ***
[ ]   Keyboards  ----
[ ]   Mice  ----
[ ]   Joysticks/Gamepads  ----
[ ]   Tablets  ----
...


and

Code:
Device drivers ---> HID support  --->
[ ]   Battery level reporting for HID devices
[*]   /dev/hidraw raw HID device support
[ ]   User-space I/O driver support for HID subsystem
[*]   Generic HID driver
USB HID support  --->
    [*] USB HID transport layer
    [ ] PID device support
    [*] /dev/hiddev raw HID device support


If you have special devices then this could be not enough.
Back to top
View user's profile Send private message
davidbryant
Apprentice
Apprentice


Joined: 11 Jun 2020
Posts: 167
Location: Canyon Lake, Texas

PostPosted: Tue Feb 22, 2022 11:23 pm    Post subject: I'm still confused Reply with quote

OK. I decided to try a different tack, because I noticed that the generic mouse driver used by "X" (libinput) is located in /bin. So I generated an initramfs and booted up (just once) with the initramfs file. Guess what? Now the kernel that used to work, except for the mouse and keyboard, has been healed, and it works OK, even without the initramfs. Why? It doesn't make sense.
_________________
David Bryant
Canyon Lake, Texas
Back to top
View user's profile Send private message
davidbryant
Apprentice
Apprentice


Joined: 11 Jun 2020
Posts: 167
Location: Canyon Lake, Texas

PostPosted: Tue Feb 22, 2022 11:32 pm    Post subject: Re: Strange problems with USB keyboard & mouse Reply with quote

pietinger wrote:
Thats wrong. Do instead:
Code:
cd /usr/src/linux
cp /home/backup/.config .config
make oldconfig
make -j9
make modules_install
make install

Maybe I didn't make myself clear. "make oldconfig" (or "make olddefconfig") is a script that updates a .config file from an old release (5.15.19 in this case) to a new release (5.15.23). But I updated to 5.15.23 about two weeks ago ... all my recent tweaks have been to 5.15.23, so "oldconfig" wouldn't do anything.
_________________
David Bryant
Canyon Lake, Texas
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5600
Location: Bavaria

PostPosted: Tue Feb 22, 2022 11:34 pm    Post subject: Reply with quote

Sorry I cannot help you, because I dont understand it also. But when you are here, maybe you can tell me what was with this problem ? ->
https://forums.gentoo.org/viewtopic-p-8690812-highlight-.html
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5600
Location: Bavaria

PostPosted: Tue Feb 22, 2022 11:42 pm    Post subject: Re: Strange problems with USB keyboard & mouse Reply with quote

davidbryant wrote:
Maybe I didn't make myself clear. "make oldconfig" (or "make olddefconfig") is a script that updates a .config file from an old release (5.15.19 in this case) to a new release (5.15.23). But I updated to 5.15.23 about two weeks ago ... all my recent tweaks have been to 5.15.23, so "oldconfig" wouldn't do anything.


You told me, you have done some changes in your kernel config. Now you want to revert that. If you want to be sure you can do a

Code:
# make distclean
# cp back your backup.config into .config
# make oldconfig
# make ... install ... modules


(trust me - I know oldconfig; dont use olddefconfig)



P.S.: You need "make oldconfig" every time you give a different .config into your kernel sources than you had before; not only when you update from an older version. Also when you change something. See also in "make help" => "oldconfig - Update current config utilising a provided .config as base" and https://www.kernel.org/doc/html/latest/admin-guide/README.html

P.P.S.: If there was really no change, then "make oldconfig" doesnt hurt. Then it will only tell you that all is ok:

Code:
/usr/src/linux # make oldconfig
#
# No change to .config
#


Then you really know there was no change. But you should do it every time, after "playing" with your .config-file ;-)
Back to top
View user's profile Send private message
logrusx
Advocate
Advocate


Joined: 22 Feb 2018
Posts: 2921

PostPosted: Wed Feb 23, 2022 1:36 pm    Post subject: Re: I'm still confused Reply with quote

davidbryant wrote:
OK. I decided to try a different tack, because I noticed that the generic mouse driver used by "X" (libinput) is located in /bin. So I generated an initramfs and booted up (just once) with the initramfs file. Guess what? Now the kernel that used to work, except for the mouse and keyboard, has been healed, and it works OK, even without the initramfs. Why? It doesn't make sense.


Maybe there were some modules left over from the previous attempts, which messed modules from the current attempt. When you included the appropriate modules in the initramfs, they are no longer loaded from the corresponding /lib/modules. This may also be the reason you went too aggressive with stripping out your kernel. Maybe it looked like it all worked, but it was due to old modules left in /lib/modules, hiding the changes you made.

I don't know if this is the case, just suggesting some considerations for things I fell for doing the same recently.

Regards,
Georgi
Back to top
View user's profile Send private message
davidbryant
Apprentice
Apprentice


Joined: 11 Jun 2020
Posts: 167
Location: Canyon Lake, Texas

PostPosted: Wed Feb 23, 2022 4:30 pm    Post subject: Re: I'm still confused Reply with quote

logrusx wrote:
...I don't know if this is the case, just suggesting some considerations for things I fell for doing the same recently.

Regards,
Georgi


Thank you for the suggestions, Georgi. I believe my problem is related to udev, which I need to understand a bit better. There were some odd error messages (which I can't locate in the log files) that I couldn't read very well -- they disappeared when tty 7 displayed the login screen. And I couldn't switch back to tty 1 bcause the keyboard was dead.
_________________
David Bryant
Canyon Lake, Texas
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5600
Location: Bavaria

PostPosted: Thu Feb 24, 2022 6:34 pm    Post subject: Reply with quote

For an USB-keyboard and an USB-Mouse you need 3 chapters in kernels "Device Drivers":

1. USB
2. Input
3. HID

The settings for the last two parts I gave you in: https://forums.gentoo.org/viewtopic-p-8692945.html#8692945

Usually all settings for nr. 1 are already done in our AMD64 handbook: https://wiki.gentoo.org/wiki/Handbook:AMD64/Installation/Kernel

Only to be sure ... these MUST be set (enabled) at first:

Code:
Device Drivers  --->
    [*] USB support  --->
        [*]   Support for Host-side USB
        [*]   PCI based USB host interface
        [*]   USB announce new devices
        [*]   Enable USB persist by default
        [*]   USB Monitor
        [*]   xHCI HCD (USB 3.0) support
Maybe - if you have an old USB 2.0 or 1.1:
        [ ]   EHCI HCD (USB 2.0) support
        [ ]   OHCI HCD (USB 1.1) support
I dont believe you have a super old 1.0:
        [ ]   UHCI HCD (most Intel and VIA) support


Together with my settings I gave you in my previous post, this MUST enable your mouse and keyboard when using libinput (this is default in gentoo).

I recommend to set all these settings as static [*] and NOT as module <M>
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum