Bug 434269 - Krita freezes briefly after every completed brush stroke
Summary: Krita freezes briefly after every completed brush stroke
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: General (show other bugs)
Version: 4.4.3-beta1
Platform: Appimage Linux
: NOR major
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-11 03:43 UTC by Autumn Lansing
Modified: 2021-08-07 00:13 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Autumn Lansing 2021-03-11 03:43:49 UTC
SUMMARY

I originally added this problem onto Bug 421376, but after trying to diagnose it better I see differences in that bug to what I'm experiencing, so I'm creating a separate report.

Krita stutters two or three seconds after I complete a pen or mouse stroke. If I start a new stroke right away, the stutter will happen while I'm drawing. If I move the cursor across the canvas without drawing, the cursor will stutter as it moves, and any brush stroke after that is normal. When I complete that brush stroke however, the stutter cycle begins all over again.

See video:
https://drive.google.com/file/d/11i-G1C847naJ7YajYXeq9ZuDN4SJ3b53/view?usp=sharing

This is not a memory issue. It occurs when there's well over 10 GB of memory free. It occurs with both pen tablet and mouse. It doesn't matter if Instant Preview is on or off. It also ONLY occurs in Krita. It doesn't happen in GIMP or any other program.

I'm experiencing this in the current beta, 4.4.3-beta1. It also occurred in 4.4.2.

I recently upgraded my Nvidia card from a Quadro 600 to a GeForce GTX 660. I'm not sure if the issue was happening before that, but it's become painfully more noticeable in the past couple of weeks, perhaps because I'm doing more detail work in Krita at the moment. The GeForce card, however, is the same card I used in my previous machine, and there were no problems with it up through November of last year when I switched computers. I updated the Nvidia drivers today and the problem still happens.

This stutter makes Krita rather annoying to work with. I've had to adjust my workflow to wait a few seconds after I complete a line before I start drawing another.

STEPS TO REPRODUCE
1. Draw a line.
2. Move the cursor after completing the line.

OBSERVED RESULT
The cursor stutters after two or three seconds.

EXPECTED RESULT
No stutter

SOFTWARE/OS VERSIONS
Krita

 Version: 4.4.3-beta1
 Languages: en_US, en
 Hidpi: true

Qt

  Version (compiled): 5.12.9
  Version (loaded): 5.12.9

OS Information

  Build ABI: x86_64-little_endian-lp64
  Build CPU: x86_64
  CPU: x86_64
  Kernel Type: linux
  Kernel Version: 5.10.21-200.fc33.x86_64
  Pretty Productname: Fedora 33 (Cinnamon)
  Product Type: fedora
  Product Version: 33
  Desktop: X-Cinnamon

OpenGL Info
 
  Vendor:  "NVIDIA Corporation" 
  Renderer:  "GeForce GTX 660/PCIe/SSE2" 
  Version:  "4.6.0 NVIDIA 460.56" 
  Shading language:  "4.60 NVIDIA" 
  Requested format:  QSurfaceFormat(version 3.0, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
  Current format:    QSurfaceFormat(version 4.6, options QFlags<QSurfaceFormat::FormatOption>(DeprecatedFunctions), depthBufferSize 24, redBufferSize 8, greenBufferSize 8, blueBufferSize 8, alphaBufferSize 8, stencilBufferSize 8, samples -1, swapBehavior QSurfaceFormat::DoubleBuffer, swapInterval 0, colorSpace QSurfaceFormat::DefaultColorSpace, profile  QSurfaceFormat::CompatibilityProfile) 
     Version: 4.6
     Supports deprecated functions true 
     is OpenGL ES: false 

QPA OpenGL Detection Info 
  supportsDesktopGL: true 
  supportsOpenGLES: true 
  isQtPreferOpenGLES: false 

Hardware Information

  GPU Acceleration: auto
  Memory: 24034 Mb
  Number of Cores: 4
  Swap Location: /tmp

Current Settings

  Current Swap Location: /tmp
  Current Swap Location writable: true
  Undo Enabled: true
  Undo Stack Limit: 30
  Use OpenGL: true
  Use OpenGL Texture Buffer: true
  Use AMD Vectorization Workaround: false
  Canvas State: OPENGL_SUCCESS
  Autosave Interval: 900
  Use Backup Files: true
  Number of Backups Kept: 1
  Backup File Suffix: ~
  Backup Location: Same Folder as the File
  Backup Location writable: false
  Use Win8 Pointer Input: false
  Use RightMiddleTabletButton Workaround: false
  Levels of Detail Enabled: false
  Use Zip64: false


Display Information
Number of screens: 2
	Screen: 0
		Name: DVI-D-0
		Depth: 24
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: HP Inc.
		Model: HP VH240a-
		Refresh Rate: 60
	Screen: 1
		Name: DP-0
		Depth: 24
		Scale: 1
		Resolution in pixels: 1920x1080
		Manufacturer: LG Electronics
		Model: LG IPS FULLHD
		Refresh Rate: 60
Comment 1 Autumn Lansing 2021-03-11 22:58:12 UTC
As I worked in Krita today, I paid close attention to what was going on, and I now have a better idea of what's happening. It's not simply the pen or mouse stuttering, it's Krita itself freezing.

After completing a pen stroke, not only does the pen and mouse stutter, but it affects everything in Krita: rotating the canvas, zooming in and out, adjusting sliders in a toolbox, etc. The program itself freezes briefly.

There's another problem I've been having that I now believe is related to this as well. On occasion, after a pen stroke is completed, Krita freezes and remains frozen. The only way to unfreeze it is to save the file I'm working on.

I'm changing the title of this bug to reflect the new information.
Comment 2 Dmitry Kazakov 2021-07-29 12:45:29 UTC
Hi, Autumn!

The bug should be fixed now in Krita 5.0 with this commit:

https://invent.kde.org/graphics/krita/-/commit/cbb70a7b4518f234bf905e9042faa387d8226e0f

Sadly, we cannot release an update for 4.x branch anymore, so the fix will be available only for 5.0 release that is still yet to be published.

The only workaround the issue in 4.x branch is to avoid keeping too many open documents open in Krita at the same time. Basically, the delay happens every time we try to update the memory consumption shown in the window title. And the delay in proportional to the amount of memory Krita consumes at the moment.
Comment 3 Autumn Lansing 2021-07-30 19:26:55 UTC
Thanks, Dmitry!

I'd noticed that the problem didn't occur when I only had two or three documents open, so I've been using the workaround you suggested. I'm glad that the issue was something you could fix and not a problem on my end. It's a very frustrating bug. I look forward to the release of 5.0. Thanks for all your hard work!
Comment 4 Dmitry Kazakov 2021-08-06 13:22:24 UTC
Hi, Autumn!

We are going to make a 4.4.7 release, just for the sake of fixing this bug :)
Comment 5 Autumn Lansing 2021-08-07 00:13:43 UTC
Awesome! Thanks, Dmitry! I look forward to it.