×

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

Bi-monthly release with minor bug fixes and improvements

INDI LibCamera Driver

  • Posts: 27
  • Thank you received: 4
@Anjo
Am I right that you mean the 'indi_pylibcamera' driver when you speak about the Python driver? If so, please open an issue in github.com/scriptorron/indi_pylibcamera and provide more details for debugging.

Thank you.
The following user(s) said Thank You: Anjo
5 months 2 weeks ago #97134

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

Here you go: github.com/scriptorron/indi_pylibcamera/issues/53

It only happens with the IMX290, at least not a Raspi V1 camera I also tested (which apparently can do only 1s though anyway).
5 months 2 weeks ago #97136

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

Hi Jasem,

to make this clear: if you can update the driver without any larger hassle, I'd be happy if you could do so. I don't know what I saw with the V4L2 driver, but it seems to be gone.

But I have no idea how v4l2 and libcamera work together and what component is building on what...
5 months 1 week ago #97212

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

I'm not sure how V4L2 is related to INDI Libcamera driver? they're two different drivers and share nothing in common.
5 months 1 week ago #97233

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

If you're confident you can do this, please do so :)
5 months 1 week ago #97284

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

  • Posts: 1
  • Thank you received: 0

Replied by geoffrey-vl on topic INDI LibCamera Driver

Ok, just went through 19 pages of development ramblings. Currently it seems most development has halted, still I'm not sure what the best path there is to walk.
So, for what I understand there is a libcamera integration in indi-3rdparty here: github.com/indilib/indi-3rdparty/blob/master/indi-libcamera/
And there is also an alternative in python: github.com/scriptorron/indi_pylibcamera. The latter uses the pylibcamera python library.

As the first option is directly integrated into indi-3rd party, where the alternative will never be, I'd expect the first option to be most favored. However it seems there have been many issues with it, and not a lot of patches have been submitted so I'm not sure if everything has been addressed. Also, I had a quick look at the sources, I'm not entirely sure why the entire libcamera-apps has been copied into indi-3rdparty, it seems as if no-one ever gave it a proper clean-up so far. Am I correct in those assumptions?

Also please note that libcamera-apps is about to be renamed into rpicam-apps, as those are maintained entirely by the RPI Foundation while libcamera isn't.
3 months 4 days ago #98412

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

I already resumed work on indi-libcamera and if all goes well, we'll have a functional driver in the next INDI release next week. It is based on rpicam-apps so it will only be available for bookworm.
The following user(s) said Thank You: Axel , santiago concha, geoffrey-vl
3 months 4 days ago #98413

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

  • Posts: 64
  • Thank you received: 10

Replied by Axel on topic INDI LibCamera Driver


Hi there,

I am currently in a project of uniting PiFinder (pifinder.io) and Stellarmate. This is not possible at the moment because I wait for the PiFinder to be elevated to Bookworm. I'll report on succeed (you can follow on PiFinders Discord channel, if interested: "PiFinder in Stellarmate" on Discord . My discord name there is HeyApos :-). But that's another story.

Back to topic:

That's why I currently dual boot Stellarmate and the PiFinder on the same hardware and a Raspberry Pi HD cam is attached (datasheets.raspberrypi.com/hq-camera/hq-...ra-product-brief.pdf) It works fine with the Pifinder (which uses a pyhthon library and another OS version). So the camera itself and hardware is OK.

The new Stellarmate 1.8.1. claims to support the (official) Raspberry Pi cameras with Libcamera. I know there had been a lot of work by Jasem and others to get this work :-) Thanks for that. I tried to carefully read here and understand how to debug this.

Problem:
When I select the LibCamera driver in a new SM profile, the profile does not start at all.

- Stellarmate App v2.6.80 (Android) - also tried with iPad
- Stellarmate OS 64bit 1.8.1.
- Drivers: Telescope Simulator and Raspberry Pi Cam HD (LibCamera)

Any Idea, what I am doing wrong?

Logging:
Dmesg gives me nothing. And the indi log dir is empty. the other log files I attached.
stellarmate@stellarmate:~ $ libcamera-hello --version
rpicam-apps build: 9ae39f85ae6b 30-01-2024 (13:24:24)
libcamera build: v0.1.0+118-563cd78e

apt list --installed | grep libcamera
libcamera-ipa/stable,now 0.1.0+rpt20231122-1 arm64 [installed,automatic]
libcamera-tools/stable,now 0.1.0+rpt20231122-1 arm64 [installed]
libcamera0.1/stable,now 0.1.0+rpt20231122-1 arm64 [installed,automatic]
python3-libcamera/stable,now 0.1.0+rpt20231122-1 arm64 [installed,automatic]

apt list --installed | grep picamera
python3-picamera2/stable,stable,now 0.3.16-1 all [installed]

libcamera-hello --list-cameras
Available cameras
-----------------
0 : imx477 [4056x3040 12-bit RGGB] (/base/soc/i2c0mux/i2c@1/imx477@1a)
    Modes: 'SRGGB10_CSI2P' : 1332x990 [30.00 fps - (0, 0)/0x0 crop]
           'SRGGB12_CSI2P' : 2028x1080 [30.00 fps - (0, 0)/0x0 crop]
                             2028x1520 [30.00 fps - (0, 0)/0x0 crop]
                             4056x3040 [30.00 fps - (0, 0)/0x0 crop]


Troubleshoot


I followed this bug description: github.com/raspberrypi/picamera2/issues/502 and the test python code gives me the following, so this seems to work.
Opening camera 0: {'Model': 'imx477', 'Location': 2, 'Rotation': 180, 'Id': '/base/soc/i2c0mux/i2c@1/imx477@1a', 'Num': 0}
[1:20:28.197096230] [11781]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[1:20:28.229802128] [11791]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[1:20:28.232379551] [11791]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media1 and ISP device /dev/media2
[1:20:28.232457346] [11791]  INFO RPI pipeline_base.cpp:1142 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[1:20:28.235057231] [11781]  INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[1:20:28.267695056] [11794]  WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[1:20:28.270162722] [11794]  INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media1 and ISP device /dev/media2
[1:20:28.270281868] [11794]  INFO RPI pipeline_base.cpp:1142 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Success.
>>> print('Finished.')
Finished.


When I turn on logging in EKOS (VNC) in "verbose" mode and "file" the error is:
[2024-02-04T21:09:03.079 CET WARN ][           org.kde.kstars.indi] - Driver "LibCamera" failed to start. Retrying in 5 seconds...
[2024-02-04T21:09:08.079 CET WARN ][           org.kde.kstars.indi] - Driver "LibCamera" failed to start. Retrying in 5 seconds...
[2024-02-04T21:09:13.087 CET WARN ][           org.kde.kstars.indi] - Driver "LibCamera" failed to start. Retrying in 5 seconds...
[...]

libcamera-still -r -o test.jpg WORKS (temporarily shut down EKOS / Indi-Webmanager)

libcamera-still -r -o test.jpg
[0:01:23.547791788] [1796] INFO Camera camera_manager.cpp:284 libcamera v0.1.0+118-563cd78e
[0:01:23.604749367] [1820] WARN RPiSdn sdn.cpp:39 Using legacy SDN tuning - please consider moving SDN inside rpi.denoise
[0:01:23.607778920] [1820] INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media3 and ISP device /dev/media0
[0:01:23.607872746] [1820] INFO RPI pipeline_base.cpp:1142 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
Preview window unavailable
Mode selection for 2028:1520:12:P
SRGGB10_CSI2P,1332x990/0 - Score: 3456.22
SRGGB12_CSI2P,2028x1080/0 - Score: 1083.84
SRGGB12_CSI2P,2028x1520/0 - Score: 0
SRGGB12_CSI2P,4056x3040/0 - Score: 887
Stream configuration adjusted
[0:01:23.610184360] [1796] INFO Camera camera.cpp:1183 configuring streams: (0) 2028x1520-YUV420 (1) 2028x1520-SBGGR12_CSI2P
[0:01:23.610655825] [1820] INFO RPI vc4.cpp:608 Sensor: /base/soc/i2c0mux/i2c@1/imx477@1a - Selected sensor format: 2028x1520-SBGGR12_1X12 - Selected unicam format: 2028x1520-pBCC
#0 (0.00 fps) exp 29999.00 ag 2.52 dg 1.63
#1 (30.00 fps) exp 29999.00 ag 2.52 dg 1.63
#2 (30.01 fps) exp 29999.00 ag 2.52 dg 1.63
[...]
Mode selection for 4056:3040:12:P
SRGGB10_CSI2P,1332x990/0 - Score: 10552.2
SRGGB12_CSI2P,2028x1080/0 - Score: 8179.84
SRGGB12_CSI2P,2028x1520/0 - Score: 7096
SRGGB12_CSI2P,4056x3040/0 - Score: 0
[0:01:29.203971624] [1796] INFO Camera camera.cpp:1183 configuring streams: (0) 4056x3040-YUV420 (1) 4056x3040-SBGGR12_CSI2P
[0:01:29.211876560] [1820] INFO RPI vc4.cpp:608 Sensor: /base/soc/i2c0mux/i2c@1/imx477@1a - Selected sensor format: 4056x3040-SBGGR12_1X12 - Selected unicam format: 4056x3040-pBCC
Still capture image received
Bayer format is BGGR-12


Cheers, Axel





2 months 3 weeks ago #98760
Attachments:

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

I pushed an update to indi-libcamera package yesterday, did you install that version? There was an update to rpicam-apps as well. Make sure to run this:
sudo apt-get update && sudo apt-get -y dist-upgrade
2 months 3 weeks ago #98771

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

  • Posts: 64
  • Thank you received: 10

Replied by Axel on topic INDI LibCamera Driver

Hi Jasem,

thanks a lot.

> Jasem Mutlaq post=98771: I pushed an update to indi-libcamera package yesterday, did you install that version? There was an update to rpicam-apps as well. Make sure to run this:
<code>sudo apt-get update && sudo apt-get -y dist-upgrade
</code>[/quote]

I did my test yesterday (here is CEST, so only 2 hours difference). Probably things got mixed up. Now I just did an upgrade and got a lot of indi drivers, but no indi-libcamera. And I now know why ...
stellarmate@stellarmate:~ $ dpkg -l indi-libcamera
dpkg-query: no packages found matching indi-libcamera
stellarmate@stellarmate:~ $ apt-cache search libcam | grep indi
python3-libcamera - complex camera support library (Python bindings)
indi-libcamera - INDI driver for cameras accessible via libcamera.
indi-libcamera-dbg - INDI driver for cameras accessible via libcamera.

:huh: Seems there had been no such module installed. Me culpa mea maxima culpa.
stellarmate@stellarmate:~ $ sudo apt install indi-libcamera
[...]
The following NEW packages will be installed:
  indi-libcamera
[...]
Setting up indi-libcamera (1.1+z+stable~202402051324) ...

Test:
- After starting Stellarmate I could select the driver LibCamera imx477 (see photo). Good.
- Taking photo leads to an abort
- I changed the image type in the Stellarmate App from DNG (default) to JPG and could take a photo.
- After fidling around with the filetype in EKOS (VNC), I got only "scrambled eggs" :-)
- rebooted. Captured OK (JPG) - > but after 4 or 5 times the capture aborts:
[ERROR] Error opening camera: failed to allocate capture buffers for stream
- rebooted. capture OK (JPG and DNG) ... after some tries: scrambled eggs or [ERROR]:-)


So this is a big step forward - Tux likes it :) But it needs some work to really beeing stable.

I'll try further on.
2 months 3 weeks ago #98823
Attachments:

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

Ok I have a clean version of stellarmate did update dist-upgrade
When I select Libcamera i indi is not starting.

Then I pulled recent version of indi-libcamera

Initially falied to cmake due to missing libcamera-dev installed by

sudo apt-get install libcamera-dev

Next issue was
-- Could NOT find Boost: missing: program_options (found /usr/lib/aarch64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0"))

Solved by
sudo apt-get install libboost-all-dev

And then it installed
The following user(s) said Thank You: Axel
2 months 3 weeks ago #98847

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

Very important trick is to set AWB Blue and AWB Red to 1, if itis set to 0, it will take 3 exposures to adjust awb. Default should be 1 I think as well.
2 months 1 week ago #99103

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

Time to create page: 1.553 seconds