×

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
By the way: I implemented a libcamera driver for the HQ camera in Python: indi_pylibcamra

It runs on a Raspberry Pi Zero (Raspian without XServer) and delivers raw Bayer pattern images. It is in an early stage. For instance I did not check if the color information is set in the right order in the FITS. During a first check with a photo lense I got the impression that I exchanged blue and red. Local saving is also not implemented. And doing Connect->Disconnect->Connect leads to an error. It also needs documentation. I will continue to work on it after Xmas.

Marry Christmas and Happy New Year to all of you!
The following user(s) said Thank You: Anjo
1 year 4 months ago #89216

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

This fellow is smart listen to what he says.

Let me just digress on images from this implementation, in this current state, changing gain does not change histogram, and that is main thing you should watch. Changing exposure does change it, but up to certain point, depending what is supported from camera driver.

I know that imx290/462 can support up to 15s but to activate that mode you need to set some address, in driver to 0xFFFFF, and that is not implemented in RPI driver, only in arducam driver.
The following user(s) said Thank You: Ronald Schreiber
1 year 4 months ago #89217

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, the DNG doesn't change at all with exposure and gain settings at least not from what I see. It's only after you shoot a jpeg it does change.

Also, the controls can be useful for a variety of things, getting video to work better being one.

So yeah, for the "actual" images raw is fine, but it's a lot more convenient when you have other options, too.
1 year 4 months ago #89220

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

For me it does, but again not for raw images. They don't change at all unless you shoot jpegs first.
1 year 4 months ago #89221

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 for this, I hope I'll get try it in the next few days.

Frankly, if I had time I would have written a pure python command line driver (ie, not using picamera2, but forking to a new process and getting stdout or the file it produces). Otherwise libcamera is just too flaky for my tastes.

I'd just have used a pre-exisitng lib like github.com/MMTObservatory/pyINDI/tree/mmtcam_stuff

I think they have a CCD template floating around. But I also definitely wanted video, and have no idea on how to show that on the client and how many props I would have to implement for it.
The following user(s) said Thank You: Ronald Schreiber
1 year 4 months ago #89222

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

  • Posts: 27
  • Thank you received: 4
@Anjo

Thank you. Last week I started to write the driver based on the mentioned pyINDI package. But then I found too many things to work around and decided to implement the protocol by myself. It was not difficult.

I agree that having the possibility to get processed pictures has advantages. At least when you focus your telescope on a bright star you don't need raw images. In this situation it is more important to have short dead time between changing focus and seeing the effect on the image. With smaller JPG images you can save a lot transmission time. My Raspberry Pi needs about 13 seconds to transmit the Raw image - searching focus becomes a nightmare.
1 year 4 months ago #89224

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, so I re-added CloseCamera/OpenCamera calls so the cam is now locked only for the duration of shots.

Playing with the text props will still crash, so be careful with them. Probably best leave them at the first item.

And I added width/height setting. You need to do this on the "Image Setting" page - and make sure your width is divisible by 2.

I also noticed that you can't compile the driver on buster, as there are changes in libcamera (exposure is a long, not a pointer and a few other things). Then again, it probably won't run the newer cams anyway.
1 year 4 months ago #89229

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

@OUTTA Have you seen this: github.com/raspberrypi/libcamera-apps/issues/344

I have the waveshare module and contrary to what it reports

2022-12-22T16:38:58: Driver ../build/indi-libcamera/indi_libcamera_ccd: ExposureTime : [14..7229147]

it seems like it does expose for 15s?
1 year 4 months ago #89230

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

Interesting I have IMX462 but it does not seem to work as expected.
Do you run V4L2 command before or that is in driver? Is that PR in latest version?

Also one thing i noticed about gain, do you use "gain" or "analoggain" parameter. Gain is digital, and analoggain is one we are interested in.
1 year 4 months ago #89231

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

From the core and help texts both gains are synonymous
1 year 4 months ago #89232

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

Indeed you are right,and I have been writing "analog" to terminal for nothing whole last year or so :D
1 year 4 months ago #89233

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

  • Posts: 27
  • Thank you received: 4
Libcamera knows:

"analogue_gain": This tunes a physical amplifier between pixel circuit and ADC on the camera chip. It influences raw and processed frames.

"digital_gain" and "colour_gains": These are parameters of the software running in the ISP for processing the frames. They are digital multiplication factors and influence only the processed frame. The "colour_gains" are used to set the white balance.
1 year 4 months ago #89234

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

Time to create page: 1.436 seconds