×

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

You can actually enable that code in connect again and just comment out the m_StillApp->Parse() whicn is what causes the crash.
The following user(s) said Thank You: Simon
1 year 4 months ago #88663

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

The bad new is that it still crashes in workerExposure when touching the m_StillApp object. a) it was never opened and b) if you try to open it, it says it' can't be opened... if you don't open if, you crash in ConfigureStill
1 year 4 months ago #88664

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

Adding this in InitProperties() will make setting the frame work. Still no exposures, though

// imx 290
PrimaryCCD.setResolution(1920,1080);
PrimaryCCD.setPixelSize(2.55, 2.55);
1 year 4 months ago #88666

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

While working to excise libcamera-apps I took a detour through the libcamera docs. It looks like the Camera class has a properties() method that returns a ControlList instance. All of the available properties are documented in libcamera/include/libcamera/properties.h .
1 year 4 months ago #88681

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

To get this thing off the ground as fast as possible, I would suggest 2 controls in the INDI ui: STILL_OPTIONS and VIDEO_OPTIONS.

Then let the FooOptions->Parse() them. Since doing a full fledged UI is error prone and tiresome and for the moment not needed.
1 year 4 months ago #88684

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

OK, I managed to get somewhere. Make the manager a static and don't destroy it.

github.com/indilib/indi-3rdparty/compare...i-3rdparty:libcamera

Then connect and expose and you get this. I'm not sure of the whole approach of having two apps will work, as it's assuming you need two camera objects? I guess it would make more sense to somehow get at the preview buffer for the still app.
2022-12-01T07:10:44: Driver indi_libcamera_ccd: [17:15:09.937989200] [30612]  INFO RPI raspberrypi.cpp:1414 Registered camera /base/soc/i2c0mux/i2c@1/imx290@1a to Unicam device /dev/media4 and ISP device /dev/media0
2022-12-01T07:11:11: Client 9: new arrival from 192.168.0.113:57503 - welcome!
2022-12-01T07:11:16: Client 10: new arrival from 192.168.0.113:57540 - welcome!
2022-12-01T07:11:27: Driver indi_libcamera_ccd: Running without preview window
2022-12-01T07:11:27: Driver indi_libcamera_ccd: Opening camera...
2022-12-01T07:11:27: Driver indi_libcamera_ccd: [17:15:52.782629828] [30611] FATAL IPAManager ipa_manager.cpp:109 Multiple IPAManager objects are not allowed
2022-12-01T07:11:27: Driver indi_libcamera_ccd: Backtrace:
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: INDILibCamera::workerExposure(std::atomic<bool> const&, float)+0xe4 (/home/pi/astro/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:190)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: void std::__invoke_impl<void, void (INDILibCamera::*&)(std::atomic<bool> const&, float), INDILibCamera*&, std::atomic<bool> const&, float&>(std::__invoke_memfun_deref, void (INDILibCamera::*&)(std::atomic<bool> const&, float), INDILibCamera*&, std::atomic<bool> const&, float&)+0xd0 (/usr/include/c++/10/bits/invoke.h:73)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: std::__invoke_result<void (INDILibCamera::*&)(std::atomic<bool> const&, float), INDILibCamera*&, std::atomic<bool> const&, float&>::type std::__invoke<void (INDILibCamera::*&)(std::atomic<bool> const&, float), INDILibCamera*&, std::atomic<bool> const&, float&>(void (INDILibCamera::*&)(std::atomic<bool> const&, float), INDILibCamera*&, std::atomic<bool> const&, float&)+0x80 (/usr/include/c++/10/bits/invoke.h:96)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: void std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>::__call<void, std::atomic<bool> const&, 0u, 1u, 2u>(std::tuple<std::atomic<bool> const&>&&, std::_Index_tuple<0u, 1u, 2u>)+0xc0 (/usr/include/c++/10/functional:418)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: void std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>::operator()<std::atomic<bool> const&, void>(std::atomic<bool> const&)+0x60 (/usr/include/c++/10/functional:501)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: void std::__invoke_impl<void, std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>&, std::atomic<bool> const&>(std::__invoke_other, std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>&, std::atomic<bool> const&)+0x58 (/usr/include/c++/10/bits/invoke.h:60)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: std::enable_if<is_invocable_r_v<void, std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>&, std::atomic<bool> const&>, void>::type std::__invoke_r<void, std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>&, std::atomic<bool> const&>(std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)>&, std::atomic<bool> const&)+0x58 (/usr/include/c++/10/bits/invoke.h:116)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: std::_Function_handler<void (std::atomic<bool> const&), std::_Bind<void (INDILibCamera::*(INDILibCamera*, std::_Placeholder<1>, float))(std::atomic<bool> const&, float)> >::_M_invoke(std::_Any_data const&, std::atomic<bool> const&)+0x54 (/usr/include/c++/10/bits/std_function.h:292)
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: 
2022-12-01T07:11:27: Driver indi_libcamera_ccd: read EOF
1 year 4 months ago #88685

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

> OK, I managed to get somewhere. Make the manager a static and don't destroy it.
> Then connect and expose and you get this. I'm not sure of the whole approach of having two apps will work, as it's assuming you need two camera objects? I guess it would make more sense to somehow get at the preview buffer for the still app.

Each of those App classes instantiates its own camera and camera manager objects, this is why it keeps crashing. libcamera won't allow either of those classes to have multiple instantiations which is why removing the libcamera-apps dependency is a good idea, possibly necessary.

In other news I put together a little program to extract the parameters available from any attached cameras, here's the output for my HQ camera:
<code>$ LIBCAMERA_LOG_LEVELS=ERROR ./cam_list
Found 1 cameras.1: 'imx477' (/base/soc/i2c0mux/i2c@1/imx477@1a)
ScalerCropMaximum: (0, 0)/0x0
ColorFilterArrangement: 0
PixelArrayActiveAreas: [ (8, 16)/4056x3040 ]
PixelArraySize: 4056x3040
Rotation: 180
Location: 2
UnitCellSize: 1550x1550
Model: imx477
</code>

The code: gist.github.com/tpickett66/7c206bb4f3bdf08f0d3c2df39e1ac817
The following user(s) said Thank You: Simon
Last edit: 1 year 4 months ago by Tyler Pickett. Reason: fixed whitespace
1 year 4 months ago #88687

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

Removing libcamera-apps dependency is a good idea for the long term. I started with it since it was the easiest to do given what it offers, but it complicates the driver in the end.
The following user(s) said Thank You: Tyler Pickett
1 year 4 months ago #88689

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

Terry, thats great! What about pixel size and binning information? For imx477 value should be 1.55 if I'm correct?
We should get as much information as we can and set it to EKOS.
1 year 4 months ago #88695

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

That data is there as well, in nanometers:

UnitCellSize: 1550x1550

Convertsto 1.55 um! this is really great, good job Tyler. I was looking for that as well, but i only found other sensor information in other objects.
1 year 4 months ago #88696

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

ANYO that great! Im just wandering if we should put code from Connect() method to Setup() method. It feels like better place for it.
I would also try to put cameraManager->stop(); inside Disconnect() method.

Jasem, what do you think about that?
Last edit: 1 year 4 months ago by Simon.
1 year 4 months ago #88698

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

Actually, I'd just copy the LibCameraApp class over instead and change it to have a public GetManager() and merge the Still and Video. It looks like a lot of work to replicate the whole thing into the indi driver and given not a lot of people interested in this seem to be fluent with c++, it would get results much faster.

In fact, if it was me, I'd have preferred to just have it call out to a new process of libcamera-still/video and plug the result into the indi workflow. It would also be way more helpful for other cam types. You could use the same modus operandi for python based cams, raspicams, webcams and the like.

I found this project:

github.com/MMTObservatory/pyINDI

which seems to work with indi, but doesn't have a working CCD driver. You'd need to know what properties actually make a CCD and how it should behave. The core indi CCD does already know this.
1 year 4 months ago #88699

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

Time to create page: 1.411 seconds