×

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

Bi-monthly release with minor bug fixes and improvements

INDI LibCamera Driver

Replied by Jasem Mutlaq on topic INDI LibCamera Driver

You need to set GDB settings for this to work, see screenshot
The following user(s) said Thank You: Outta
1 year 4 months ago #88142
Attachments:

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 am in! Thanks! I think I might be useful now :D
So 528 cameraManager.reset(); is culprit for crashing, I think this has something with libcamera as well as there is commit similar to this on libcamera.

All in all I will be able to debug now and I will try to make driver more stable.

Simon you can try to run it as well, our environments are a bit different, but more the merrier. You have initial commands, then install QT creator(sudo apt install qtcreator)
then follow this tutorial:

www.indilib.org/developers/deveioper-man...ent-environment.html

I think you can skip steps building and installing just indi as you should have it on stellarmate
Last edit: 1 year 4 months ago by Outta.
1 year 4 months ago #88146

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

Everything went well until I executed line 33
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera

I got this:
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera
-- The CXX compiler identification is GNU 10.2.1
-- The C compiler identification is GNU 10.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found CFITSIO 3.49: /usr/lib/aarch64-linux-gnu/libcfitsio.so
-- Found INDI: /usr/lib/aarch64-linux-gnu/libindidriver.so;/usr/lib/aarch64-linux-gnu/libindiAlignmentDriver.so (found version "1.9.8") 
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Found USB1: /usr/lib/aarch64-linux-gnu/libusb-1.0.so (found version "1.0.24") 
-- Performing Test USB1_HAS_LIBUSB_ERROR_NAME
-- Performing Test USB1_HAS_LIBUSB_ERROR_NAME - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found LIBCAMERAAPPS Library: /usr/lib/aarch64-linux-gnu/libcamera_app.so
-- Checking for module 'libraw'
--   Found libraw, version 0.20.2
-- Checking for module 'libraw_r'
--   Found libraw_r, version 0.20.2
-- Found LibRaw: /usr/lib/aarch64-linux-gnu/libraw.so (found version "0.20.2") 
-- Found JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so  
-- 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"))
-- Checking for module 'libcamera'
--   No package 'libcamera' found
CMake Error at /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:545 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:733 (_pkg_check_modules_internal)
  CMakeLists.txt:19 (pkg_check_modules)
 
 
-- Configuring incomplete, errors occurred!
See also "/home/stellarmate/Projects/build/indi-libcamera/CMakeFiles/CMakeOutput.log".
See also "/home/stellarmate/Projects/build/indi-libcamera/CMakeFiles/CMakeError.log".
 
1 year 4 months ago #88148

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

Everything went well until I executed line 33
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera

I got this:
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ~/Projects/indi-3rdparty/indi-libcamera
-- The CXX compiler identification is GNU 10.2.1
-- The C compiler identification is GNU 10.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Found CFITSIO 3.49: /usr/lib/aarch64-linux-gnu/libcfitsio.so
-- Found INDI: /usr/lib/aarch64-linux-gnu/libindidriver.so;/usr/lib/aarch64-linux-gnu/libindiAlignmentDriver.so (found version "1.9.8") 
-- Found ZLIB: /usr/lib/aarch64-linux-gnu/libz.so (found version "1.2.11") 
-- Found PkgConfig: /usr/bin/pkg-config (found version "0.29.2") 
-- Found USB1: /usr/lib/aarch64-linux-gnu/libusb-1.0.so (found version "1.0.24") 
-- Performing Test USB1_HAS_LIBUSB_ERROR_NAME
-- Performing Test USB1_HAS_LIBUSB_ERROR_NAME - Success
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found LIBCAMERAAPPS Library: /usr/lib/aarch64-linux-gnu/libcamera_app.so
-- Checking for module 'libraw'
--   Found libraw, version 0.20.2
-- Checking for module 'libraw_r'
--   Found libraw_r, version 0.20.2
-- Found LibRaw: /usr/lib/aarch64-linux-gnu/libraw.so (found version "0.20.2") 
-- Found JPEG: /usr/lib/aarch64-linux-gnu/libjpeg.so  
-- 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"))
-- Checking for module 'libcamera'
--   No package 'libcamera' found
CMake Error at /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:545 (message):
  A required package was not found
Call Stack (most recent call first):
  /usr/share/cmake-3.18/Modules/FindPkgConfig.cmake:733 (_pkg_check_modules_internal)
  CMakeLists.txt:19 (pkg_check_modules)
 
 
-- Configuring incomplete, errors occurred!
See also "/home/stellarmate/Projects/build/indi-libcamera/CMakeFiles/CMakeOutput.log".
See also "/home/stellarmate/Projects/build/indi-libcamera/CMakeFiles/CMakeError.log".
Last edit: 1 year 4 months ago by Simon.
1 year 4 months ago #88149

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

do the line 44 and contiue, I should have removed 33, will edit now.
The following user(s) said Thank You: Simon
1 year 4 months ago #88152

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

Change lines containing github.com/... to github.com/... I get error when trying to execute without https://.
1 year 4 months ago #88153

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

I still got error No package 'libcamera' found. I added libcamera-dev to end of line 44 like this
sudo apt install build-essential libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-test-dev libcamera-dev
and line 48 was OK.
1 year 4 months ago #88154

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

After executing line 49 make -j4 I get this:
Scanning dependencies of target indi_libcamera_ccd
[ 50%] Building CXX object CMakeFiles/indi_libcamera_ccd.dir/indi_libcamera.cpp.o
In file included from /usr/include/libindi/defaultdevice.h:23,
                 from /usr/include/libindi/indiccd.h:30,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.h:34,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:21:
/usr/include/libindi/indilogger.h:72: warning: "LOG_ERROR" redefined
   72 | #define LOG_ERROR(txt)  DEBUG(INDI::Logger::DBG_ERROR, (txt))
      | 
In file included from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/options.hpp:21,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/video_options.hpp:14,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/libcamera_encoder.hpp:10,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.h:29,
                 from /home/stellarmate/Projects/indi-3rdparty/indi-libcamera/indi_libcamera.cpp:21:
/home/stellarmate/Projects/indi-3rdparty/indi-libcamera/core/logging.hpp:9: note: this is the location of the previous definition
    9 | #define LOG_ERROR(text) std::cerr << text << std::endl
      | 
[100%] Linking CXX executable indi_libcamera_ccd
[100%] Built target indi_libcamera_ccd

Last Line went OK and I can see driver in EKOS (see attached image), but when I try to start EKOS I get Error dialog: INDI Driver LibCamera crashed (see attached image).

Thumbs up for you OUTTA!
1 year 4 months ago #88155
Attachments:

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

try to add libcamera-apps
as well, they come by default for RpiOS, probably not for StellarMate
1 year 4 months ago #88156

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

I already have latest libcamera-apps.
sudo apt install libcamera-apps
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
libcamera-apps is already the newest version (1.0-stable~202210121703).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 year 4 months ago #88157

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, So regarding crashes that is where fun (and our work) starts :)

My crashes as well, but a bit differently, now install QTCreator, and follow steps from tutorial, to enable debugging.
Last edit: 1 year 4 months ago by Outta.
1 year 4 months ago #88158

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

  • Posts: 106
  • Thank you received: 33

Replied by Simon on topic INDI LibCamera Driver

There is EKOS Debugger that came with Stellarmate. When I run it I get this:
2022-11-15T12:17:30: startup: /usr/bin/indiserver -r 0 -v indi_libcamera_ccd indi_gpsd indi_simulator_telescope
[Attaching after Thread 0x7ff7ff4040 (LWP 21017) fork to child process 21020]
[Detaching after fork from parent process 21017]
2022-11-15T12:17:30: Driver indi_libcamera_ccd: pid=21020 rfd=6 wfd=6 efd=7
2022-11-15T12:17:30: Driver indi_gpsd: pid=21021 rfd=8 wfd=8 efd=9
2022-11-15T12:17:30: Driver indi_simulator_telescope: pid=21022 rfd=10 wfd=10 efd=11
2022-11-15T12:17:30: listening to port 7624 on fd 5
2022-11-15T12:17:30: Local server: listening on local domain at: @/tmp/indiserver
2022-11-15T12:17:30: Driver indi_simulator_telescope: HaAxis: TrackRate 1, trackingRateDegSec 15.041067 arcsec
2022-11-15T12:17:30: Driver indi_simulator_telescope: snooping on GPS Simulator.GEOGRAPHIC_COORD
2022-11-15T12:17:30: Driver indi_simulator_telescope: snooping on GPS Simulator.TIME_UTC
2022-11-15T12:17:30:
Driver indi_simulator_telescope: snooping on Dome Simulator.DOME_PARK
2022-11-15T12:17:30: Driver indi_simulator_telescope: snooping on Dome Simulator.DOME_SHUTTER
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_EOD_COORD
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.EQUATORIAL_COORD
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_INFO
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.GEOGRAPHIC_COORD
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Telescope Simulator.TELESCOPE_PIER_SIDE
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Rotator Simulator.ABS_ROTATOR_ANGLE
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Focuser Simulator.ABS_FOCUS_POSITION
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on Focuser Simulator.FOCUS_TEMPERATURE
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on CCD Simulator.FILTER_SLOT
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on CCD Simulator.FILTER_NAME
2022-11-15T12:17:34: Driver indi_libcamera_ccd: snooping on SQM.SKY_QUALITY
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.142898037] [21020] [1;32m INFO [1;37mCamera [1;34mcamera_manager.cpp:293 [0mlibcamera v0.0.0
[Attaching after Thread 0x7fe8a95500 (LWP 21038) fork to child process 21039]
[Detaching after fork from parent process 21020]
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.935604051] [21038] [1;32m INFO [1;37mRPI [1;34mraspberrypi.cpp:1377 [0mRegistered camera /base/soc/i2c0mux/i2c@1/imx477@1a to Unicam device /dev/media1 and ISP device /dev/media0
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.936226005] [21038] [1;31mERROR [1;37mDeviceEnumerator [1;34mdevice_enumerator.cpp:166 [0mRemoving media device /dev/media0 while still in use
2022-11-15T12:17:34: Driver indi_libcamera_ccd: [1:25:12.936292671] [21038] [1;31mERROR [1;37mDeviceEnumerator [1;34mdevice_enumerator.cpp:166 [0mRemoving media device /dev/media1 while still in use
2022-11-15T12:17:34: Driver indi_libcamera_ccd: stderr EOF
2022-11-15T12:17:34: Driver indi_libcamera_ccd: read: Connection reset by peer
2022-11-15T12:17:34: Driver indi_libcamera_ccd: Terminated after #0 restarts.

I'll install QTCreator and will report here my findings. Happy codding! :)
1 year 4 months ago #88159

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

Time to create page: 1.217 seconds