Bug 364837 - High CPU usage when kdenlive window is on top
Summary: High CPU usage when kdenlive window is on top
Status: RESOLVED WORKSFORME
Alias: None
Product: kdenlive
Classification: Applications
Component: User Interface (show other bugs)
Version: 15.12.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Jean-Baptiste Mardelle
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-27 23:51 UTC by BobSCA
Modified: 2019-02-11 04:33 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
fritzibaby: Brainstorm+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BobSCA 2016-06-27 23:51:40 UTC
When kdenlive is the top window and idle, high CPU utilization occurs as follows:
compiz:100% 
Xorg: 25%.
kdenlive: 15%

Observed on kdenlive 15.12.3 and 16.07.70.
Opening any dialog in kdenlive, e.g. "New" or "Open" dialogs, drops CPU usage to normal values while those dialogs remain open.

Reproducible: Always

Steps to Reproduce:
1. Start kdenlive.
2. Start "top" in a terminal window.
3. Position the two windows so that both can be seen, with kdenlive having the focus.

Actual Results:  
High CPU utilization as described above.

Expected Results:  
Normal idle CPU utilization (typically no task >5%).

Running on a Windows 8.1 host in a Ubuntu VirtualBox VM with 3D acceleration disabled.

If 3D acceleration is enabled in the VM, then CPU usage is reduced to:
compiz: 17%
Xorg: 12%
kdenlive: 15%
Comment 1 PenGYveR 2016-06-28 15:49:21 UTC
Same kind of problem for me. I just launch kdenlive and the CPU is instantly completely used. Kdenlive is usable. Switching to another applications or opening kdenlive dialogs doesn't reduce CPU usage.

OS : kaos
Kdenlive : 16.04.2
QT : 5.7.0
KDE Frameworks : 5.23.0
Comment 2 Jean-Baptiste Mardelle 2016-07-03 22:04:31 UTC
Thanks for your reports. I did trace part of the problem to an issue with KDE Toolbars that I reported here: bug #365050

Also, I see a big CPU increase if the project bin's width is reduced so that the search line in the project Bin is very small. Resizing bin so that the search line is bigger fixes the high CPU usage
Comment 3 BobSCA 2016-07-03 23:31:02 UTC
Thanks for your response, Jean-Baptiste. I tried resizing the bin from very narrow to full window width, and even turned off the bin display and every other windows shown in the View menu. CPU usage remains unchanged.
Comment 4 Guido 2016-07-28 22:11:39 UTC
I can confirm the behaviour descripted by J-B. 
Kdenlive uses about 100% CPU while is doing nothing.
Comment 5 Guido 2016-07-28 22:37:44 UTC
I applied you proposed but the problem is still there also after a logout/login
Kdenlive uses about 100% CPU and Xorg about 30% CPU.

Xorg 1.18.4
Intel driver (SNA accelmethod)
KDE Plasma 5.7
Comment 6 Guido 2016-07-28 22:46:59 UTC
if I remove the project bin the problem disappears
Comment 7 Jean-Baptiste Mardelle 2016-07-29 06:30:06 UTC
Yes, I have identified and reported another issue - this time in Qt - where the project bin search bar uses huge cpu resources if it is resized to be very small.
https://bugreports.qt.io/browse/QTBUG-54676
Comment 8 Jean-Baptiste Mardelle 2016-07-29 07:03:48 UTC
Git commit 98a3d5800d787414e44fc53ff3a39e78655fc7e4 by Jean-Baptiste Mardelle.
Committed on 29/07/2016 at 07:03.
Pushed by mardelle into branch 'Applications/16.08'.

Workaround Qt bug 54676 causing high CPU usage

M  +28   -13   src/bin/bin.cpp
M  +6    -0    src/bin/bin.h

http://commits.kde.org/kdenlive/98a3d5800d787414e44fc53ff3a39e78655fc7e4
Comment 9 Wegwerf 2016-08-02 10:37:49 UTC
BobSCA, can you please check whether the fix correctly fixes the bug for you? If yes, I would like to ask you to be so kind as to close this bug report as resolved. Thank you very much for your cooperation!
Comment 10 BobSCA 2016-08-02 15:16:48 UTC
I just did an upgrade from the kdenlive-master ppa and found that I still have the problem. 

I'm not sure if the above commit into the Applications/16.08 branch is currently merged and compiled on that ppa. Version shows as 16.11.70.
Comment 11 Wegwerf 2016-08-02 15:27:03 UTC
I've checked the master and it lists JBM's fix for the Qt issue. Looks as it didn't fix the bug for you. Thank you for quickly checking!
Comment 12 Wegwerf 2016-10-08 15:45:35 UTC
Bob, can you please report as to the current status: please try with recent development version and please report back if the bug is now fixed for you. Thank you very much for your cooperation!
Comment 13 BobSCA 2016-10-08 17:09:37 UTC
I did an upgrade from the kdenlive-master ppa and found there was no change in CPU usage.
Comment 14 Wegwerf 2016-10-08 17:10:28 UTC
As this is an Qt issue, did you see an Qt upgrade in the meantime?
Comment 15 Jean-Baptiste Mardelle 2016-10-08 17:29:31 UTC
Some update about this:
The Qt-bug is not fixed:
https://bugreports.qt.io/browse/QTBUG-54676
But I pushed a workaround in master so it shouldn't be a problem anymore.

The KDE Frameworks bug is still not fixed despite my patch proposal, I just pinged the Frameworks maintainer:
https://git.reviewboard.kde.org/r/128421/

So it still causes CPU usage and prevents going to sleep. I hope we can find a solution for KDE Framewors 5.28.
Comment 16 BobSCA 2016-10-08 17:58:30 UTC
Wegwerf, I am not familiar with Qt and don't know if there has been a Qt upgrade. Is there something specific you would like me to check?
Comment 17 Wegwerf 2016-10-08 20:41:30 UTC
As JBM just pointed out, the fix hasn't yet landed in Qt, so we'll have to wait.
Comment 18 farid 2016-12-20 19:02:55 UTC
Could you please test if this has been fixed? Eitherwat I am thinking of closing this since it is not a Kdenlive issue per se.
Comment 19 BobSCA 2016-12-20 20:06:07 UTC
Just upgraded from kdenlive-master ppa -- problem still occurs.
Comment 20 emohr 2019-01-12 14:47:43 UTC
CPU issue should be better (lower) in actual refactoring version.

Please try with the actual Kdenlive_Nightly_Appimage
https://binary-factory.kde.org/job/Kdenlive_Nightly_Appimage_Build/lastSuccessfulBuild/artifact/
Comment 21 Bug Janitor Service 2019-01-27 04:33:08 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 22 Bug Janitor Service 2019-02-11 04:33:08 UTC
This bug has been in NEEDSINFO status with no change for at least
30 days. The bug is now closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

Thank you for helping us make KDE software even better for everyone!