-
Notifications
You must be signed in to change notification settings - Fork 81
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
Add libcamera (CSI/picam) cam support on the Pi5 (spyglass) #241
Comments
Please elaborate further on this. What exact command did you run? This won't change anything below, I'm just curious. As you can read on your log snippet, we don't support libcamera devices on the Pi5. Therefore no CSI cam support atm. If you used the legacy stack to get an image, you have to know that we cannot make it work consistently with the legacy stack on Bookworm. Also that legacy stack will be removed in future versions of Raspberry Pi OS, so it shouldn't be used. We will add some support in the future but for now we cannot support it. |
I changed it to a feature request, as we currently don't support it as clearly stated in the log. |
I used libcamera-hello to get a picture file. Ah got it, so any and all of the pi cameras are no longer supported as of the pi5? Is that more of a Pi5 thing or just because it is new? Is there a workaround potentially to have the pi serve up some sort of ip camera to look at? I tried camera-streamer which didn't work either for this purpose. |
It's an overall Pi5 issue atm. We are using camera-streamer as our backend. As that doesn't work with the Pi5, we don't support it. Some kind of workaround/alternative would be spyglass with some adjustments. I might go into detail about it later today. Basically you need to change one of the includes that it's using the software encoder instead of the hardware encoder. We will add spyglass in an upcoming update, but, like I wrote earlier, that's currently not possible for us. |
So interim, if I have the option to use a pi4, then its probably better to use it? Just for ease of use |
Exactly a Pi4 would work as expected. It's really just the Pi5 with it's hardware limitations (sounds wrong as it's the newer device but it's actually like that). To the Spyglass workaround: sudo apt update
sudo apt install python3-libcamera python3-kms++ python3-picamera2 Then clone the repository and follow the instructions on how to install as a service. from picamera2.encoders import MJPEGEncoder to from picamera2.encoders import JpegEncoder as MJPEGEncoder Make sure to comment out the picam/csi cam in crowsnest or stop/disable crowsnest completely. Like written above someone should only use this for picams/CSI cams. Spyglass only supports one cam at the same time. I won't give support on this workaround in this issue or in this repository. If you need some help, join our Discord or use the spyglass issue tracker. This should only be treated as a workaround and not as a final solution. We do not recommend to use a Pi5! |
This is a +1 from me with the same issue now.I only have a pi5 available which is why I'm trying to use it. Would this feature request more accurately be described as using an H.265 codec method for streaming for Pi5's? FYI Spyglass isn't a workaround for me, as last time I tried it, this wouldn't stream to Obico which is the main reason I use a webcam. My logs are the same... LOGS
|
If you read the log, you would understand, why you have the same problem. There is no reason why Spyglass shouldn't work with Obico. Crowsnest (ustreamer/camera-streamer) do nothing special compared to Spyglass. (I already wrote, how to get help for Spyglass but it's more like a Obico topic)
There is no intention from us to use H265 encoding, and we are not aware of any backend that is able to do this easily with the Pi5 encoder, but we didn't really search for it. H265 isn't available in some browsers by default, therefore that's no solution we will consider atm. Our solution will be Spyglass, as we will add it with the next big version update, that has no current ETA, for multiple reasons. |
This comment was marked as spam.
This comment was marked as spam.
Good that you found something that already supports H265 encoding and that works for you, but the rest of your message is just intentionally upsetting right? Please read everything, if you want to understand the background of this whole thing.
You didn't read all the messages, did you? You just picked one thing out of this whole thread. The FR is support for pi cams on the Pi5. The current workaround that I shared, will be the future implementation, but there are other things that have to be done first. There is only no intention for H265 support (See the last paragraph). If you got a backend that supports it, you can share it if you want, and I can take a look at it. Otherwise there will be only Spyglass with MJPG and WebRTC (only H264 planned atm) support.
The Mainsail Crew is just some loosely group of people that are helping meteyou with development of different projects around Mainsail for the Klipper project. Mete, and we others, don't get money and do this in our free time. It's sad to see that people think we are obligated to get everything done, as fast as some company, with multiple devs behind each project, even if we are mostly one dev for one project. We are happy if people like our work, but sometimes messages like yours are really getting on someone nerves. You don't have to like our work, but you also don't have to complain about it, especially if you found a better alternative for yourself, and don't even want to share it with others.
When were we not helpful? We give support on different plattforms (one of the things consuming my time, so you can help out, if I should invest more time into Crowsnest 😉). I even provided a workaround that I can personally support, instead of sharing other peoples projects and sending all the support to them, and therefore "stealing" their time. (The following paragraph might be wrong at some points, have a look at the edit below it) edit: Seems like I might have been a bit misinformed, and it's supported for quite some time. That page is not nearly an indicator for the things that are supported, as those tests seem to be for native HTML5 only(?). So we will look into it ofc. |
I edited now the title, that people understand what's the feature behind this FR |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as spam.
This comment was marked as spam.
@rykerg9 Then a short version of that book: |
Just to clarify, my “+1” was to confirm I knew I encountered the same issue and wanted to understand a little more about the situation to decide if I source a pi4, or continue to invest time with spyglass or wait, exactly what you have given me @mryel00, thank you. As it turns out, I’ve managed to get spyglass working and using Obico with a little more effort (I could already get it streaming fine to mainsail) I have done this with a 32bit OS as I’ve found comments that 64bit didn’t work (which I too have yet to get working). For anyone else interested… my setup is (what I had available from other projects): Clean install of OS 32bit |
Can you link me what you mean with that guide? |
More detailed workaround steps. I've NOW got it working on x64 with Spyglass and Obico. Install the CameraInstall Klipper, Moonraker, Mainsail, Obico for Moonraker via KUAIH: Install the CameraUsing whichever camera guide you have. My Arducam 16mp AF was here: Spyglass setup guide:https://github.com/roamingthings/spyglass
Modify spyglass.confThis can be to your preferences, or may need to set specific Resolution compatible with your camera. Setup the Webcam in Mainsail UIURL Steam: Install JanusThis doesn't seem to be included in Spyglass and is needed for Obico to stream.
Modify moonraker-obico.cfgunder the webcam section make sure these two entries are there.
Troubleshooting:
|
I read again my previous longer explanation and wanted to clarify it as a separate comment, might be interesting for @rykerg9 too: Also I added WebRTC to Spyglass, but it's still experimental, as I have to do some testing on it. The CPU usage on the Pi5 is quite high and therefore it shouldn't be used with it, or at least only with caution: mryel00/spyglass#84 |
Thank you for this guide. This should be pinned for guys with pi5s |
I disagree on that. First of all, these are the issues of Crowsnest, not some tutorial hub for workarounds for workarounds. I sadly cannot even pin single comments. Also please don't reference whole comments. Imagine if I would have referenced your whole comment too, then we would have pasted a really long tutorial three times into this conversation. I started to read through the mail and didn't even realize that this comment were just two sentences and I wondered who posted another tutorial here. You were not the first one and won't be the last one, but if someone references such a long comment, it makes readability in an issue go down dramatically. |
What happened
When attempting to add in a ov5647 camera on mainsail, there is consistently a no-signal when adding via the mainsail UI. Tested the camera module via CLI and was able to receive pictures.
What did you expect to happen
Normally when I have done this in the past (including with this camera module on a Pi4) it would pick up the picam with no intervention on my end.
How to reproduce
Fresh Pi5 install, via KIAUH, plug in camera.
Additional information
[02/08/24 19:18:27] crowsnest: crowsnest - A webcam Service for multiple Cams and Stream Services.
[02/08/24 19:18:27] crowsnest: Version: v4.1.3-1-gc0c9c41
[02/08/24 19:18:27] crowsnest: Prepare Startup ...
[02/08/24 19:18:27] crowsnest: INFO: Host information:
[02/08/24 19:18:27] crowsnest: Host Info: Distribution: Debian GNU/Linux 12 (bookworm)
[02/08/24 19:18:27] crowsnest: Host Info: Kernel: Linux 6.1.0-rpi7-rpi-2712 aarch64
[02/08/24 19:18:27] crowsnest: Host Info: Model: Raspberry Pi 5 Model B Rev 1.0
[02/08/24 19:18:27] crowsnest: Host Info: Available CPU Cores: 4
[02/08/24 19:18:27] crowsnest: Host Info: Available Memory: 4143600 kB
[02/08/24 19:18:27] crowsnest: Host Info: Diskspace (avail. / total): 18G / 29G
[02/08/24 19:18:27] crowsnest: INFO: Checking Dependencies
[02/08/24 19:18:27] crowsnest: Dependency: 'crudini' found in /usr/bin/crudini.
[02/08/24 19:18:27] crowsnest: Dependency: 'find' found in /usr/bin/find.
[02/08/24 19:18:27] crowsnest: Dependency: 'xargs' found in /usr/bin/xargs.
[02/08/24 19:18:27] crowsnest: Dependency: 'ustreamer' found in bin/ustreamer/ustreamer.
[02/08/24 19:18:27] crowsnest: Version Control: ustreamer new version available: b578e98 (v5.49).
[02/08/24 19:18:27] crowsnest: INFO: Print Configfile: '/home/david/printer_data/config/crowsnest.conf'
[02/08/24 19:18:27] crowsnest: [crowsnest]
[02/08/24 19:18:27] crowsnest: log_path: /home/david/printer_data/logs/crowsnest.log
[02/08/24 19:18:27] crowsnest: log_level: verbose
[02/08/24 19:18:27] crowsnest: delete_log: true
[02/08/24 19:18:27] crowsnest: no_proxy: false
[02/08/24 19:18:27] crowsnest:
[02/08/24 19:18:27] crowsnest: [cam 1]
[02/08/24 19:18:27] crowsnest: mode: ustreamer
[02/08/24 19:18:27] crowsnest:
[02/08/24 19:18:27] crowsnest: enable_rtsp: false
[02/08/24 19:18:27] crowsnest: rtsp_port: 8554
[02/08/24 19:18:27] crowsnest: port: 8080
[02/08/24 19:18:27] crowsnest: device: /dev/video0
[02/08/24 19:18:27] crowsnest: resolution: 640x480
[02/08/24 19:18:27] crowsnest: max_fps: 15
[02/08/24 19:18:27] crowsnest: INFO: Detect available Devices
[02/08/24 19:18:27] crowsnest: INFO: Found 1 total available Device(s)
[02/08/24 19:18:27] crowsnest: ================================================================
[02/08/24 19:18:27] crowsnest: WARN: 'libcamera' devices are currently not supported on Pi 5!
[02/08/24 19:18:27] crowsnest: ================================================================
[02/08/24 19:18:27] crowsnest: Detected 'libcamera' device -> /base/axi/pcie@120000/rp1/i2c@80000/ov5647@36
[02/08/24 19:18:27] crowsnest: Try to start configured Cams / Services...
[02/08/24 19:18:27] crowsnest: INFO: Configuration of Section [cam 1] looks good. Continue ...
[02/08/24 19:18:28] crowsnest: V4L2 Control: No parameters set for [cam 1]. Skipped.
[02/08/24 19:18:28] crowsnest: Starting ustreamer with Device /dev/video0 ...
[02/08/24 19:18:30] crowsnest: ... Done!
The text was updated successfully, but these errors were encountered: