×

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

Bi-monthly release with minor bug fixes and improvements

Driver for Raspberry Pi "High Quality Camera?"

  • Posts: 123
  • Thank you received: 13
Hi All,

I have created a fork/branch of a driver and renamed it to be indi_rpicam2x so you can have both in parallel, after installation driver should be located in "other" right next to rpicam driver.
github.com/Vulisha/indi-3rdparty/tree/rp...-hardcoded-2xbinning

So this is hardcoded binning, without framing it is fixed resolution! Framing is possible next feature. One day, maybe, I will integrate this to main driver so no need for two drivers. This driver is recommended for guiding, and dimmer targets.

Guide how to build is on section "Building individual 3rd Party Drivers".
Driver is currently based on v1.9.6 of indi, as there are some breaking changes in nightly build I have reverted them and I will put them back when nightly goes live. If I remember, you can send me reminder here if needed.


On little fun side of things, i was imaging Saturn other day with REGULAR driver, so unbinned. I framed Saturn to 900x800px to reduce download speed. Imaged with Skywatcher 127 MAK. Could have do better job with focus and post processing. Imaged 1500 frames at 0.05s, stacked ~100 of it. Raw streaming would be brilliant if it could be done. There is raspiraw implementation that allows 11FPS at full resolution, so framed it could go to 120FPS easily.
The following user(s) said Thank You: Jasem Mutlaq
Last edit: 1 year 8 months ago by Outta.
1 year 8 months ago #84683
Attachments:
The topic has been locked.
Do you think you might be able to work on a new driver using libcamera-apps as the backend? The current driver relies of deprecated API and it's time to move on to the new libcamera based framework.
1 year 8 months ago #84721
The topic has been locked.
  • Posts: 123
  • Thank you received: 13
Hi Jason,

Last time we discussed libcamera was not good for our purpose due to speed limitations, now as I read it has become a lot faster. libcamera-still can record unprocessed DNG files, and libcamera-raw can record full res(4056x3040) at 10FPS that is just 1 fps slower than mmal driver.

Unfortunately I am barely capable of altering this driver, and not even good in that as properly I should be able to implement binning in original driver, let alone doing full implementation. If someone with good knowledge is to setup everything and make basic image and stream, I might be able to help with integration of additional features if needed. I have no idea how could I use libcamera-still to get data to INDI :D or should I use that or just use sourcecode of libcamera-still and raw. It would be good if we could just use those commands and stream their data.

The stuff we need to integarate would be libcamera-still - that is giving us option to record raw DNG-s, that is I guess similar to FITs, and libcamera-raw for raw videorecording/streaming.

Interesting optional feature we could use for libcamera-raw would be possibility to save to "ramdisk" as that would enable us to have maximum speed, and then transfer data where needed when recording finishes( or even better while recording is progres slowly move from ramdisk to sdcard). This should be an option as it would not be good for RPis with 1gb of ram.
Last edit: 1 year 8 months ago by Outta.
1 year 8 months ago #84735
The topic has been locked.
Thanks, it's greatly appreciated! I'll take a look at the source code and see if we can use a combination of libcamera-still for regular captures and libcamera-vid for streaming.
The following user(s) said Thank You: Simon
1 year 8 months ago #84737
The topic has been locked.
  • Posts: 123
  • Thank you received: 13
Not libcamera-vid. but libcamera-raw for video. That is my recommendation, due to speed. Unfortunately that means no preview but we get raw data and that is important.
1 year 8 months ago #84739
The topic has been locked.
  • Posts: 4
  • Thank you received: 1
Hi again. Thanks for all the work! Though I'm having problems when trying to make the driver from your git. I get 2 errors; have you run into these before? Thanks again.

astroberry@astroberry:~/Projects/build/indi-rpicam2x $ make -j4
[ 6%] Building CXX object CMakeFiles/rpicam2x.dir/mmaldriver.cpp.o
In file included from /home/astroberry/Projects/indi-3rdparty/indi-rpicam2x/mmaldriver.cpp:37:
/home/astroberry/Projects/indi-3rdparty/indi-rpicam2x/mmaldriver.h:65:18: error: ?virtual void MMALDriver::addFITSKeywords(fitsfile*, INDI::CCDChip*)? marked ?override?, but does not override
virtual void addFITSKeywords(fitsfile * fptr, INDI::CCDChip * targetChip) override;
^~~~~~~~~~~~~~~
/home/astroberry/Projects/indi-3rdparty/indi-rpicam2x/mmaldriver.cpp: In member function ?virtual void MMALDriver::addFITSKeywords(fitsfile*, INDI::CCDChip*)?:
/home/astroberry/Projects/indi-3rdparty/indi-rpicam2x/mmaldriver.cpp:103:48: error: no matching function for call to ?MMALDriver::addFITSKeywords(fitsfile*&, INDI::CCDChip*&)?
INDI::CCD::addFITSKeywords(fptr, targetChip);
^
In file included from /home/astroberry/Projects/indi-3rdparty/indi-rpicam2x/mmaldriver.h:24,
from /home/astroberry/Projects/indi-3rdparty/indi-rpicam2x/mmaldriver.cpp:37:
/usr/include/libindi/indiccd.h:508:22: note: candidate: ?virtual void INDI::CCD::addFITSKeywords(INDI::CCDChip*)?
virtual void addFITSKeywords(CCDChip * targetChip);
^~~~~~~~~~~~~~~
/usr/include/libindi/indiccd.h:508:22: note: candidate expects 1 argument, 2 provided
make[2]: *** [CMakeFiles/rpicam2x.dir/build.make:76: CMakeFiles/rpicam2x.dir/mmaldriver.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/rpicam2x.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
The following user(s) said Thank You: Simon
1 year 5 months ago #87164
The topic has been locked.
  • Posts: 123
  • Thank you received: 13
Hello Craig,

Indeed there have been some upstream changes regarding removal of file pointer, I have not used scope some time now but I did now due to eclipse.

All in all I have updated and pushed changes on branch mentioned above, should work now.
The following user(s) said Thank You: Simon
1 year 5 months ago #87542
The topic has been locked.
  • Posts: 106
  • Thank you received: 33
With some instructions where to get indi-rpicam2x and how to build it, maybe I could offer some help with testing?
1 year 4 months ago #87770
The topic has been locked.
  • Posts: 123
  • Thank you received: 13
You can find the code in this git, and there are guides on git how to build and install. I saw Jason started on libcamera implementation, hopefully I will be able to help with that and we can forget about this implementation, but for now I still use it for guiding. Not the best option but fairly good.

github.com/Vulisha/indi-3rdparty/tree/rp...-hardcoded-2xbinning

Open Terminal and type this only first time(prerequisite):
sudo apt-get install libnova-dev libcfitsio-dev libusb-1.0-0-dev zlib1g-dev libgsl-dev build-essential cmake git libjpeg-dev libcurl4-gnutls-dev libtiff-dev libftdi-dev libgps-dev libraw-dev libdc1394-22-dev libgphoto2-dev libboost-dev libboost-regex-dev librtlsdr-dev liblimesuite-dev libftdi1-dev libgps-dev libavcodec-dev libavdevice-dev
sudo apt-get -y install libindi-dev
And then type this in
mkdir -p ~/Projects/build/indi-rpicam
cd ~/Projects/build/indi-rpicam
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-rpicam
make -j4
sudo make install

Last edit: 1 year 4 months ago by Outta.
1 year 4 months ago #87771
The topic has been locked.
I started on libcamera, but it was too unstable. Do you think you can help with the code Outta?
1 year 4 months ago #87828
The topic has been locked.
  • Posts: 49
  • Thank you received: 12
I really do want to help out also since i wrote the first version but im very time constrained.
1 year 4 months ago #87829
The topic has been locked.
Ok here it is: github.com/indilib/indi-3rdparty/tree/master/indi-libcamera

It depends on both libcamera and libcamera-apps (provided by Raspberry PI OS). It would be nice if it is just dependency on libcamera, but that would take more work. One problem I encountered is that in detectCamera() We use camera manager. Because also libcamera-apps uses camera manager, this results in some conflicts where only 1 instance can be alive at a time. Despite the fact that the object is destroyed when the function goes out of scope, libcamera crashes when libcamera-apps tries again to create another instance of CameraManager.

I was able to capture from IMX219 camera just fine. This driver is in its early stages.
1 year 4 months ago #87832
The topic has been locked.
Time to create page: 1.239 seconds