×

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

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.
1 year 4 months ago #88721

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

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

Also, I think we should just copy over the libcamera-app code verbatim like it was done before with the includes. I just don't know how to get the top level to also build the sublevel? Then we shouldn't need to make install or anything of the libcamera-apps, potentially overwriting system stuff.

When things work, we can pull out the bits we need into the driver and remove the apps code, but I'm not sure it's worth the effort.

For now, getting repeatable exposures to work should be the first prio.
Last edit: 1 year 4 months ago by Anjo.
1 year 4 months ago #88722

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

@Anjo: That's wierd! For my sensor imx477 it returns correct values. What about pixel size? Is that correct?
Last edit: 1 year 4 months ago by Simon.
1 year 4 months ago #88723

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

Yeah px size is correct. There's 2 bounds in the profiles, I guess this is the wrong one? PixelArrayActiveAreas vs PixelArraySize?

extern const std::array<const ControlValue, 3> LocationValues;
extern const Control<int32_t> Location;
extern const Control<int32_t> Rotation;
extern const Control<std::string> Model;
extern const Control<Size> UnitCellSize;
extern const Control<Size> PixelArraySize;
extern const Control<Span<const Rectangle>> PixelArrayOpticalBlackRectangles;
extern const Control<Span<const Rectangle>> PixelArrayActiveAreas;
extern const Control<Rectangle> ScalerCropMaximum;
extern const Control<float> SensorSensitivity;
1 year 4 months ago #88724

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, the livecycle seems to work now. You can turn on/off exposures and streams multiple times without it crashing.

The trick is that you need to:

- configure
- start encoder (with videos, possibly also with stills)
- start camera
...
- stop camera
- teardown
- stop encoder

I also added libcamera-apps code in full. Still not sure how it should build, though.

This is the last time I'll be showing this link. In the future we need to come up with a more sensible way to exchange code:

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

I still get "unknown bayer format" when exposing and a mostly black screen when showing the stream in kstars.

Also, you need to re-make install libcamera-apps whenever you make a change in the core stuff.

It would be nice of someone with more knowledge of CMake could take a look and fix up things so they build libcamera-apps as part of the driver build and take the includes from there.
Last edit: 1 year 4 months ago by Anjo.
1 year 4 months ago #88730

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

@Jasem can you create libcamera dev branch and give access for few of us so we can freely push and then we can do PR when we have something.
1 year 4 months ago #88732

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

What do you mean libcamera dev branch? Each project has their own repos. You indi indi-libcamera driver? you can fork that. We're using libraw to decode any raw files, I already implemented that in the driver.
1 year 4 months ago #88741

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

Anjo, I have never use it before, but I thing git submodules could help you with that: git-scm.com/book/en/v2/Git-Tools-Submodules
1 year 4 months ago #88743

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

What he means is a common branch at indi to work on without needing PRs. I don't know if that's possible though.

If you guys send me your github nicks, we can use my fork and I'll invite you.

As a sidenote, when you set video to MPEG, it now works just fine. Only raw doesn't and crashes.
1 year 4 months ago #88751

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

No it wouldn't, as we need 3 things: have the code locally, being able to change it and integrate it to the indi driver build so you don't need the shared libs installed.

With submodules you just pull in the code into your dir structure. You could make patch scripts and integrate them into your builds, but for now that's just too slow. I really don't want to learn cmake.
1 year 4 months ago #88752

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

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

Also submodules are not accepted in INDI GIT.
1 year 4 months ago #88753

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

Understandable. Anyway, we should copy and modify the code for now and maybe later strip it apart if someone feels like putting in the time.

Can you give me a hint on how to get the builds to use the local libcamera-apps dir? I got includes to work, but not the actual code, it still requires the .so being installed.
1 year 4 months ago #88754

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

Time to create page: 1.202 seconds