Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Screen freezes for a bit whenever i use maim #270

Open
rml2002 opened this issue Dec 2, 2022 · 3 comments
Open

Screen freezes for a bit whenever i use maim #270

rml2002 opened this issue Dec 2, 2022 · 3 comments

Comments

@rml2002
Copy link

rml2002 commented Dec 2, 2022

Hi,

I've been having some problem with the command maim recently, every time I use a simple command such as:
maim test.jpg
The screen freezes for a bit, as if it was flickering. It is something really quick but I wanted to take screenshots as smoothly as possible.

i don't know if it has to do with the command or my pc hardware. My configurations are:
OS: IGX 3.0.46 x86_64
Kernel: 5.10.0-19-amd64
Shell: bash 5.1.4
CPU: AMD G-T48N (2) @ 1.400GHz
GPU: AMD ATI Radeon HD 6310
Memory: 835MiB / 3550MiB

Hope someone can help me with this one.

@foxpy
Copy link
Collaborator

foxpy commented Dec 18, 2022

I currently don't have a proper machine to debug this on, but I can ask you recording these three values (please run benchmarks on idling machine!):

  1. time maim test.jpg (this one will just output time);
  2. strace -rf maim test.jpg (this one will output a long list of syscall timestamps, please save it in file and upload somewhere so I can download it);
  3. perf record -F 1000 maim test.jpg (this one will create perf.data file, please upload it somewhere and include a link).

Hopefully this will help us seeing where maim spends most of its time (and probably find the reason for your screen freezing problem).

@rml2002
Copy link
Author

rml2002 commented Dec 21, 2022

Here are the outputs:

time maim test.jpg
real 0m0.417s
user 0m0.143s
sys 0m0.096s

strace -rf maim test.jpg
strace.txt

perf record -F 1000 maim test.jpg
https://drive.google.com/file/d/136LyOYn9e0SEgF9aikVjtHzl90jlOVVr/view?usp=drivesdk

@foxpy
Copy link
Collaborator

foxpy commented Feb 25, 2023

Hey @rml2002

Sorry for making you wait so much. I have been postponing this issue for a long time because I feel under-qualified to resolve it.

So, after analysing your strace report (perf report turned out to be not as useful), I have figured out maim waits whopping 112 milliseconds for reply from X11, while practically doing nothing. I guess your system freezes for precisely this amount of time?

Nevertheless, I have no idea how to resolve this issue. Also damn, this CPU is really slow, each system call in your report takes 20-25 more time than a CPU on my test stand.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants