Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] no keyboard input in X with kbd driver
View unanswered posts
View posts from last 24 hours

Goto page 1, 2  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Fri Sep 06, 2024 7:39 pm    Post subject: [SOLVED] no keyboard input in X with kbd driver Reply with quote

going for static /dev, so no udev/mdev and no libudev.
i configure X to use kbd and mouse drivers for input devices in xorg.conf.d, but...
mouse works, i expect it to!
keyboard doesnt work in X. :(
just interacts with tty, so i can ctrl+c out of X, but i cant type anything

mouse also moves very fast and just feels "grid-aligned". maybe configuration could fix that but i just want to have keyboard input for now

any help?

keyboard config:
Code:
~ cat /etc/X11/xorg.conf.d/03-keyboard.conf
Section "InputDevice"
        Identifier "system-keyboard"
        Driver  "kbd"
EndSection


(edit: solved, issue with my /dev, missing /dev/tty0 :oops:)


Last edited by yuviazzz on Fri Sep 13, 2024 10:27 am; edited 4 times in total
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Fri Sep 06, 2024 8:02 pm    Post subject: Re: no keyboard input in X with kbd driver Reply with quote

yuviazzz wrote:
i configure X to use kbd and mouse drivers for input devices in xorg.conf.d, [...]

But the files you posted specify evdev as input driver...

Code:
Driver          "evdev"

_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Fri Sep 06, 2024 8:22 pm    Post subject: Re: no keyboard input in X with kbd driver Reply with quote

GDH-gentoo wrote:
yuviazzz wrote:
i configure X to use kbd and mouse drivers for input devices in xorg.conf.d, [...]

But the files you posted specify evdev as input driver...

Code:
Driver          "evdev"

sounds like i havent had any sleep :oops:
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Fri Sep 06, 2024 8:34 pm    Post subject: Re: no keyboard input in X with kbd driver Reply with quote

GDH-gentoo wrote:
yuviazzz wrote:
i configure X to use kbd and mouse drivers for input devices in xorg.conf.d, [...]

But the files you posted specify evdev as input driver...

Code:
Driver          "evdev"

changed the post so it should hopefully have the correct keyboard configuration,
sorry!!
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Fri Sep 06, 2024 8:58 pm    Post subject: Re: no keyboard input in X with kbd driver Reply with quote

yuviazzz wrote:
changed the post so it should hopefully have the correct keyboard configuration

And did it work? You might have to restart the X server.

Be aware that not many people here have a static /dev setup, so available help might be quite limited....
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Fri Sep 06, 2024 9:08 pm    Post subject: Re: no keyboard input in X with kbd driver Reply with quote

GDH-gentoo wrote:
yuviazzz wrote:
changed the post so it should hopefully have the correct keyboard configuration

And did it work? You might have to restart the X server.

Be aware that not many people here have a static /dev setup, so available help might be quite limited....

well that configuration doesnt work, sadly. i have played with adding options to specify device and doing it with InputClass match stuff and so on and nothing changed with that :(

and im fine with whatever help i can get, i dont mind waiting for help. :D
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Fri Sep 06, 2024 9:16 pm    Post subject: Reply with quote

Let's start by posting Xorg's log, then. It's usually /var/log/Xorg.0.log if the server is run as root. You'll have to retrieve it using a virtual terminal if the keyboard doesn't work with X.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Fri Sep 06, 2024 11:00 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Let's start by posting Xorg's log, then.

here should be the log i hope
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Sat Sep 07, 2024 12:22 am    Post subject: Reply with quote

yuviazzz wrote:
GDH-gentoo wrote:
Let's start by posting Xorg's log, then.

here should be the log i hope

It is. Well, it looks like the driver that you want to use for the keyboard is now used:

Code:
[ 7892.055] Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
...
[ 7892.058] (**) |-->Input Device "Keyboard0"
...
[ 7892.061] (II) LoadModule: "kbd"
[ 7892.061] (II) Loading /usr/lib64/xorg/modules/input/kbd_drv.so
...
[ 7893.145] (II) Using input driver 'kbd' for 'Keyboard0'

But there is an error later which may or may not be related to your problem:

Code:
[ 7893.145] (EE) kbd: Keyboard0: failed to set us as foreground pgrp (Bad file descriptor)

This error comes from the kbd driver, so we are entering "limited help available" territory :P How are you starting the X server?
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Sat Sep 07, 2024 12:42 am    Post subject: Reply with quote

GDH-gentoo wrote:
How are you starting the X server?

with:
Code:
startx
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Sat Sep 07, 2024 10:01 pm    Post subject: Reply with quote

Code:
[ 7893.145] (EE) kbd: Keyboard0: failed to set us as foreground pgrp (Bad file descriptor)

It looks like that is a failed call to tcsetpgrp(). You said in the OP that some things work with the keyboard, are you able to switch to a virtual terminal while X is running? If yes, could you post the line that corresponds to the X server in the output of ps -eo pid,pgid,sid,tname,args?

yuviazzz wrote:
GDH-gentoo wrote:
How are you starting the X server?

with:
Code:
startx

Does the expected X client (a window manager, I assume) start?
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Sun Sep 08, 2024 8:07 pm    Post subject: Reply with quote

GDH-gentoo wrote:
You said in the OP that some things work with the keyboard, are you able to switch to a virtual terminal while X is running?

i cant switch to a virtual terminal with X running, but i can still get the command output :)

GDH-gentoo wrote:
If yes, could you post the line that corresponds to the X server in the output of ps -eo pid,pgid,sid,tname,args?

here:
Code:
 9639  9639  1543 tty1     /usr/bin/X -nolisten tcp :0 -auth /tmp/serverauth.bABtxscbbm

?

GDH-gentoo wrote:
Does the expected X client (a window manager, I assume) start?

yes :D
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Sun Sep 08, 2024 10:35 pm    Post subject: Reply with quote

yuviazzz wrote:
Code:
 9639  9639  1543 tty1     /usr/bin/X -nolisten tcp :0 -auth /tmp/serverauth.bABtxscbbm

Hmm, it is strange that Xorg is using /dev/tty1, that's likely the virtual terminal that your shell is using, right? I believe that Xorg (if running as root) should be taking a free one. I also don't see in your log the "using VT number NN" message that is usually printed. What's the output of emerge --pretend --verbose x11-base/xorg-server? I want to see how it was installed.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1289
Location: Richmond Hill, Canada

PostPosted: Sun Sep 08, 2024 11:01 pm    Post subject: Reply with quote

yuviazzz,

xf86-input-evdev vs xf86-input-keyboard.

hiZgb wrote:
[ 7892.053]
X.Org X Server 1.21.1.13
X Protocol Version 11, Revision 0
[ 7892.054] Current Operating System: Linux ivy 6.10.7-gentoo #2 SMP
...

You are using latest Gentoo xorg-server:0/21.1.13 yet your kbd driver is from x11-drivers/xf86-input-keyboard-1.9.0
but x11-drivers/xf86-input-keyboard-1.9.0 is no longer in Gentoo portage tree and from xorg-server:0/21.1.13 point
of view, the xf86-input-keyboard-1.9.0 is not supported for Linux, instead x86-input-evdev should be use.

Not sure how you got xf86-input-keyboard-1.9.0 on your system but according to the source code you may have to define "Device" in
the configuration file for the keyboard. I don't know this will work or not but should take you to next code path.

Actually come to think of it, since X actually did started. so above may not be the reason you are not able to use keyboard. above will just silent the "Keyboard0: failed to set us as foreground pgrp (Bad file descriptor)" error message.

I think you should switch use xf86-input-evdev.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Sun Sep 08, 2024 11:43 pm    Post subject: Reply with quote

pingtoo wrote:
I think you should switch use xf86-input-evdev.

yuviazzz is using a static /dev setup, so x11-drivers/xf86-input-keyboard is the only option here. And only the last version that still had the code for Linux.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Mon Sep 09, 2024 12:17 am    Post subject: Reply with quote

GDH-gentoo wrote:
Hmm, it is strange that Xorg is using /dev/tty1, that's likely the virtual terminal that your shell is using, right?

yes

GDH-gentoo wrote:
What's the output of emerge --pretend --verbose x11-base/xorg-server?

here:
Code:
[ebuild   R    ] x11-base/xorg-server-21.1.13-r1:0/21.1.13::gentoo  USE="suid xorg xvfb -debug -elogind -minimal (-selinux) -systemd -test -udev -unwind -xcsecurity -xephyr -xnest"
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1289
Location: Richmond Hill, Canada

PostPosted: Mon Sep 09, 2024 12:39 am    Post subject: Reply with quote

GDH-gentoo wrote:
pingtoo wrote:
I think you should switch use xf86-input-evdev.

yuviazzz is using a static /dev setup, so x11-drivers/xf86-input-keyboard is the only option here. And only the last version that still had the code for Linux.


I am not sure, but I think /dev/input/* is not relate to udev (not /dev/input/{by-id,by-path}, they are udev related). If no devtmpfs using. it is still possible use /sys/class/input/* to figure out major/minor number. So I think it is still possible.

if the startx was run by root, I think the "Device=/dev/tty1" worth a try. The code logic will at least open the tty. It is coded poorly, because it will always return TRUE no matter if keyboard can be opened or not.
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Mon Sep 09, 2024 6:22 pm    Post subject: Reply with quote

pingtoo wrote:
I am not sure, but I think /dev/input/* is not relate to udev (not /dev/input/{by-id,by-path}, they are udev related). If no devtmpfs using. it is still possible use /sys/class/input/* to figure out major/minor number. So I think it is still possible.

evdev_drv.so links to libudev.

pingtoo wrote:
if the startx was run by root, I think the "Device=/dev/tty1" worth a try. The code logic will at least open the tty. It is coded poorly, because it will always return TRUE no matter if keyboard can be opened or not.

If "Device" is not specified in the InputDevice section of the configuration file, as far as I understand, the kbd driver uses the terminal that Xorg grabbed:

src/lnx_kbd.c
Code:
static Bool
OpenKeyboard(InputInfoPtr pInfo)
{
    // ...

    s = xf86SetStrOption(pInfo->options, "Device", NULL);
    if (s == NULL) {
       int rc;
       pInfo->fd = xf86Info.consoleFd;
       pKbd->isConsole = TRUE;

       // ...

    } else {
       pInfo->fd = open(s, O_RDONLY | O_NONBLOCK | O_EXCL);
       if (pInfo->fd == -1) {
           xf86Msg(X_ERROR, "%s: cannot open \"%s\"\n", pInfo->name, s);
           free(s);
           return FALSE;
       }
       pKbd->isConsole = FALSE;
       free(s);
    }

    return TRUE;
}

One could specify a "Device", but I don't think it should be the same terminal as the shell's, and I don't know the consequences of pKbd->isConsole == FALSE in the rest of the code, so first I would try specifiying the virtual terminal as Xorg's argument.

yuviazzz, as a test, you could create this file in your home directory:

.xserverrc
Code:
#!/bin/sh
exec /usr/bin/X -nolisten tcp "$@" vtn

with "n" replaced by the number of a /dev/ttyn special file that you are certain that is not in use by an agetty process, and then try startx as usual.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Mon Sep 09, 2024 7:02 pm    Post subject: Reply with quote

GDH-gentoo wrote:
yuviazzz, as a test, you could create this file in your home directory:

.xserverrc
Code:
#!/bin/sh
exec /usr/bin/X -nolisten tcp "$@" vtn

with "n" replaced by the number of a /dev/ttyn special file that you are certain that is not in use by an agetty process, and then try startx as usual.

sadly, X still stays in the virtual terminal my shell started in. :(
i tried tty7, tty8 and tty9, no difference.

would a display manager do anything here?
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1719
Location: South America

PostPosted: Mon Sep 09, 2024 7:09 pm    Post subject: Reply with quote

yuviazzz wrote:
sadly, X still stays in the virtual terminal my shell started in. :(
i tried tty7, tty8 and tty9, no difference.

Really? Does the output of ps -eo pid,pgid,sid,tname,args show the vt argument getting passed to Xorg? If yes, does the output still show Xorg grabbing /dev/tty1?

yuviazzz wrote:
would a display manager do anything here?

It might invoke Xorg with different arguments, and might or might not make a difference. That is, if you find one that doesn't need libudev, and doesn't have a dependency that does...
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Mon Sep 09, 2024 7:17 pm    Post subject: Reply with quote

GDH-gentoo wrote:
Really? Does the output of ps -eo pid,pgid,sid,tname,args show the vt argument getting passed to Xorg? If yes, does the output still show Xorg grabbing /dev/tty1?

yes & yes.

GDH-gentoo wrote:
It might invoke Xorg with different arguments, and might or might not make a difference.

i will try that later and see if it does make a difference.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1289
Location: Richmond Hill, Canada

PostPosted: Mon Sep 09, 2024 9:37 pm    Post subject: Reply with quote

GDH-gentoo wrote:
pingtoo wrote:
I am not sure, but I think /dev/input/* is not relate to udev (not /dev/input/{by-id,by-path}, they are udev related). If no devtmpfs using. it is still possible use /sys/class/input/* to figure out major/minor number. So I think it is still possible.

evdev_drv.so links to libudev.
My apology :oops: Flipping between tabs somehow I concluded xf86-input-eudev have no dependency on udev.

I think GDH-gentoo and I have same assumption that /dev/ have correct content. Since you manually create them can you share the information for them?
Code:
ls -l /dev/tty[0-9] /dev/vc/*
Modern linux seems don't have /dev/vc/* so missing that is ok.
And also
Code:
uname -a
So I know which linux source to check.

So using "kbd" driver. on tty1 run
Code:
startx -- /usr/bin/Xorg :0 vt1 -logverbose 7 
. After this command please share the Xorg's log. I am expecting to see some console/tty opening statement in the log.

You need to use "vt1" (aka tty1) because you start Xorg on tty1 and tty1 is the control terminal where input/output are focus on. So I am expecting the log should something about successful opening it.
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Tue Sep 10, 2024 1:16 pm    Post subject: Reply with quote

display manager does not change anything. :(
oh well
pingtoo wrote:
Since you manually create them can you share the information for them?
Code:
ls -l /dev/tty[0-9] /dev/vc/*
Modern linux seems don't have /dev/vc/* so missing that is ok.
And also
Code:
uname -a
So I know which linux source to check.


here:
Code:
% ls -l /dev/tty[0-9]
crw--w---- 1 root tty 4, 1 sep 10 14:33 /dev/tty1
crw--w---- 1 root tty 4, 2 sep 10 14:33 /dev/tty2
crw--w---- 1 root tty 4, 3 sep 10 14:33 /dev/tty3
crw--w---- 1 root tty 4, 4 sep 10 14:33 /dev/tty4
crw--w---- 1 root tty 4, 5 sep 10 14:33 /dev/tty5
crw--w---- 1 root tty 4, 6 sep 10 14:33 /dev/tty6
crw--w---- 1 root tty 4, 7 sep 10 14:33 /dev/tty7
crw--w---- 1 root tty 4, 8 sep 10 14:33 /dev/tty8
crw--w---- 1 root tty 4, 9 sep 10 14:33 /dev/tty9

and uname -a:
Code:
% uname -a
Linux ivy 6.10.7-gentoo #2 SMP PREEMPT_DYNAMIC Thu Sep  5 20:54:59 CEST 2024 x86_64 12th Gen Intel(R) Core(TM) i5-12600K GenuineIntel GNU/Linux
(im slightly out-of-date, i will update later :D)

pingtoo wrote:
on tty1 run
Code:
startx -- /usr/bin/Xorg :0 vt1 -logverbose 7 
. After this command please share the Xorg's log.

one without device option specified and one with it set to dev/tty1.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1289
Location: Richmond Hill, Canada

PostPosted: Tue Sep 10, 2024 3:08 pm    Post subject: Reply with quote

yuviazzz,

Thanks for the posting those information I requested.

unfortunately, none of indication messages show up in the version that with "vt1". I am not able to come up the reason why they not in the log. But just a guess/question. Did those two run have different output on the starting up terminal ?

Another question, After run "startx ..." did you got switch to X? or nothing happen, you session stay in terminal where you run the command? If it did switched, can you use <Ctrl><Alt><Fn> to switch back/forth?
Back to top
View user's profile Send private message
yuviazzz
n00b
n00b


Joined: 06 Sep 2024
Posts: 24
Location: Sweden

PostPosted: Tue Sep 10, 2024 3:37 pm    Post subject: Reply with quote

pingtoo wrote:
yuviazzz,

Thanks for the posting those information I requested.

unfortunately, none of indication messages show up in the version that with "vt1". I am not able to come up the reason why they not in the log. But just a guess/question. Did those two run have different output on the starting up terminal ?

they had the same output.

pingtoo wrote:
Another question, After run "startx ..." did you got switch to X? or nothing happen, you session stay in terminal where you run the command? If it did switched, can you use <Ctrl><Alt><Fn> to switch back/forth?

it switches to X, but i can not switch back and forth :(
it is like both X and the virtual terminal are focused
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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