Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rpiCamera: selected camera is not available #3715

Closed
2 of 13 tasks
JiningLiu opened this issue Aug 31, 2024 · 8 comments · Fixed by #3746
Closed
2 of 13 tasks

rpiCamera: selected camera is not available #3715

JiningLiu opened this issue Aug 31, 2024 · 8 comments · Fixed by #3746
Labels
bug Something isn't working rpi-camera

Comments

@JiningLiu
Copy link

JiningLiu commented Aug 31, 2024

Which version are you using?

v1.9.0

Which operating system are you using?

  • Linux amd64 standard
  • Linux amd64 Docker
  • Linux arm64 standard
  • Linux arm64 Docker
  • Linux arm7 standard
  • Linux arm7 Docker
  • Linux arm6 standard
  • Linux arm6 Docker
  • Windows amd64 standard
  • Windows amd64 Docker (WSL backend)
  • macOS amd64 standard
  • macOS amd64 Docker
  • Other (please describe)

Describe the issue

When using the path configuration described in the section below, running mediamtx results in the following error:
ERR [path cam] [RPI Camera source] camera_create(): selected camera is not available

This happens in both regular and docker environments. Device is Raspberry Pi 5 4GB with Camera Module 3, libcamera-hello works perfectly fine.

Unsure if related to #3714.

Describe how to replicate the issue

  1. Use the following path configuration (or use the provided docker command in README):
paths:
  cam:
    source: rpiCamera
  1. Start the server

Did you attach the server logs?

log.txt

Did you attach a network dump?

No

@bluenviron bluenviron deleted a comment Aug 31, 2024
@ViktorFairuschin
Copy link

Got the same issue!

@aler9 aler9 added bug Something isn't working rpi-camera labels Sep 5, 2024
@aler9
Copy link
Member

aler9 commented Sep 5, 2024

Hello, thanks for providing logs, in which this line is visible

vc4.cpp:188 Unable to acquire a Unicam instance

Digging into libcamera issues, it turns out that that warning is triggered when libcamera is compiled without PISP support (Raspberry Image Signal Processor): raspberrypi/libcamera#145

The libcamera bundled into the server is indeed compiled without PIPS. Therefore, we'll change bundled libcamera in order to enable PISP.

@aler9
Copy link
Member

aler9 commented Sep 6, 2024

please test this nightly release and let me know if it fixes the issue (click on "artifacts", "binaries"):

https://github.com/bluenviron/mediamtx/actions/runs/10734526077

@dgo19
Copy link

dgo19 commented Sep 6, 2024

Hello,
thank you for the nightly build. I have the same issue and tried the nightly build including the fix. It's not working, here is the debug log:

Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850261028] [2663] DEBUG IPAModule ipa_module.cpp:334 ipa_rpi_pisp.so: IPA module ./ipa_module/ipa_rpi_pisp.so is signed
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850359750] [2663] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module './ipa_module/ipa_rpi_pisp.so'
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850447491] [2663] DEBUG IPAModule ipa_module.cpp:334 ipa_rpi_vc4.so: IPA module ./ipa_module/ipa_rpi_vc4.so is signed
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850470251] [2663] DEBUG IPAManager ipa_manager.cpp:245 Loaded IPA module './ipa_module/ipa_rpi_vc4.so'
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850512640] [2663]  INFO Camera camera_manager.cpp:313 libcamera v0.3.0+65-6ddd79b5-dirty (2024-09-06T07:29:55+00:00)
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850644010] [2664] DEBUG Camera camera_manager.cpp:69 Starting camera manager
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.850800029] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "rp1-cfe" created from /dev/media2
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851106400] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media2: rp1-cfe
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851164363] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "pispbe" created from /dev/media0
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851329215] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media0: pispbe
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851355364] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "rpivid" created from /dev/media3
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851395938] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media3: rpivid
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851436253] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:230 New media device "pispbe" created from /dev/media1
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851588679] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:258 Added device /dev/media1: pispbe
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851603290] [2664] DEBUG Camera camera_manager.cpp:134 Found registered pipeline handler 'rpi/vc4'
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851635623] [2664] DEBUG RPI vc4.cpp:188 Unable to acquire a Unicam instance
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851643457] [2664] DEBUG RPI vc4.cpp:188 Unable to acquire a Unicam instance
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851652901] [2664] DEBUG Camera camera_manager.cpp:134 Found registered pipeline handler 'rpi/pisp'
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851664346] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "rp1-cfe"
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851678457] [2664] DEBUG DeviceEnumerator device_enumerator.cpp:318 Successful match for media device "pispbe"
Sep 06 10:22:00 rpi5c mediamtx[2663]: [0:14:33.851709605] [2664]  INFO RPI pisp.cpp:695 libpisp version v1.0.6 b567f0455680 06-09-2024 (07:15:51)
Sep 06 10:22:00 rpi5c mediamtx[2663]: terminate called after throwing an instance of 'std::runtime_error'
Sep 06 10:22:00 rpi5c mediamtx[2663]:   what():  BE: Could not find config json file: /share/libpisp/backend_default_config.json
Sep 06 10:22:00 rpi5c mediamtx[2649]: 2024/09/06 10:22:00 ERR [path cam] [RPI Camera source] process exited unexpectedly: signal: aborted

I tried creating directories and a symlink with that file:

mkdir -p /share/libpisp
ln -s /usr/share/libpisp/backend_default_config.json /share/libpisp/backend_default_config.json

It works with that modification. Hope this helps.

Kind Regards, Daniel

@aler9
Copy link
Member

aler9 commented Sep 6, 2024

@dgo19 thanks for the feedback, try again with this different nightly release:

https://github.com/bluenviron/mediamtx/actions/runs/10739500678

@dgo19
Copy link

dgo19 commented Sep 6, 2024

Yes, this build works for me. Thank you!

@ViktorFairuschin
Copy link

Also works for me, thanks!

Copy link
Contributor

This issue is mentioned in release v1.9.1 🚀
Check out the entire changelog by clicking here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working rpi-camera
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants