Slow response on mouse and keyboard

Post Reply
cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Slow response on mouse and keyboard

Post by cap_cap »

I believe i've seen it before (being on 20.04) I think it worsen after i updated my box to 20.10
It looks like that. At some point you just can't move the cursor or aps do not react on key presses. Freese time vary from split second to longer like 20 sec, at this point i usually loose myself and start hitting my laps with the keybord. It's not the original cause for the trouble, trust me))
Initially i thought it was my radio Logitech 400+ that is trouble maker. Ordered new on Amazon and found that brandnew behaves the same fashion. Switched to the wired pair kbd and mouse, it is much better still from time to time I'm seeing the same bug. Just usually shorter in time and it's usually mouse rather than keyboard.

Anybody seen such before?

User avatar
odroid
Site Admin
Posts: 38569
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English, Korean
ODROIDs: ODROID
Has thanked: 2239 times
Been thanked: 1296 times
Contact:

Re: Slow response on mouse and keyboard

Post by odroid »

Which kernel version and Desktop UI do you run now?

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

5.14.0-odroid-arm64
GNOME 40.4.0

User avatar
tobetter
Posts: 8927
Joined: Mon Feb 25, 2013 10:55 am
languages_spoken: Korean, English
ODROIDs: Many
Location: Paju, South Korea
Has thanked: 521 times
Been thanked: 1432 times
Contact:

Re: Slow response on mouse and keyboard

Post by tobetter »

cap_cap wrote:
Tue Dec 14, 2021 2:47 pm
5.14.0-odroid-arm64
GNOME 40.4.0
Maybe you can try previous kernel 5.13.

Code: Select all

sudo apt update
sudo apt install linux-image-5.13.0-odroid-arm64
sudo flash-kernel --force 5.13.0-odroid-arm64
sudo reboot

User avatar
mctom
Posts: 1008
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 104 times
Been thanked: 123 times
Contact:

Re: Slow response on mouse and keyboard

Post by mctom »

Freezes happened to me on N2+, the solution was to set cpu governor to performance. Freezes were caused by problems with PLL loop locking when CPU tried changing frequency from time to time. However it was usually 5-10 seconds.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

Can you please describe this in a fewer more words? Thank you
mctom wrote:
Tue Dec 14, 2021 5:33 pm
Freezes happened to me on N2+, the solution was to set cpu governor to performance. Freezes were caused by problems with PLL loop locking when CPU tried changing frequency from time to time. However it was usually 5-10 seconds.

User avatar
mctom
Posts: 1008
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 104 times
Been thanked: 123 times
Contact:

Re: Slow response on mouse and keyboard

Post by mctom »

Just a few:

Code: Select all

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Please show us the output.

Also, check for any recent logs in dmesg right after a freeze:

Code: Select all

dmesg | tail -n20
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

performance

Code: Select all

cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Please show us the output.

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

mctom wrote:
Wed Dec 15, 2021 4:38 am
Also, check for any recent logs in dmesg right after a freeze:

Code: Select all

dmesg | tail -n20
[149870.841450] [ 30516] 1001 30516 590641 3326 421888 0 0 Web Content
[149870.841457] [ 30533] 1001 30533 497175 79323 1286144 0 0 mpv
[149870.841466] [ 33175] 0 33175 18193 619 110592 0 0 cupsd
[149870.841475] [ 33176] 0 33176 43528 626 98304 0 0 cups-browsed
[149870.841483] [ 33187] 7 33187 4017 199 65536 0 0 dbus
[149870.841491] [ 33188] 7 33188 4017 198 65536 0 0 dbus
[149870.841509] [ 44642] 1001 44642 2228 53 53248 0 0 dconf
[149870.841516] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/user.slice/user-1001.slice/session-c2.scope,task=Isolated Web Co,pid=4877,uid=1001
[149870.841683] Out of memory: Killed process 4877 (Isolated Web Co) total-vm:3200764kB, anon-rss:591392kB, file-rss:0kB, shmem-rss:3228kB, UID:1001 pgtables:3720kB oom_score_adj:0
[149870.934308] oom_reaper: reaped process 4877 (Isolated Web Co), now anon-rss:0kB, file-rss:0kB, shmem-rss:1668kB
[159254.687844] Purging 3911680 bytes
[159254.697925] Purging 3747840 bytes
[159254.707836] Purging 3776512 bytes
[159254.910329] Purging 3747840 bytes
[159254.912432] Purging 3919872 bytes
[159254.918488] Purging 3977216 bytes
[159254.934360] Purging 3919872 bytes
[159254.951460] Purging 4038656 bytes
[159254.957520] Purging 4038656 bytes
[159254.968469] Purging 4038656 bytes

User avatar
mctom
Posts: 1008
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 104 times
Been thanked: 123 times
Contact:

Re: Slow response on mouse and keyboard

Post by mctom »

Okay, that is unexpected.

I had the same "purging" dmesg entries when I experienced freezes with my system. I assumed that was due to PLL problems, as PLL warnings also popped up in the vicinity.
So, my conclusion was that due to my experiments with schedutil and ondemand governors this problem happened, that's why I sticked to performance governor.

A bit of explanation:
PLL is a Phase Locked Loop, a component that multiplies clock frequency. If a system is able to modify clock frequency on the fly (to save power, usually), it changes configuration of PLL.
But the configuration change is not instantaneous, as the PLL must reset and stabilize itself. For the time being, the system is effectively frozen as it has no usable clock.
Normally this process occurs so fast the user has no chance of noticing it. However, if PLL is unable to lock itself (due to faulty configuration, for example), the system will stay frozen until some other bit of hardware decides to configure it again with some safer parameters.

CPU governors are sets of rules when and how CPU clock frequency shall change. "Performance" governor does not change CPU clock at all, as it is always set at maximum. That solved my problem, but apparently doesn't solve it for you, which indicates I was wrong all along.

One question though: Did you overclock CPU?
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

no i didn't
mctom wrote:
Thu Dec 16, 2021 5:14 pm
One question though: Did you overclock CPU?

User avatar
mctom
Posts: 1008
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 104 times
Been thanked: 123 times
Contact:

Re: Slow response on mouse and keyboard

Post by mctom »

viewtopic.php?p=327917#p327917

Here is my original post where I described my findings. There is nothing similar to be seen in your dmesg, so you may have some different issue than mine.

Investigating further, when your mouse freezes, does the system work normally? (for example, continue playing a video)
Have you tried changing a USB port for your wireless keyboard / mouse receiver? (I know it sounds daft, but may actually help)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

mctom wrote:
Fri Dec 17, 2021 12:43 am
Investigating further, when your mouse freezes, does the system work normally? (for example, continue playing a video)
yes the computer keep on doing the tasks just not responding on mouse or keys
mctom wrote:
Fri Dec 17, 2021 12:43 am
Have you tried changing a USB port for your wireless keyboard / mouse receiver? (I know it sounds daft, but may actually help)
yes, was my first guess, also i mentioned i tried buyoing new keyboard (it's wireless combo). Now using regular wired ones, freeze effect is less long, but happens from time to time. On wireless keyboard it was very-very often.

User avatar
mctom
Posts: 1008
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 104 times
Been thanked: 123 times
Contact:

Re: Slow response on mouse and keyboard

Post by mctom »

Oh, okay, never mind my rant then, that is a completely different issue.
These users thanked the author mctom for the post:
cap_cap (Fri Dec 17, 2021 9:16 am)
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

User avatar
mad_ady
Posts: 10177
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, C4, N1, N2, H2, Go, Go Advance
Location: Bucharest, Romania
Has thanked: 632 times
Been thanked: 821 times
Contact:

Re: Slow response on mouse and keyboard

Post by mad_ady »

Try connecting the wireless keyboard dongle either via an otg cable to the otg port, or via a cable extender, away from the chassis. USB3 is known to interfere a bit with the 2.4GHz spectrum, so adding a bit of distance helps a lot.
These users thanked the author mad_ady for the post:
cap_cap (Fri Dec 24, 2021 1:42 am)

crashoverride
Posts: 5522
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 490 times
Contact:

Re: Slow response on mouse and keyboard

Post by crashoverride »

A longer dmesg would probably reveal more. However, my guess is that the issue is due to exactly what is being reported. The OOM (out of memory) handler is killing processes. When you are out of memory, the kernel has to swap out whatever it can that is read-only file based pages and load them back. This drastically impacts performance especially if there is something re-spawning things (like systemd, or a script).

Try creating a swapfile and see if it impacts (changes, or solves) the issue.

User avatar
mctom
Posts: 1008
Joined: Wed Nov 11, 2020 4:44 am
languages_spoken: english, polish
ODROIDs: N2+, Game Advance, a few XU4
Location: Gdansk, Poland
Has thanked: 104 times
Been thanked: 123 times
Contact:

Re: Slow response on mouse and keyboard

Post by mctom »

crashoverride wrote:
Fri Dec 17, 2021 8:10 pm
However, my guess is that the issue is due to exactly what is being reported.
I think that was reported 3 hours before the freeze, but I agree it may be worth looking into nevertheless.
Punk ain't no religious cult, punk means thinking for yourself!

Maintainer of PiStackMon

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

I never did that, would assume not a rocket science, also google-able. One question, where you recomend to create the swap-file? At some point i gave up the idea of holding my actively accessed data on eMMC and moved that to external HDD. How about swap?
crashoverride wrote:
Fri Dec 17, 2021 8:10 pm
A longer dmesg would probably reveal more. However, my guess is that the issue is due to exactly what is being reported. The OOM (out of memory) handler is killing processes. When you are out of memory, the kernel has to swap out whatever it can that is read-only file based pages and load them back. This drastically impacts performance especially if there is something re-spawning things (like systemd, or a script).

Try creating a swapfile and see if it impacts (changes, or solves) the issue.

crashoverride
Posts: 5522
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 490 times
Contact:

Re: Slow response on mouse and keyboard

Post by crashoverride »

cap_cap wrote:
Sat Dec 18, 2021 8:12 am
I never did that, would assume not a rocket science, also google-able.
It is a very common procedure and many guides are available such as:
https://www.digitalocean.com/community/ ... untu-20-04
cap_cap wrote:
Sat Dec 18, 2021 8:12 am
One question, where you recomend to create the swap-file? At some point i gave up the idea of holding my actively accessed data on eMMC and moved that to external HDD. How about swap?
If you have a reliably working HDD, that is the preferred location due to the large amount of write operations. Another advantage is that the HDD light will give you a visual hint if swap space is being heavily used.
These users thanked the author crashoverride for the post:
cap_cap (Sun Dec 19, 2021 10:31 am)

User avatar
rooted
Posts: 9004
Joined: Fri Dec 19, 2014 9:12 am
languages_spoken: english
Location: Gulf of Mexico, US
Has thanked: 745 times
Been thanked: 422 times
Contact:

Re: Slow response on mouse and keyboard

Post by rooted »


crashoverride wrote: If you have a reliably working HDD, that is the preferred location due to the large amount of write operations. Another advantage is that the HDD light will give you a visual hint if swap space is being heavily used.
They could use the heartbeat LED (blue) for disk activity.

Activating Zswap would likely suffice in finding out of it's related to swapping.

cap_cap
Posts: 49
Joined: Mon Nov 04, 2019 7:17 am
languages_spoken: english
ODROIDs: N2
Has thanked: 7 times
Been thanked: 2 times
Contact:

Re: Slow response on mouse and keyboard

Post by cap_cap »

It's been like 5 days testdrive. Thus far it worked okay. Thank you very much!
mad_ady wrote:
Fri Dec 17, 2021 4:15 pm
Try connecting the wireless keyboard dongle either via an otg cable to the otg port, or via a cable extender, away from the chassis. USB3 is known to interfere a bit with the 2.4GHz spectrum, so adding a bit of distance helps a lot.
These users thanked the author cap_cap for the post:
odroid (Mon Dec 27, 2021 4:45 pm)

Post Reply

Return to “Hardware and peripherals”

Who is online

Users browsing this forum: No registered users and 5 guests