×

INDI Library v2.0.7 is Released (01 Apr 2024)

Bi-monthly release with minor bug fixes and improvements

INDI LibCamera Driver

  • Posts: 74
  • Thank you received: 11

Replied by Anjo on topic INDI LibCamera Driver

After commenting out the cameraManager->reset(), mine fails with the option parsing in StillOptions Option::Parse(). Where does this live anyway? The Option class just has this as virtual?

//if (Options::Parse(argc, argv) == false)
// return false;

Commenting this goes a bit further, but unsurprisingly croaks with:

ERROR 21.847219 sec : Error opening camera: bad thumbnail parameters

A workflow that halfway works for me is having two windows, in the one I recompile and start indi:

pi@astrocam:~/astro/indi-3rdparty/build/indi-libcamera $ make && indiserver -v `pwd`/indi_libcamera_ccd

and in the other I do:

pi@astrocam:~/.indi/logs/2022-11-26/indi_libcamera_ccd $ rm *.log && indi_setprop LibCamera.LOG_OUTPUT.FILE_DEBUG=On && indi_setprop LibCamera.CONNECTION.CONNECT=On && cat *.log

which deletes the previous log, sets logging to file to on and connects.

Faking the still options gives:

2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: Options:
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: verbose: 182
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: info_text:?
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: timeout: 39462159524836000
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: width: 8993704
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: height: 1
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: output:
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: post_process_file: qt.qpa.xcb: could not connect to display
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd:
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, xcb.
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd:
2022-11-26T23:11:00: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: read EOF
Last edit: 1 year 4 months ago by Anjo.
1 year 4 months ago #88557

Please Log in or Create an account to join the conversation.

  • Posts: 74
  • Thank you received: 11

Replied by Anjo on topic INDI LibCamera Driver

Are there any instructions on installing QTCreator on the pi? I only found pretty involved stuff that requires recompiles and cross compiles?
1 year 4 months ago #88566

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

sudo apt-get -y install qtcreator
1 year 4 months ago #88568

Please Log in or Create an account to join the conversation.

  • Posts: 124
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

Just for your info it is very sluggish and freezing on 4b 1gb, while it works well on 8gb version.
1 year 4 months ago #88569

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 34

Replied by Simon on topic INDI LibCamera Driver

I run QT Creator on Raspberry Pi 4B 4GB and it works fine.

Finally I have managed to make some progress. Method detectCameras() no longer crashes. And driver starts in EKOS (see attached image).

More here: github.com/sajmons/indi-3rdparty/commit/...7f51c85f3f06789f2c4e.

OUTTA, Jasem, what would be next step? Probably fill in more information about camera capabilities, so that more buttons in EKOS gets enabled?
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 1 year 4 months ago by Simon.
1 year 4 months ago #88636
Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 2

Replied by Tyler Pickett on topic INDI LibCamera Driver

I wonder if we'd be better off creating a static CameraManager instead of this create/destroy dance. We'd probably have to pull more bits of the libcamera-apps code in rather than linking to it, but that might not be such a bad thing sone those seem to be demos that might be unstable and/or depend on Raspberry Pi specific components. I'll start looking into what that would look like.
The following user(s) said Thank You: Jasem Mutlaq
1 year 4 months ago #88643

Please Log in or Create an account to join the conversation.

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

Awesome progress Simon! Yes next step would be to make Image Info field editable unless we can query such information from libcamera itself. An alternative is like the V42L driver, we create a maintain a table of known cameras with their resolution and pixel information saved.
1 year 4 months ago #88647

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 34

Replied by Simon on topic INDI LibCamera Driver

Yeah, I totally agree with you Tyler. As it seams, cameraManager needs to be called everytime you want to access to camera object.

It would be a lot easier to find camera and create pointer to camera once. Probably in connect() method?

Then keep cameraManager opened until disconnect() is called. Inside disconect() we release camera and stop camera manager.

What do you think Tyler?

I'm still learning, C++ is not my expertise.
1 year 4 months ago #88650

Please Log in or Create an account to join the conversation.

  • Posts: 74
  • Thank you received: 11

Replied by Anjo on topic INDI LibCamera Driver

Even with this fix, it still crashes for me when Connecting calling
auto stillOptions = static_cast<StillOptions *>(m_StillApp->GetOptions());

Also, I get a ton of compile warnings:
/home/pi/astro/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:527:19: warning: ISO C++ says that these are ambiguous, even though the worst conversion for the first is better than the worst conversion for the second:
In file included from /usr/include/libindi/indipropertyswitch.h:21,
                 from /home/pi/astro/indi-3rdparty/indi-libcamera/indi_libcamera.h:23,
                 from /home/pi/astro/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:21:
/usr/include/libindi/indipropertybasic.h:116:24: note: candidate 1: ‘INDI::WidgetView<T>& INDI::PropertyBasic<T>::operator[](size_t) const [with T = _ISwitch; size_t = unsigned int]116 |         WidgetView<T> &operator[](size_t index) const;
      |                        ^~~~~~~~
/home/pi/astro/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:527:19: note: candidate 2: ‘operator[](INDI::PropertyView<_IBLOB>*, int)(built-in)
  527 |         CameraSP[0].setState(ISS_ON);
      |                   ^
1 year 4 months ago #88654

Please Log in or Create an account to join the conversation.

  • Posts: 124
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

Hello, Let me put my two cents as well here :)
First, I have solved stability issues with 1GB rpi, i added ssd and created SWAP partition on it.

Simon, you are now way ahead of me! I am still having trouble running anything, but due to your fix on startup, I have detected that my version of Kstars is faulty. Kstars was installed directly from raspberryPi repo, and it is missing some icons, that should give me some idea.

When I connect from remote Kstars located on Astroberry I can now connect to Libcamera driver, not able to take capture or stream but I do connect.

In regards with Tylers comment, I completely agree that we should extract stuff from libcamera-apps, if possible completely remove dependency to libcamera-apps (not libcamera it self, I believe that is not possible), but maybe we should focus on that after we enable basic stuff to work.

Jason, I would prefer not to keep table as that is harder to maintain, but it might be necessary, unless we can get all the stuff we need from libcamera. We can get a some details from libcamera: supported resolutions, supported binnings, supported max FPS, is frame packed or unpacked, and raw coding of frame. am not sure if we can get pixel size, and that could be a problem.

Anjo I had similar problems when compiling. I only solved it by manually changing file mentioned on end of this thread:
www.indilib.org/forum/development/12628-...ambiguous.html#88125
1 year 4 months ago #88655

Please Log in or Create an account to join the conversation.

  • Posts: 4
  • Thank you received: 2

Replied by Tyler Pickett on topic INDI LibCamera Driver


That's exactly what I was thinking, maybe with a wrapper to isolate the libcamera bits in a single place to keep it easy to make adjustments as they make API changes.
1 year 4 months ago #88656

Please Log in or Create an account to join the conversation.

  • Posts: 112
  • Thank you received: 34

Replied by Simon on topic INDI LibCamera Driver

If you experiance ERROR DeviceEnumerator device_enumerator.cpp:165 Removing media device /dev/media1 while still in use
It help if you just kill indiserver with this command:
sudo killall -9 indiserver

Yeeeeeej, rebooting isn't necessary any more! This is such a time saver!
1 year 4 months ago #88660

Please Log in or Create an account to join the conversation.

Time to create page: 1.105 seconds