Linux: 100% CPU consumption when using Hugin

Bugs that are confirmed but cannot be fixed for some reasons.

Moderators: XnTriq, xnview, Dreamer

rmtk
Posts: 128
Joined: Tue Dec 07, 2010 2:04 am

Linux: 100% CPU consumption when using Hugin

Post by rmtk » Fri Mar 25, 2016 7:41 am

I use Hugin to create panorama photos. But when Hugin is creating panorama to the photo folder opened in XnviewMP, XnviewMP always use all the CPU and freeze the system. The problem can be prevented by creating panoramas to another folder other than the one opend in XniewMP. Please investigate it.

rmtk
Posts: 128
Joined: Tue Dec 07, 2010 2:04 am

Re: Linux: 100% CPU cosumption when using Hugin

Post by rmtk » Thu Mar 02, 2017 4:46 pm

any update on this bug?

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Thu Mar 02, 2017 9:13 pm

Thank you for your bug report, rmtk. Does the freeze of XnView end once Hugin is finished? I suspect that Hugin creates temporary (image) files while creating the panorama image. These new (image) files might be detected by XnView and it will try to display these new files and create thumbnails. The files might be locked by Hugin which prevents XnView from reading.

Just guessing, here. Could you start the creation of a panorama image and observe the folder with Windows Explorer to see what's happening actually?

rmtk
Posts: 128
Joined: Tue Dec 07, 2010 2:04 am

Re: Linux: 100% CPU consumption when using Hugin

Post by rmtk » Fri Mar 03, 2017 12:41 pm

Yes. Hugin creates large temp files (sometimes larger than 30MB) during panorama creation. And in most cases Xnview can not recover from freezing when panorama creation finished and temp files removed.

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Fri Mar 03, 2017 1:15 pm

rmtk wrote:Yes. Hugin creates large temp files (sometimes larger than 30MB) during panorama creation. And in most cases Xnview can not recover from freezing when panorama creation finished and temp files removed.
O.k., I see. I've seen something similar on Windows when copying files from my digital camera to my computer using a slow USB connection: XnView identifies new files immediately and loads them over and over again to display their thumbnail even though the files are still incomplete and still copied. This does not make sense and even causes problems like yours.

I think XnView MP's behaviour regarding new files should be improved; but I'm not sure whether something can be done about it. Perhaps it would be a good idea if XnView would not read files that have just been saved/modified (e.g. by verifying sytem date with last modified time) but wait till they have an age of some few seconds.

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Fri Mar 03, 2017 9:14 pm

In topic Conflict with photoshop the solution was the exclusion files with extension "tmp". Do the temporary files created by Hugin also have "tmp" extension?

@Pierre: It might be a good idea to exclude "tmp" file extension by default.

rmtk
Posts: 128
Joined: Tue Dec 07, 2010 2:04 am

Re: Linux: 100% CPU consumption when using Hugin

Post by rmtk » Sat Mar 04, 2017 3:30 pm

But for Hugin the temp files are tiff images and obviously I can't exclude .tif in extension list.
I think there can be an option to disable automatic thumbnail generation of folders or only for files smaller than a specific size.

User avatar
xnview
Author of XnView
Posts: 29086
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Linux: 100% CPU consumption when using Hugin

Post by xnview » Mon Mar 06, 2017 2:36 pm

i know only when there is a change in the folder, not if file is written. I update thumbnails after 600ms
Pierre.

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Mon Mar 06, 2017 4:25 pm

xnview wrote:i know only when there is a change in the folder, not if file is written. I update thumbnails after 600ms
Having a delay is a good idea but from what rmtk and I experienced this is not enough because after this delay the updates on that folder and containing files may be still not completed.

Suggestion: Smart update mechanism
Whenever a folder update is identified, XnView should...
a.) ...wait a short delay.
b.) ...read and update thumbnails of all files that have been added or changed and are older than <x> seconds.
c.) ...if there is any file in the folder younger than <x> seconds, start with a.), again.

This mechanism will prevent XnView from reading files that are still copied or written by an external program.

Related topic:
- 0.82b3: Crash while other app handle files

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Tue Mar 14, 2017 3:19 pm

@Pierre: How do you proceed with this? Is a change in the read/update mechanism of XnView possible? Perhaps later?

User avatar
xnview
Author of XnView
Posts: 29086
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Linux: 100% CPU consumption when using Hugin

Post by xnview » Mon Mar 27, 2017 1:36 pm

helmut wrote:@Pierre: How do you proceed with this? Is a change in the read/update mechanism of XnView possible? Perhaps later?
I've checked, and i know only when a file was modified or added.
Pierre.

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Mon Mar 27, 2017 1:51 pm

xnview wrote:I've checked, and i know only when a file was modified or added.
File modification date would be sufficient for the suggested file reading drafted above. Could you please have a look at my "Smart update mechanism" drafted above?

User avatar
xnview
Author of XnView
Posts: 29086
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Linux: 100% CPU consumption when using Hugin

Post by xnview » Mon Mar 27, 2017 3:12 pm

i've tried but modified date (no file date) is not changed during writing
Pierre.

User avatar
helmut
Posts: 8127
Joined: Sun Oct 12, 2003 6:47 pm
Location: Frankfurt, Germany

Re: Linux: 100% CPU consumption when using Hugin

Post by helmut » Mon Mar 27, 2017 3:15 pm

xnview wrote:i've tried but modified date (no file date) is not changed during writing
What about file size? Or check file locking by trying to open the file for reading and writing?

User avatar
xnview
Author of XnView
Posts: 29086
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Linux: 100% CPU consumption when using Hugin

Post by xnview » Mon Mar 27, 2017 11:55 pm

i've tried but no success, i need to watch files modification in folder (currently not supported by QT)
Pierre.

Post Reply