Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 51 minutes ago

I added your code to my fork, but it gives me the "full frame", ie 1937xsomething and not 1920x1080 as it should?

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

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 58 minutes ago

There's already code in libcamera-app to create dng, though, which are to my knowledge some "standard" raw format.

Check out dng_save in libcamera-apps/image/dng.cpp.

I played around some more and in theory I guess using one app should work.

There seem to be mixups between what libcamera threads and indi threads are doing. Also, startPreview seems to get called even when you give it nopreview in the options.

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 15 hours ago

Basically, at this point I wouldn't worry about EKOS. The primary target is to get several exposures and aborts working which can be done via the shell. When you're debugging, you can already see you're getting the correct exposure values.

All other things, like gain or whatever should be done by putting in a command line string in INDI via some generic LIBCAMERA_OPTIONS and parse that. Then you can quily test if things work.

After that, there should be UI for the individual options, but frankly, that's pretty tiresome work. Bla create prop, Bla create propP, bla parse INewFoo. Boooring.

The only interesting part is getting the whole thing to run - and hopefully more reliable than v4l2 and raspi...

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 15 hours 10 minutes ago

Other neat tricks:

# connect a driver
pi@astrocam:~/astro/cam/libcamera-apps/build $ indi_setprop LibCamera.CONNECTION.CONNECT=On
# disconnect a connected driver
pi@astrocam:~/astro/cam/libcamera-apps/build $ indi_setprop LibCamera.CONNECTION.DISCONNECT=On

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 15 hours 16 minutes ago

pi@astrocam:~/astro/cam/libcamera-apps/build $ indi_getprop |grep EXP
LibCamera.CCD_EXPOSURE.CCD_EXPOSURE_VALUE=1
LibCamera.CCD_ABORT_EXPOSURE.ABORT=Off
LibCamera.STREAMING_EXPOSURE.STREAMING_EXPOSURE_VALUE=0.10000000000000000555
LibCamera.STREAMING_EXPOSURE.STREAMING_DIVISOR_VALUE=1
LibCamera.STREAMING_EXPOSURE.STREAMING_EXPOSURE_VALUE=0.10000000000000000555
LibCamera.STREAMING_EXPOSURE.STREAMING_DIVISOR_VALUE=1
pi@astrocam:~/astro/cam/libcamera-apps/build $ indi_setprop LibCamera.CCD_EXPOSURE.CCD_EXPOSURE_VALUE=1

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 17 hours 5 minutes ago

Actually... the LibCameraRaw is a LibCameraEncoder, so one could not use the LibCameraStill in favor of that and get the Video options too? Then there would only be one instance of the app running.

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 17 hours 41 minutes ago

Is there a std:argv(&argc, char *) or something to parse an argument line like the shell would and give you back the argc and argv?

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. 18 hours 24 minutes ago

Something like this:

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

Cloning, patching and accessing the cameraManager via only the LibcameraApp allows you to actually take a pic. It still doesn't work as I get:

2022-12-01T16:13:22: [ERROR] Error saving image: unsupported Bayer format

but other than that, things should more or less work.

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. yesterday

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.

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. yesterday

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


Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. yesterday

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.

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. yesterday

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);

Read More...

Anjo replied to the topic 'INDI LibCamera Driver' in the forum. yesterday

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

Read More...