Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Disable keyboard...err... keyboard suspend resume and power?
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Tue Mar 30, 2021 6:45 pm    Post subject: Disable keyboard...err... keyboard suspend resume and power? Reply with quote

Okay, need yet another software fix for a hardware problem.

My wireless keyboard is crap. Well, my house is crap. I have one heck of a lot of random interference that sometimes my wireless keyboard interprets as a shutdown or suspend event and acts accordingly.

While the shutdown is very annoying, the suspend is more so, mainly because one of my DVBs does not suspend properly and comes up in a dazed and confused state when resuming. So then I have to completely reboot to make it come back up.

Now, completely disabling suspend/resume not exactly what I want : if I stopped mythtv and rmmod the module, (but leave the other DVB as is) then I would be fine with suspending...so that's not the route I want to go. Besides it doesn't stop the poweroffs.

So is there a way in Gnome to disable the one-button keyboard98 suspend/resume and poweroff "buttons" without disabling suspend/resume/poweroff using the mouse through the GUI, echo mem > /sys/power/state, and surely do not want to prohibit typing sudo shutdown -h now/systemctl halt ... ?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Anon-E-moose
Watchman
Watchman


Joined: 23 May 2008
Posts: 6097
Location: Dallas area

PostPosted: Tue Mar 30, 2021 7:14 pm    Post subject: Reply with quote

acpi stuff? look in /etc/acpi/default.sh
_________________
PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Tue Mar 30, 2021 7:18 pm    Post subject: Reply with quote

Are you using X? You could disable XF86Sleep and XF86PowerOff according to the accepted answer here.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Tue Mar 30, 2021 9:21 pm    Post subject: Reply with quote

I suspect mucking the acpi routines may affect the GUI routines.
As I wrote the post I was thinking about xmodmap and mapping those scancodes away...luckily I am using X so this should work?

For now: xmodmap -e 'keycode 124 = X' -e 'keycode 150 = S' and hope it stops sleeping/shutting down...(and dumps random S's and X's )

Now for Wayland...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Wed Jun 16, 2021 2:42 pm    Post subject: Reply with quote

FSCK. still suspending somehow.

New experiment: change VT out of X11 and to a login screen... Try THAT, keyboard! (since login does not accept keyboard sequences...)

If only the dvb driver would suspend/resume properly...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Tue Jul 06, 2021 1:24 pm    Post subject: Reply with quote

Okay this is ultimately annoying:
Since nothing has apparently stopped the suspends and poweroffs, let's now plug into systemd-logind:

/etc/systemd/logind.conf:

HandlePowerKey=ignore
HandleSuspendKey=ignore

Now lets see if weirdness occurs.... This is NOT what I want because ACPI handles the chassis power key too and goes through systemd-logind that way... so this is also effectively disabling my front panel switch. Ugh. These are the days where having all power keys handled through libinput is annoying, but really it's probably just the keyboard that's annoying.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Wed Jul 07, 2021 2:22 am    Post subject: Reply with quote

If you have successfully blocked the system from suspending at all, that gives you some freedom to experiment with finding exactly how the keyboard is able to suspend your system when the key is pressed (or a bogus keypress is detected). Do the keyboard keys generate the same ACPI event as a soft tap on the power button? If yes, perhaps you could patch your kernel to make those keys inert.

You could also go with a wired keyboard, which would make the interference irrelevant. ;)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Wed Jul 07, 2021 1:32 pm    Post subject: Reply with quote

Wired keyboard and HTPC just doesn't quite go together... :(

Really I should find the source of the noise... though it still could be external.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21602

PostPosted: Wed Jul 07, 2021 3:42 pm    Post subject: Reply with quote

You said this was a MythTV system with DVB recorders, so I thought it was the backend, not the frontend. Are you running both frontend and backend on the same hardware? Wouldn't that require having the system on at any time a program you wish to record is broadcast?

If you need to fix this in software, I think the first step is understanding which layer(s) of the stack can distinguish between a soft tap on the power button and the keyboard key. Once we know which layers can tell them apart, then we can identify which layer is best to apply the distinction that ignores the keyboard and not the power button.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Wed Jul 07, 2021 4:37 pm    Post subject: Reply with quote

Correct, the frontend and backend are the same machine (though I have other frontends around ). Technically even the backend can suspend for a few hours per day when no expected recordings need to take place, but yes it still needs to pick up EPG data and some broadcasters are stingy, giving only a few hours at a time.

And yes need to figure out where the event is coming from. Systemd is not being kind and telling me who pressed the button, but at least it is indicating an event is happening versus some hardware failure and causing the machine to crash without any notice ...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Fri Aug 06, 2021 2:51 am    Post subject: Reply with quote

Well I did the ultimate test of checking where the events are coming from:

- I disconnected the keyboard and ran keyboardless (since recently I've only been watching remotely instead of using the TV monitor).

After 20 odd days, no shutdowns or suspends where it had been at least a weekly event... I guess it's pretty certain at this point that the keyboard seems to be the source of the event... now how to stop it without the drastic removal of keyboard...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Fri Aug 06, 2021 1:45 pm    Post subject: Reply with quote

Bizarre. Is there any way the BIOS/UEFI is doing it? I mean, do sleep/power keys do anything while you're looking at a bootloader?

But I think your first assertion is probably correct-- the keyboard is crap. It seems to me that if the wireless function is indeed the root cause, then either it doesn't encrypt keystrokes or that encryption is pretty poor. If the wireless function is not the root cause, then maybe its microcontroller is malfunctioning, which may or may not itself be a result of local interference.

That (finally) reminds me-- did you ever open the keyboard and look for liquid damage? Or to be less specific, does the problem still appear if the wireless receiver is connected but the keyboard is completely disabled (as in, it has removable batteries)?

After so much of being trolled-by-the-physics-department, I'd have already got something brand new that runs in a different frequency range... or infrared ;) ...but that's just me.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Fri Aug 06, 2021 2:28 pm    Post subject: Reply with quote

Crap or nonexistent encryption is probably the root cause. I definitely get random trash keystrokes once in a while too, so it's not completely out of the question it's generating poweroff or suspend operations as well...

Now how to get it ignored has been the question...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments 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