Bug 500506 - GPhoto on MacOS: Camera open error (-4): Error loading a library
Summary: GPhoto on MacOS: Camera open error (-4): Error loading a library
Status: RESOLVED FIXED
Alias: None
Product: kstars
Classification: Applications
Component: general (other bugs)
Version First Reported In: 3.7.5
Platform: macOS (DMG) macOS
: NOR major
Target Milestone: ---
Assignee: Rob
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-21 05:53 UTC by Bastian
Modified: 2025-08-18 20:43 UTC (History)
1 user (show)

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


Attachments
KStars/Ekos verbose log for INDI and CCD (35.10 KB, text/plain)
2025-02-21 05:53 UTC, Bastian
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bastian 2025-02-21 05:53:30 UTC
Created attachment 178677 [details]
KStars/Ekos verbose log for INDI and CCD

SUMMARY


STEPS TO REPRODUCE
1. Ensure that ptpcamerad isn't running and mounting cameras.
2. Connect Olympus E-M5 II to computer running KStars. 
3. Configure local INDI server with GPhoto CCD driver.
4. Try to start INDI server and connect.

OBSERVED RESULT
Camera doesn't connect, INDI log shows
```
2025-02-21T05:31:10: [ERROR] Can not open camera: Power OK? If camera is auto-mounted as external disk storage, please unmount it and disable auto-mount. 
2025-02-21T05:31:10: [ERROR] Camera open error (-4): Error loading a library 
```

EXPECTED RESULT
Camera connects fine.

SOFTWARE/OS VERSIONS
macOS: Sonoma 14.7.1

ADDITIONAL INFORMATION
I've enabled verbose logging for Ekos -> INDI and Drivers -> CCD, and attached the log file here.

In my old KStars version (3.6.8), I could connect my Olympus E-M5 II just fine (using a script which periodically kills ptpcamerad every 0.1 seconds to prevent it from mounting the camera, and which I also ran for the new versin). 

The old Kstars used libindi 2.0.5, while the new one uses 2.1.2. 

I also saw the same issue with the IndiStarter app: an old version that came with libindi 2.0.2 worked fine, but the new one which bundles 2.1.2 does not, showing the same error. So I think it's a libindi issue with was introduced somewhere between 2.0.5 and 2.1.2.
Comment 1 Bastian 2025-02-21 06:02:53 UTC
I've just tried IndiStarter release 2.4.1 which comes with libindi 2.0.7, which also shows the " Camera open error (-4): Error loading a library" problem. So that might indicate that the issue was introduced between libindi 2.0.5 and 2.0.7.
Comment 2 Bastian 2025-02-21 06:14:21 UTC
Sorry my previous comment was wrong, I didn't realise that I had a running indiserver 2.1.2 instance; 2.0.7 actually works.
Comment 3 Donghyun Gouk 2025-06-25 04:47:09 UTC
I had same issue on macOS Sonoma and Sequoia, Kstars 3.7.1 ~ 3.7.7, with Nikon D7200 DSLR.
Gphoto CCD and Nikon DSLR driver show error with -4, Error loading library.

To check this problem comes from INDI, I manually build INDI Core Library v2.14 and INDI 3rd-party Drivers v2.14 from source, and they worked as expected -- I can control DSLR, got live video from Ekos, as I did in Kstars 3.6.x.

Maybe build pipeline used by Kstars has issue on building INDI server/libraries?
Comment 4 Rob 2025-06-28 15:42:48 UTC
I think this issue may be something with the automated cI build.  If I build it on my own machine it works fine.  But the DMG from the ci build is somehow missing the folder with the camlibs and iolibs that should be installed into KStars.app/Resources/DriverSupport/gphoto/
Comment 5 Donghyun Gouk 2025-08-18 04:25:06 UTC
I checked with recently released Kstars 3.7.8, and the issue is resolved (macOS Sequoia).
I can successfully control D7200 with internal INDI server/library without any issues.
Comment 6 Rob 2025-08-18 20:43:29 UTC
Hi again,

Sorry this took so long.  Actually I fixed the issue in early July, but we could not get the ci build system to build KStars successfully until just a few days ago so that we could release it with the fix included.  I'm glad its working for you again!