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

filmulator churning away on CPU even when idle #114

Closed
dconrad5 opened this issue Jun 7, 2020 · 39 comments
Closed

filmulator churning away on CPU even when idle #114

dconrad5 opened this issue Jun 7, 2020 · 39 comments

Comments

@dconrad5
Copy link
Contributor

dconrad5 commented Jun 7, 2020

On MacOS, latest dev branch: Something in filmulator seems to be not terribly efficient - here are the CPU % numbers just when sitting there:

Import tab: filmulator ~13%, WindowServer ~15%
Organize tab: filmulator ~25%, WindowServer ~10%
Filmulate tab (with image open, after letting it fully process current settings): filmulator ~13%, windowserver ~20%
Settings tab: filmulator ~13%, windowserver ~15%

My laptop is noticeably hot when filmulator is just sitting there idling in the background, and it absolutely chews through battery. I mention the WindowServer process because that seems to be tracking pretty clearly with filmulator - when I close it, it goes down to ~0.5-1%.

What is filmulator doing when it's just sitting there? It must be churning away on something, or forcing window redraws constantly?

I'm not sure what else I can do to get more info on what it's doing.

@CarVac
Copy link
Owner

CarVac commented Jun 7, 2020

Honestly this is a bit out of my hands. I think it's something to do with the way the QML rendering engine works on MacOS, but I'm not sure.

On Linux I never have this issue, ever, and in my testing on Windows I think the CPU spikes mainly when there's visible animation (such as in the import tab when the source directory box is pulsing).

You may want to try a different version of Qt; Filmulator should work with anything as far back as 5.12.

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 8, 2020

Ok, I'll see if I can download a few versions of Qt and see if any behave differently then.

@heckflosse
Copy link
Contributor

@dconrad5 I also got this idle load on Windows and reported to @CarVac a while ago

@CarVac
Copy link
Owner

CarVac commented Jun 9, 2020

Again, in my experience, on Windows it only happens when animation is occurring, which is almost entirely on the Import tab, not all of them.

I wonder Qt 6 can improve this by switching to Metal?

@heckflosse
Copy link
Contributor

@CarVac

Again, in my experience, on Windows it only happens when animation is occurring, which is almost entirely on the Import tab, not all of them.

Confirmed

@Benitoite
Copy link
Contributor

I wonder if it's related to the heart-beating orange bars?

@CarVac
Copy link
Owner

CarVac commented Jun 10, 2020

I can try replacing them with blinking… but I really liked the heartbeat effect, being very visible but not alarming.

@CarVac
Copy link
Owner

CarVac commented Jun 11, 2020

I replaced the heartbeat effect with an error icon, now that I've figured out how to do icons. Now there's no idle CPU usage in Windows at all; if there is any in MacOS then I'm not sure what more I can do.

Try the current dev, though be aware that it no longer works with 5.12; I made some changes to deal with Qt 5.15's deprecation warnings for syntax that'll change in Qt 6. It works with 5.14 and 5.15 for sure.

@dconrad5
Copy link
Contributor Author

I updated Qt and got the latest dev version, but I'm having trouble getting it to build now. I think I have all right versions of the dependencies. Here's my error messages:

/Users/dana/forked filmulator-gui/filmulator-gui/filmulator-gui/core/imagePipeline.cpp:695:40: error: no matching constructor for
      initialization of 'lfModifier'
                lfModifier * mod = new lfModifier(cropFactor, width, height, LF_PF_F32);
                                       ^          ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/lensfun/lensfun.h:2378:16: note: candidate constructor not viable: no known conversion from 'const float' to
      'const lfLens *' for 1st argument
    DEPRECATED lfModifier (const lfLens *lens, float crop, int width, int height);
               ^
/usr/local/include/lensfun/lensfun.h:2354:18: note: candidate constructor (the implicit copy constructor) not viable: requires 1
      argument, but 4 were provided
struct LF_EXPORT lfModifier
                 ^
/usr/local/include/lensfun/lensfun.h:2492:5: note: candidate constructor not viable: requires at least 6 arguments, but 4 were
      provided
    lfModifier (const lfLens *lens, float imgfocal, float imgcrop, int imgwidth, int imgheight, lfPixelFormat pixel_forma...
    ^
/Users/dana/forked filmulator-gui/filmulator-gui/filmulator-gui/core/imagePipeline.cpp:701:38: error: no matching member function
      for call to 'EnableTCACorrection'
                    modflags |= mod->EnableTCACorrection(lens, demosaicParam.focalLength);
                                ~~~~~^~~~~~~~~~~~~~~~~~~
/usr/local/include/lensfun/lensfun.h:2526:9: note: candidate function not viable: requires single argument 'lctca', but 2
      arguments were provided
    int EnableTCACorrection (const lfLensCalibTCA& lctca);
        ^
/usr/local/include/lensfun/lensfun.h:2537:9: note: candidate function not viable: requires 0 arguments, but 2 were provided
    int EnableTCACorrection ();
        ^
/Users/dana/forked filmulator-gui/filmulator-gui/filmulator-gui/core/imagePipeline.cpp:706:38: error: no matching member function
      for call to 'EnableVignettingCorrection'
                    modflags |= mod->EnableVignettingCorrection(lens, demosaicParam.focalLength, demosaicParam.fnumber, 1000.0f);
                                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/lensfun/lensfun.h:2562:9: note: candidate function not viable: requires 2 arguments, but 4 were provided
    int EnableVignettingCorrection (float aperture, float distance);
        ^
/usr/local/include/lensfun/lensfun.h:2547:9: note: candidate function not viable: requires single argument 'lcv', but 4 arguments
      were provided
    int EnableVignettingCorrection (const lfLensCalibVignetting& lcv);
        ^
/Users/dana/forked filmulator-gui/filmulator-gui/filmulator-gui/core/imagePipeline.cpp:711:38: error: no matching member function
      for call to 'EnableDistortionCorrection'
                    modflags |= mod->EnableDistortionCorrection(lens, demosaicParam.focalLength);
                                ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/lensfun/lensfun.h:2505:9: note: candidate function not viable: requires single argument 'lcd', but 2 arguments
      were provided
    int EnableDistortionCorrection (const lfLensCalibDistortion& lcd);
        ^
/usr/local/include/lensfun/lensfun.h:2516:9: note: candidate function not viable: requires 0 arguments, but 2 were provided
    int EnableDistortionCorrection ();
        ^
127 warnings and 4 errors generated.
make[2]: *** [CMakeFiles/filmulator.dir/core/imagePipeline.cpp.o] Error 1
make[1]: *** [CMakeFiles/filmulator.dir/all] Error 2
make: *** [all] Error 2

Any idea what might be going wrong?

@CarVac
Copy link
Owner

CarVac commented Jun 14, 2020

I made changes and you now need Lensfun 3.95 exactly, not git master.

@dconrad5
Copy link
Contributor Author

I thought I did have 0.3.95, at least that's what it says it is. Maybe 0.3.95 != 0.3.95... I'll try downloading and compiling the release since it doesn't seem to want to find the homebrew installed version either.

@dconrad5
Copy link
Contributor Author

You're right, that's what it was.

Well, the CPU usage is greatly improved! However, I'm getting a crash when I try to load an image. First, here's the numbers with it just idling in the background:

Import tab: filmulator 0%, WindowServer ~1.5%
Organize tab: filmulator 0%, WindowServer ~1.5%
Filmulate tab (no image open, it crashes when I try): filmulator 0%, windowserver ~1.5%
Settings tab: filmulator 0%, windowserver ~1.5%

The CPU % numbers go up a little when I interact with filmulator like you would expect, and then go back down to 0%. Much, much improved, and acting how you would expect it to!

However, that crash... It just crashes instantly when I try to open an image.

Here's the output when I run it from a terminal:

dana@Danas-MacBook-Pro build % ./Filmulator.app/Contents/MacOS/filmulator-gui
qt.qpa.fonts: Populating font family aliases took 194 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
qml: New image: 9eea0d48c6f7269061959365e11a56160001
Error: Failed to read Fujifilm IFD Makernote header.
parammanager exifLensName: 24.0 mm
camToRGB: 1.64424 -0.553865 -0.0903798 
camToRGB: -0.18961 1.64552 -0.455914 
camToRGB: 0.0505302 -0.540929 1.4904 
Error: Failed to read Fujifilm IFD Makernote header.
Has no lens preferences
Error: Failed to read Fujifilm IFD Makernote header.
SEARCHING CAMERA MODELS =================================
Camera: X-T10
Crop factor: 1.529
Match score: 100
filmulator(54116,0x10d296dc0) malloc: *** error for object 0x7f8d91a46800: pointer being freed was not allocated
filmulator(54116,0x10d296dc0) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./Filmulator.app/Contents/MacOS/filmulator-gui
dana@Danas-MacBook-Pro build % 

@CarVac
Copy link
Owner

CarVac commented Jun 14, 2020

Can you upload the offending raw file?

@dconrad5
Copy link
Contributor Author

Sure. It doesn't seem to matter what image it is, maybe it's the camera I've taken it with. Here's a zip file with the image -

DSCF2557_IYqkncQ.dng.zip

It's one I had imported with the older build and I successfully exported it then.

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

Okay, so there's no crash on my end with the file. Can you try running the testbuild branch? I put some output around where I think the crash may be occurring...

@dconrad5
Copy link
Contributor Author

It did give a different error message:

dana@Danas-MacBook-Pro build % ./Filmulator.app/Contents/MacOS/filmulator-gui 
qt.qpa.fonts: Populating font family aliases took 191 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
qml: New image: 9eea0d48c6f7269061959365e11a56160001
Error: Failed to read Fujifilm IFD Makernote header.
parammanager exifLensName: 24.0 mm
camToRGB: 1.64424 -0.553865 -0.0903798 
camToRGB: -0.18961 1.64552 -0.455914 
camToRGB: 0.0505302 -0.540929 1.4904 
Error: Failed to read Fujifilm IFD Makernote header.
Has no lens preferences
Error: Failed to read Fujifilm IFD Makernote header.

** (process:57246): WARNING **: 20:37:34.514: [Lensfun] /Users/dana/Library/Application Support/filmulator/version_2/mil-sigma.xml:147:17: Inappropiate context for <mount>!

SEARCHING CAMERA MODELS =================================
Camera: X-T10
Crop factor: 1.529
Match score: 100
SEARCHING LENS MODELS ===================================
before ldb free
filmulator(57246,0x10e3e0dc0) malloc: *** error for object 0x7fd187a43100: pointer being freed was not allocated
filmulator(57246,0x10e3e0dc0) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./Filmulator.app/Contents/MacOS/filmulator-gui

Probably useful to note this was taken with an adapted lens, so even the camera has no idea what lens it is, apart from the user-defined focal length. And even that's a crapshoot depending on whether I bother to change it at the time.

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 15, 2020

On a hunch I deleted the folder "version_2" from lensfun referenced in the above crash and filmulator seems to have re-grabbed the now correct lensfun data - I no longer get a crash when trying to load an image.

CPU usage is the same as with no image loaded - it goes up to 100% cpu while processing the image, and then drops down to 0% once the image has been processed.

Edit: Interesting behavior. the version_2 directory was not regenerated at startup like I thought. I hit the Update Lens Correction Database button and got Update Successful, then tried to load a new image and got the same crash.

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

I pushed a change to testbuild that should fix the problem, based on other lensfun example code.

@dconrad5
Copy link
Contributor Author

I'll give it a shot. Stay tuned.

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 15, 2020

Looks like that wasn't it - In this output I loaded a file, hit the "Update Lens Correction" to regenerate that directory, and then tried to load a different file and it crashed. Here's the output:

dana@Danas-MacBook-Pro build % ./Filmulator.app/Contents/MacOS/filmulator-gui
qt.qpa.fonts: Populating font family aliases took 215 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
qml: New image: 9eea0d48c6f7269061959365e11a56160001
Error: Failed to read Fujifilm IFD Makernote header.
parammanager exifLensName: 24.0 mm
camToRGB: 1.64424 -0.553865 -0.0903798 
camToRGB: -0.18961 1.64552 -0.455914 
camToRGB: 0.0505302 -0.540929 1.4904 
Error: Failed to read Fujifilm IFD Makernote header.
Has no lens preferences
Error: Failed to read Fujifilm IFD Makernote header.
SEARCHING CAMERA MODELS =================================
No matching cameras found in database.
SEARCHING LENS MODELS ===================================
No matching lenses found in database.
before ldb free
after ldb free
Found lens: 
Lens was in database: \Nikon AI-S Nikkor 24mm f/2.8
Default lens: 
Is sraw: 0
Is weird: 0
Is xtrans: 1
Auto CA is available: 0
Updating availability
Updating availability
Error: Failed to read Fujifilm IFD Makernote header.
qml: top image ready
qml: TopImage state: lt
FilmImageProvider::requestImage Here?
FilmImageProvider::requestImage id: q000001
raw width:  4936
raw height: 3296
WHITE SATURATION ========================================================
data_maximum: 0
maximum: 16383
black-subtracted maximum: 15359
fmaximum: 0
fnorm: 0
Error: Failed to read Fujifilm IFD Makernote header.
max of raw_image: 5725 ===============================================
min of raw_image: 27
imagePipeline.cpp: Opening /Users/dana/Pictures/misc pics/filmulator testing/2020-05-24/DSCF2557_IYqkncQ.dng
load start:1.21594
raw width:  4936
raw height: 3296
demosaic start1.21601
demosaic end: 3.91846
load time: 4.06199
ImagePipeline::processImage: Demosaic complete.
scale start:5.27797
scale end: 0.634809
hlrecovery start:5.9128
lensfun start
rmult: 1
gmult: 0.999991
bmult: 1
rCamMul: 1.97682
gCamMul: 1
bCamMul: 1.73179
ImagePipeline::processImage: Prefilmulation complete.
ImagePipeline::processImage: Filmulation complete.
crop start:6.60471
crop end: 0.003748
qml: top image ready
qml: TopImage state: lq
FilmImageProvider::requestImage Here?
FilmImageProvider::requestImage id: f000002
FilmImageProvider::requestImage filename: /Users/dana/Pictures/misc pics/filmulator testing/2020-05-24/DSCF2557_IYqkncQ.dng
imagePipeline.cpp: Opening /Users/dana/Pictures/misc pics/filmulator testing/2020-05-24/DSCF2557_IYqkncQ.dng
load start:1.6e-05
camToRGB: 
camToRGB: 
camToRGB: 
load time: 0.120308
ImagePipeline::processImage: Demosaic complete.
hlrecovery start:0.120341
lensfun start
rmult: 1
gmult: 0.999991
bmult: 1
rCamMul: 1.97682
gCamMul: 1
bCamMul: 1.73179
ImagePipeline::processImage: Prefilmulation complete.
ImagePipeline::processImage: Filmulation complete.
crop start:7.35834
crop end: 0.110751
qml: top image ready
qml: TopImage state: lf
qml: main.qml queueItem update url
Thumbnail being written to: /Users/dana/Library/Application Support/filmulator/thumbs/9eea/9eea0d48c6f7269061959365e11a56160001
qml: New image: 30b5991b76dd66cc1788f031bf3aed5f0001
Error: Failed to read Fujifilm IFD Makernote header.
filmulator(60168,0x11ecefdc0) malloc: *** error for object 0x2f34206f7263694d: pointer being freed was not allocated
filmulator(60168,0x11ecefdc0) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./Filmulator.app/Contents/MacOS/filmulator-gui
dana@Danas-MacBook-Pro build % 

EDIT: Should probably write down what commit this was at - e981dee on testbuild

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

If I'm reading the debug output correctly, you interrupted the first image loading with a different image, and then it crashed?

Does it finish loading the first image at full resolution?

I've made another push that should give me some more insight into where it's crashing.

@dconrad5
Copy link
Contributor Author

I believe it had fully loaded the first image, but I can try again to check. It does successfully load an image - and I can export jpgs and tiffs - as long as that version_2 directory does not exist. I'll try the new changes.

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 15, 2020

Ok, here's commit dd8460c -

without version_2 directory:

dana@Danas-MacBook-Pro build % ./Filmulator.app/Contents/MacOS/filmulator-gui
qt.qpa.fonts: Populating font family aliases took 205 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
qml: New image: 9eea0d48c6f7269061959365e11a56160001
ParamManager selecting image 9eea0d48c6f7269061959365e11a56160001
Error: Failed to read Fujifilm IFD Makernote header.
parammanager exifLensName: 24.0 mm
camToRGB: 1.64424 -0.553865 -0.0903798 
camToRGB: -0.18961 1.64552 -0.455914 
camToRGB: 0.0505302 -0.540929 1.4904 
Error: Failed to read Fujifilm IFD Makernote header.
Has no lens preferences
Error: Failed to read Fujifilm IFD Makernote header.
SEARCHING CAMERA MODELS =================================
No matching cameras found in database.
SEARCHING LENS MODELS ===================================
No matching lenses found in database.
Found lens: 
Lens was in database: \Nikon AI-S Nikkor 24mm f/2.8
Default lens: 
Is sraw: 0
Is weird: 0
Is xtrans: 1
Auto CA is available: 0
Updating availability
Updating availability
Error: Failed to read Fujifilm IFD Makernote header.
qml: top image ready
qml: TopImage state: lt
FilmImageProvider::requestImage Here?
FilmImageProvider::requestImage id: q000001
raw width:  4936
raw height: 3296
WHITE SATURATION ========================================================
data_maximum: 0
maximum: 16383
black-subtracted maximum: 15359
fmaximum: 0
fnorm: 0
Error: Failed to read Fujifilm IFD Makernote header.
max of raw_image: 5725 ===============================================
min of raw_image: 27
imagePipeline.cpp: Opening /Users/dana/Pictures/misc pics/filmulator testing/2020-05-24/DSCF2557_IYqkncQ.dng
load start:1.2271
raw width:  4936
raw height: 3296
demosaic start1.22717
demosaic end: 3.79336
load time: 3.92634
ImagePipeline::processImage: Demosaic complete.
scale start:5.15348
scale end: 0.620531
hlrecovery start:5.77403
lensfun start
rmult: 1
gmult: 0.999991
bmult: 1
rCamMul: 1.97682
gCamMul: 1
bCamMul: 1.73179
ImagePipeline::processImage: Prefilmulation complete.
ImagePipeline::processImage: Filmulation complete.
crop start:6.42
crop end: 0.010333
qml: top image ready
qml: TopImage state: lq
FilmImageProvider::requestImage Here?
FilmImageProvider::requestImage id: f000002
FilmImageProvider::requestImage filename: /Users/dana/Pictures/misc pics/filmulator testing/2020-05-24/DSCF2557_IYqkncQ.dng
imagePipeline.cpp: Opening /Users/dana/Pictures/misc pics/filmulator testing/2020-05-24/DSCF2557_IYqkncQ.dng
load start:6.8e-05
camToRGB: 
camToRGB: 
camToRGB: 
load time: 0.121543
ImagePipeline::processImage: Demosaic complete.
hlrecovery start:0.121627
lensfun start
rmult: 1
gmult: 0.999991
bmult: 1
rCamMul: 1.97682
gCamMul: 1
bCamMul: 1.73179
ImagePipeline::processImage: Prefilmulation complete.
ImagePipeline::processImage: Filmulation complete.
crop start:7.32004
crop end: 0.107766
qml: top image ready
qml: TopImage state: lf
qml: main.qml queueItem update url
Thumbnail being written to: /Users/dana/Library/Application Support/filmulator/thumbs/9eea/9eea0d48c6f7269061959365e11a56160001
Warning: Exif tag Exif.Image.DNGPrivateData not encoded
Warning: Exif tag Exif.Image.ProfileHueSatMapData1 not encoded
Warning: Exif tag Exif.Image.ProfileHueSatMapData2 not encoded
Warning: Exif tag Exif.Image.ProfileLookTableData not encoded
dana@Danas-MacBook-Pro build % 

After clicking Update lens correction database (version_2 directory exists now):

dana@Danas-MacBook-Pro build % ./Filmulator.app/Contents/MacOS/filmulator-gui
qt.qpa.fonts: Populating font family aliases took 201 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
qml: New image: 9eea0d48c6f7269061959365e11a56160001
ParamManager selecting image 9eea0d48c6f7269061959365e11a56160001
Error: Failed to read Fujifilm IFD Makernote header.

** (process:63156): WARNING **: 22:43:05.547: [Lensfun] /Users/dana/Library/Application Support/filmulator/version_2/mil-sigma.xml:31:40: Error on line 31 char 40: Element “mount” was closed, but the currently open element is “”
filmulator(63156,0x108178dc0) malloc: *** error for object 0x7ff2c8e8ea00: pointer being freed was not allocated
filmulator(63156,0x108178dc0) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./Filmulator.app/Contents/MacOS/filmulator-gui
dana@Danas-MacBook-Pro build % 

Actually, I wonder if the lensfun data it's grabbing is bad somehow... Let me peek at that xml file it's referencing. Maybe it's trying to grab the previous install's data rather than 0.3.95.

Edit: I'll attach a zip file with the file in question, but there doesn't seem to be anything obviously wrong with it.
mil-sigma.xml.zip

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

Your XML file is the same as mine. I don't get why the problem is occurring...

But I just made another commit to testbuild, commit dd8460c. Turns out that where the lensfun library is crashing, I didn't need to use it at all. Maybe this will help, maybe it won't.

@dconrad5
Copy link
Contributor Author

Did you mean commit 7875c67?

Not out of the woods yet it seems. Here's the output:

dana@Danas-MacBook-Pro build % ./Filmulator.app/Contents/MacOS/filmulator-gui
qt.qpa.fonts: Populating font family aliases took 208 ms. Replace uses of missing font family "Sans Serif" with one that exists to avoid this cost. 
qml: New image: 9eea0d48c6f7269061959365e11a56160001
exifLens called
Error: Failed to read Fujifilm IFD Makernote header.
parammanager exifLensName: 24.0 mm
camToRGB: 1.64424 -0.553865 -0.0903798 
camToRGB: -0.18961 1.64552 -0.455914 
camToRGB: 0.0505302 -0.540929 1.4904 
Error: Failed to read Fujifilm IFD Makernote header.
Has no lens preferences
Error: Failed to read Fujifilm IFD Makernote header.
SEARCHING CAMERA MODELS =================================
Camera: X-T10
Crop factor: 1.529
Match score: 100
SEARCHING LENS MODELS ===================================
filmulator(66059,0x10eb7fdc0) malloc: *** error for object 0x7f9559879500: pointer being freed was not allocated
filmulator(66059,0x10eb7fdc0) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      ./Filmulator.app/Contents/MacOS/filmulator-gui
dana@Danas-MacBook-Pro build % 

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

I wonder if MacOS is being stricter about things than Linux. I'll try valgrind tonight.

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

What compiler are you using?

Could you try to capture a stack trace?

@dconrad5
Copy link
Contributor Author

I believe it's clang++.

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

Can you try to capture a stack trace? It might be an upstream problem in lensfun.

Tonight I'll see if I can allocate lensfun on the stack to prevent these problems.

@dconrad5
Copy link
Contributor Author

I'm not actually familiar with what a stack trace looks like, but I think it's contained in the crash debug output here:

Filmulator Stack Trace.txt

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

I may have to make some sort of flag that lets you use the git master Lensfun for Mac and 0.3.95 for Windows and Linux; the git version worked for you, right?

@dconrad5
Copy link
Contributor Author

Yeah, the git master version of lensfun worked on the previous build before you required the 0.3.95 release. That version reported itself as 0.3.95 but apparently had some fundamental difference that made it incompatible.

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

Yeah, the function signatures changed.

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 15, 2020

I just went and looked at the lensfun commit history, that is a lot of changes since the last release. Almost 2 years! And what must be hundreds of commits. Edit: 14 pages!

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 15, 2020

I'll test it tonight after work to see exactly what the behavior is, but one interesting thing is that if I do not do the "Update lens correction database" and make sure the version_2 directory doesn't exist, the lens correction list is actually still populated. Not sure if that is a clue for you or not.

Edit: it appears I was wrong about this, please disregard

@CarVac
Copy link
Owner

CarVac commented Jun 15, 2020

I just pushed a change that should make it use the latest git version's API for MacOS only. If it fails to compile with 0.3.95, then what I did worked, and you should try building Lensfun from git again.

@dconrad5
Copy link
Contributor Author

Commit 3d81eb8 - Success! I can successfully import an image, add it to the queue, open it, and save a jpeg and tiff now. And it is indeed using the master branch of lensfun - I made sure the build failed with 0.3.95 installed.

@CarVac
Copy link
Owner

CarVac commented Jun 16, 2020

And back to the issue at hand, how is the idle CPU usage? Can we close the issue?

@dconrad5
Copy link
Contributor Author

dconrad5 commented Jun 16, 2020

Right. Here's the numbers with the latest and greatest working build - all just idling in the background:

Import tab: filmulator 0%, WindowServer ~1.5%
Organize tab: filmulator 0%, WindowServer ~1.5%
Filmulate tab (with image open, after letting it fully process current settings): filmulator 0%, windowserver ~1.5%
Settings tab: filmulator 0%, windowserver ~1.5%

I think I would call that problem solved.

Edit: laptop runs nice and cool now, too 👍

@CarVac CarVac closed this as completed Jun 16, 2020
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

4 participants