×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

INDI LibCamera Driver

I started work in INDI LibCamera driver. This is meant to run on Raspberry PI using Debian 11 (Bullseye).

As of 2022.08.21, the driver is just a skeleton and cannot be used for anything. Once capture works, we'll ask for feedback in this thread.
1 year 7 months ago #85528

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

Thanks a lot! It's just what I needed. I had to install a few libs:

<code>sudo apt-get install libindi-dev libcamera-dev libcamera-apps libboost-program-options-dev</code>

Unfortunately, I get build errors complaining about "addFitsKeyWords" being unknown and I had to copy the /usr/include/libcamera/libcamera/* files to the parent dir and I actually had to compile indi from source and install to get the indilib includes correct. Otherwise it would complain about /usr/include/libindi/indipropertyswitch.h missing.

Fixing those and starting the driver works, but I can't see images and the size is 0,0, likewise the pixel size.

Any help here would be appreciated!
1 year 7 months ago #85530

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

Hm. Reading the source of indi-libcamera doesn't show anything except a bit of options parsing? It doesn't seem to do anything?
1 year 7 months ago #85531

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

And... actually reading the top post gives a clue that it doesn't do anything... OK, I was mislead by the post from Aaron and thought he talked about the driver, while he probably meant the all-sky thing. So never mind.
1 year 7 months ago #85532

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

Do you have an ETA for the driver? I can see the skeleton seems to be working, so "only" hooking up the actual capture seems to be missing? Anything one can help with?
Last edit: 1 year 6 months ago by Anjo.
1 year 6 months ago #86254

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

Could you mark the missing parts with a some // TODO annotations and/or maybe a high-level TODO.txt which just outlines on what's missing and how to progess?

Something like:

- add capturing in x.cpp
- add skeleton xml for options
...
Last edit: 1 year 6 months ago by Anjo. Reason: typos
1 year 6 months ago #86255

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

  • Posts: 123
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

Ok, I am having loads of trouble :)
Running RaspberryPi os Bullseye, IMX477 (HiQ camera)
I have built indi from git and indi-libcamera. And Libcamera works by it self.
Issue is I have no Idea how to debug driver :dry:
And when I try to run a server I get this.
INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3730-67300b62
2022-11-05T21:05:18: Driver indi_libcamera_ccd: [0:12:18.949311605] [3997]  WARN RPI raspberrypi.cpp:1274 Mismatch between Unicam and CamHelper for embedded data usage!
2022-11-05T21:05:18: Driver indi_libcamera_ccd: [0:12:18.950064319] [3997] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
2022-11-05T21:05:18: Driver indi_libcamera_ccd: [0:12:18.950405296] [3997]  INFO RPI raspberrypi.cpp:1398 Registered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media4 and ISP device /dev/media3
2022-11-05T21:05:18: Driver indi_libcamera_ccd: [0:12:18.950721385] [3997] ERROR DeviceEnumerator device_enumerator.cpp:166 Removing media device /dev/media3 while still in use
2022-11-05T21:05:18: Driver indi_libcamera_ccd: [0:12:18.950807458] [3997] ERROR DeviceEnumerator device_enumerator.cpp:166 Removing media device /dev/media4 while still in use
2022-11-05T21:05:18: Driver indi_libcamera_ccd: stderr EOF
2022-11-05T21:05:18: Driver indi_libcamera_ccd: Terminated after #10 restarts.
2022-11-05T21:05:18: good bye
1 year 4 months ago #87845

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

Try to run this is a debugger. This is still in very early stages. See where it crashes exactly. I found libcamera to be unreliable now :(
1 year 4 months ago #87851

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

  • Posts: 123
  • Thank you received: 13

Replied by Outta on topic INDI LibCamera Driver

I think I set something up incorrectly, see this

<code>astroberry@raspberrypi:~/Projects/build/ekosdebugger $ which indi_libcamera_ccd
/usr/bin/indi_libcamera_ccd
astroberry@raspberrypi:~/Projects/build/ekosdebugger $ which indiserver /usr/bin/indiserver
astroberry@raspberrypi:~/Projects/build/ekosdebugger $

When I use EKOSDEBUGGER
<code>2022-11-06T08:05:54: startup: /usr/bin/indiserver -r 0 -v indi_libcamera_ccd indi_simulator_ccd indi_simulator_focus indi_simulator_telescope
[Attaching after Thread 0xb6ff7540 (LWP 31394) fork to child process 31400]
[Detaching after fork from parent process 31394]
2022-11-06T08:05:54: Driver indi_libcamera_ccd: pid=31400 rfd=6 wfd=6 efd=7
2022-11-06T08:05:54: Driver indi_simulator_ccd: pid=31401 rfd=8 wfd=8 efd=9
2022-11-06T08:05:54: Driver indi_simulator_focus: pid=31402 rfd=10 wfd=10 efd=11
2022-11-06T08:05:54: Driver indi_simulator_telescope: pid=31403 rfd=12 wfd=12 efd=13
2022-11-06T08:05:54: listening to port 7624 on fd 5
2022-11-06T08:05:54: Local server: listening on local domain at: @/tmp/indiserver
2022-11-06T08:05:54: Driver indi_libcamera_ccd: 2022-11-06T08:05:54: Driver indi_libcamera_ccd: execlp : No such file or directory
2022-11-06T08:05:54: Driver indi_libcamera_ccd: stderr EOF
2022-11-06T08:05:54: Driver indi_libcamera_ccd: read: Connection reset by peer
2022-11-06T08:05:54: Driver indi_libcamera_ccd: Terminated after #0 restarts.
No stack.</code>

and when i run indiserver indi_libcamera_ccd from terminal I get error from post above


In my Kstars there is no Libcamera so I added it manually to code as I cannot add it to profile... any ideas?

Also can you share your
libcamera-hello --version
To eliminate discrepancy there
Last edit: 1 year 4 months ago by Outta.
1 year 4 months ago #87860

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 reason you can't see it is probably because the accompanying xml still refers to the indi_asi driver instead of indi_libcamera_ccd:

github.com/indilib/indi-3rdparty/blob/ma...bcamera.xml.cmake#L5

This here when running from the build directory doesn't give the "not found", but still doesn't work:
indiserver -v `pwd`/indi_libcamera_ccd indi_simulator_telescope
->
pi@astrocam:~/astro/indi-3rdparty/build/indi-libcamera $ indiserver -v `pwd`/indi_libcamera_ccd indi_simulator_telescope
2022-11-06T10:40:56: startup: indiserver -v /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd indi_simulator_telescope
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: pid=16779 rfd=6 wfd=6 efd=7
2022-11-06T10:40:56: Driver indi_simulator_telescope: pid=16780 rfd=8 wfd=8 efd=9
2022-11-06T10:40:56: listening to port 7624 on fd 5
2022-11-06T10:40:56: Local server: listening on local domain at: @/tmp/indiserver
2022-11-06T10:40:56: Driver indi_simulator_telescope: HaAxis: TrackRate 1, trackingRateDegSec 15.041067 arcsec
2022-11-06T10:40:56: Driver indi_simulator_telescope: snooping on GPS Simulator.GEOGRAPHIC_COORD
2022-11-06T10:40:56: Driver indi_simulator_telescope: snooping on GPS Simulator.TIME_UTC
2022-11-06T10:40:56: Driver indi_simulator_telescope: snooping on Dome Simulator.DOME_PARK
2022-11-06T10:40:56: Driver indi_simulator_telescope: snooping on Dome Simulator.DOME_SHUTTER
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_EOD_COORD
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_COORD
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_INFO
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Telescope Simulator.GEOGRAPHIC_COORD
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_PIER_SIDE
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Rotator Simulator.ABS_ROTATOR_ANGLE
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Focuser Simulator.ABS_FOCUS_POSITION
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on Focuser Simulator.FOCUS_TEMPERATURE
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on CCD Simulator.FILTER_SLOT
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on CCD Simulator.FILTER_NAME
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: snooping on SQM.SKY_QUALITY
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: [2:30:23.766169775] [16779]  INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3700-f30ad033
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: [2:30:23.794506306] [16782]  INFO RPI raspberrypi.cpp:1368 Registered camera /base/soc/i2c0mux/i2c@1/imx290@1a to Unicam device /dev/media4 and ISP device /dev/media1
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: [2:30:23.794801191] [16782] ERROR DeviceEnumerator device_enumerator.cpp:166 Removing media device /dev/media1 while still in use
2022-11-06T10:40:56: Driver /home/pi/astro/indi-3rdparty/build/indi-libcamera/indi_libcamera_ccd: [2:30:23.794835005] [16782] ERROR DeviceEnumerator device_enumerator.cpp:166 Removing media device /dev/media4 while still in use

.... restarts until it gives up

However, with this little trick, I managed to at least get streaming with my imx290 to work:
pi@astrocam:~ $ cat /usr/bin/indi_wrapper_ccd 
/usr/bin/libcamerify /usr/bin/indi_v4l2_ccd

When you start this "driver" you can set it to RGB and stream and record, which is about all I want for the moment.

I hoped you can set the properties like gain, brightness etc via

github.com/raspberrypi/libcamera-apps/issues/344

but apparently it's always reset.
The following user(s) said Thank You: lemoyne
1 year 4 months ago #87863

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

Thanks for the heads up, I fixed the XML file.
1 year 4 months ago #87864

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

It's also in a few other places, dunno how relevant the .spec is:

pi@astrocam:~/astro/indi-3rdparty/indi-libcamera $ rg asi |grep indi
README.md:Go to the directory where you unpacked indi_asi sources and do:
indi-libcamera.spec:Name: indi-asi
indi-libcamera.spec:BuildRequires: libasi
indi-libcamera.spec:Requires: libasi
indi-libcamera.spec:cd indi-asi
indi-libcamera.spec:cd indi-asi
indi_libcamera.xml.cmake: <driver name="ZWO CCD">indi_asi_ccd</driver>
indi_libcamera.xml.cmake: <driver name="ZWO Camera">indi_asi_single_ccd</driver>
indi_libcamera.xml.cmake: <driver name="ZWO Camera">indi_asi_single_ccd</driver>
indi_libcamera.xml.cmake: <driver name="ZWO Camera">indi_asi_single_ccd</driver>
indi_libcamera.xml.cmake: <driver name="ASI EFW">indi_asi_wheel</driver>
indi_libcamera.xml.cmake: <driver name="ASI EAF">indi_asi_focuser</driver>
indi_libcamera.xml.cmake: <driver name="ASI ST4">indi_asi_st4</driver>
1 year 4 months ago #87865

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

Time to create page: 1.484 seconds