Open NV4RE opened 1 year ago
Possible related to https://github.com/mainsail-crew/crowsnest/issues/109
@NV4RE It's not related to the issue you mentioned. The issue you mentioned is about connection problems with a cb1. Your issue is just about crowsnest.log not showing the second identical camera. Crowsnest currently only shows the entry of /dev/v4l/by-id/
. The problem about two identical cams is, that it only shows one of them there. So please follow the documentation on using two identical cameras.
So this isn't a bug, but more like a "missing" feature that doesn't have that much priority as the amount of users with two identical cams are pretty low. If you use two unidentical USB cams, you will see that both should get printed inside the log.
I updated this issue to represent a feature request. Fyi this feature is internally already under development.
@NV4RE I need some information for this issue to tackle it correctly.
I need the output of following url http://<ip.of.your.pi>:<moonraker_port>/machine/peripherals/video
. <moonraker_port
is by default 7125
and can be seen inside your moonraker.conf
. If that url doesn't work, make sure you are on the latest moonraker version.
@NV4RE I need some information for this issue to tackle it correctly. I need the output of following url
http://<ip.of.your.pi>:<moonraker_port>/machine/peripherals/video
.<moonraker_port
is by default7125
and can be seen inside yourmoonraker.conf
. If that url doesn't work, make sure you are on the latest moonraker version.
Hi, thanks for the follow-up. I apologize that I can't be of more help in testing the fix right now. I actually removed all the webcams from the machine a while back, so I can't send you the output or confirm whether the issue is resolved.
However, I wanted to provide some additional information that might be helpful. Since the last time I interacted with this issue, I tried using multiple webcams with the machine, but from different models and brands. Unfortunately, the problem persisted regardless of the webcams used. This leads me to believe that the root cause might be related to the bandwidth limitations of the BTT Manta M8P's USB chip. It's possible it doesn't have enough capacity to handle multiple webcams efficiently.
Ok, then I now understand why you mentioned #109. You are completely correct and the CB1 and CM4 are not capable of multiple cameras, as they only got one USB 2.0 interface. But the detection of the cams should work regardless. So you have here two different issues at once.
I will focus in this issue on 1 as 2 got it's own issue. If you still have those 2 identical cams lying around, I would highly appreciate, if you could connect them shortly and get me the output. They don't have to run inside Crowsnest or similar, they just need to be connected to the USB ports.
@NV4RE I need some information for this issue to tackle it correctly. I need the output of following url
http://<ip.of.your.pi>:<moonraker_port>/machine/peripherals/video
.<moonraker_port
is by default7125
and can be seen inside yourmoonraker.conf
. If that url doesn't work, make sure you are on the latest moonraker version.
Hello, I've reinstalled the webcam, but the problem persists. Here's the output of /machine/peripherals/video
{
"result": {
"v4l2_devices": [
{
"device_name": "video0",
"device_path": "/dev/video0",
"camera_name": "1080P Webcam: 1080P Webcam",
"driver_name": "uvcvideo",
"hardware_bus": "usb-5200000.usb-1.1.2",
"capabilities": ["VIDEO_CAPTURE", "EXT_PIX_FORMAT", "STREAMING"],
"version": "5.16.17",
"path_by_hardware": "/dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.2:1.0-video-index0",
"path_by_id": null,
"alt_name": "1080P Webcam: 1080P Webcam",
"usb_location": "2:5",
"modes": [
{
"format": "MJPG",
"description": "Motion-JPEG",
"flags": ["COMPRESSED"],
"resolutions": [
"640x480",
"1920x1080",
"1280x720",
"320x240",
"1024x768",
"1280x1024",
"160x120",
"800x600"
]
},
{
"format": "YUYV",
"description": "YUYV 4:2:2",
"flags": [],
"resolutions": [
"640x480",
"1920x1080",
"1280x720",
"320x240",
"1024x768",
"1280x1024",
"160x120",
"800x600"
]
}
]
},
{
"device_name": "video2",
"device_path": "/dev/video2",
"camera_name": "1080P Webcam: 1080P Webcam",
"driver_name": "uvcvideo",
"hardware_bus": "usb-5200000.usb-1.1.4",
"capabilities": ["VIDEO_CAPTURE", "EXT_PIX_FORMAT", "STREAMING"],
"version": "5.16.17",
"path_by_hardware": "/dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.4:1.0-video-index0",
"path_by_id": "/dev/v4l/by-id/usb-SJ-180517-N_1080P_Webcam-video-index0",
"alt_name": "1080P Webcam: 1080P Webcam",
"usb_location": "2:16",
"modes": [
{
"format": "MJPG",
"description": "Motion-JPEG",
"flags": ["COMPRESSED"],
"resolutions": [
"640x480",
"1920x1080",
"1280x720",
"320x240",
"1024x768",
"1280x1024",
"160x120",
"800x600"
]
},
{
"format": "YUYV",
"description": "YUYV 4:2:2",
"flags": [],
"resolutions": [
"640x480",
"1920x1080",
"1280x720",
"320x240",
"1024x768",
"1280x1024",
"160x120",
"800x600"
]
}
]
}
],
"libcamera_devices": []
}
}
crownest.conf
#### crowsnest.conf
#### This is a typical default config.
#### Also used as default in mainsail / MainsailOS
#### See:
#### https://github.com/mainsail-crew/crowsnest/blob/master/README.md
#### for details to configure to your needs.
#####################################################################
#### #####
#### Information about ports and according URL's #####
#### #####
#####################################################################
#### #####
#### Port 8080 equals /webcam/?action=[stream/snapshot] #####
#### Port 8081 equals /webcam2/?action=[stream/snapshot] #####
#### Port 8082 equals /webcam3/?action=[stream/snapshot] #####
#### Port 8083 equals /webcam4/?action=[stream/snapshot] #####
#### #####
#####################################################################
#### RTSP Stream URL: ( if enabled and supported ) #####
#### rtsp://<ip>:<rtsp_port>/stream.h264 #####
#####################################################################
[crowsnest]
log_path: /home/biqu/printer_data/logs/crowsnest.log
log_level: verbose # Valid Options are quiet/verbose/debug
delete_log: false # Deletes log on every restart, if set to true
no_proxy: false
# top
# [cam top]
# mode: ustreamer # ustreamer - Provides mjpg and snapshots. (All devices)
# # camera-streamer - Provides webrtc, mjpg and snapshots. (rpi + Raspi OS based only)
# enable_rtsp: false # If camera-streamer is used, this enables also usage of an rtsp server
# rtsp_port: 8554 # Set different ports for each device!
# port: 8080 # HTTP/MJPG Stream/Snapshot Port
# device: /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.3:1.0-video-index0 # See Log for available ...
# resolution: 1280x1024 # widthxheight format
# max_fps: 6 # If Hardware Supports this it will be forced, otherwise ignored/coerced.
# #custom_flags: # You can run the Stream Services with custom flags.
# #v4l2ctl: # Add v4l2-ctl parameters to setup your camera, see Log what your cam is capable of.
# v4l2ctl: pixelformat=YUYV,saturation=75,hue=0,auto_exposure=1,exposure_time_absolute=350,brightness=2,contrast=1,white_balance_automatic=0,white_balance_temperature=4200
[cam rear]
mode: ustreamer
enable_rtsp: false
rtsp_port: 8555
port: 8081
device: /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.2:1.0-video-index0
resolution: 640x480
max_fps: 25
v4l2ctl: pixelformat=YUYV,saturation=75,hue=-1800,auto_exposure=1,exposure_time_absolute=350,brightness=-6,contrast=1,white_balance_automatic=0,white_balance_temperature=4200,backlight_compensation=3,sharpness=1
[cam test]
mode: ustreamer
enable_rtsp: false
rtsp_port: 8555
port: 8080
device: /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.4:1.0-video-index0
resolution: 640x480
max_fps: 25
v4l2ctl: pixelformat=YUYV,saturation=75,hue=-1800,auto_exposure=1,exposure_time_absolute=350,brightness=-6,contrast=1,white_balance_automatic=0,white_balance_temperature=4200,backlight_compensation=3,sharpness=1
crowsnest.log
[04/06/24 23:42:48] crowsnest: crowsnest - A webcam Service for multiple Cams and Stream Services.
[04/06/24 23:42:48] crowsnest: Version: v4.1.8-1-g6ac4711
[04/06/24 23:42:48] crowsnest: Prepare Startup ...
[04/06/24 23:42:48] crowsnest: INFO: Host information:
[04/06/24 23:42:48] crowsnest: Host Info: Distribution: BTT-CB1 2.3.3 Bullseye
[04/06/24 23:42:48] crowsnest: Host Info: Kernel: Linux 5.16.17-sun50iw9 aarch64
[04/06/24 23:42:48] crowsnest: Host Info: Available CPU Cores: 4
[04/06/24 23:42:48] crowsnest: Host Info: Available Memory: 1010636 kB
[04/06/24 23:42:48] crowsnest: Host Info: Diskspace (avail. / total): 49G / 59G
[04/06/24 23:42:48] crowsnest: INFO: Checking Dependencies
[04/06/24 23:42:48] crowsnest: Dependency: 'crudini' found in /usr/bin/crudini.
[04/06/24 23:42:48] crowsnest: Dependency: 'find' found in /usr/bin/find.
[04/06/24 23:42:48] crowsnest: Dependency: 'xargs' found in /usr/bin/xargs.
[04/06/24 23:42:48] crowsnest: Dependency: 'ustreamer' found in bin/ustreamer/src/ustreamer.bin.
[04/06/24 23:42:49] crowsnest: Version Control: ustreamer is up to date. (v5.41)
[04/06/24 23:42:49] crowsnest: INFO: Print Configfile: '/home/biqu/printer_data/config/crowsnest.conf'
[04/06/24 23:42:49] crowsnest: [crowsnest]
[04/06/24 23:42:49] crowsnest: log_path: /home/biqu/printer_data/logs/crowsnest.log
[04/06/24 23:42:49] crowsnest: log_level: verbose
[04/06/24 23:42:49] crowsnest: delete_log: false
[04/06/24 23:42:49] crowsnest: no_proxy: false
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: [cam rear]
[04/06/24 23:42:49] crowsnest: mode: ustreamer
[04/06/24 23:42:49] crowsnest: enable_rtsp: false
[04/06/24 23:42:49] crowsnest: rtsp_port: 8555
[04/06/24 23:42:49] crowsnest: port: 8081
[04/06/24 23:42:49] crowsnest: device: /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.2:1.0-video-index0
[04/06/24 23:42:49] crowsnest: resolution: 640x480
[04/06/24 23:42:49] crowsnest: max_fps: 25
[04/06/24 23:42:49] crowsnest: v4l2ctl: pixelformat=YUYV,saturation=75,hue=-1800,auto_exposure=1,exposure_time_absolute=350,brightness=-6,contrast=1,white_balance_automatic=0,white_balance_temperature=4200,backlight_compensation=3,sharpness=1
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: [cam test]
[04/06/24 23:42:49] crowsnest: mode: ustreamer
[04/06/24 23:42:49] crowsnest: enable_rtsp: false
[04/06/24 23:42:49] crowsnest: rtsp_port: 8555
[04/06/24 23:42:49] crowsnest: port: 8080
[04/06/24 23:42:49] crowsnest: device: /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.4:1.0-video-index0
[04/06/24 23:42:49] crowsnest: resolution: 640x480
[04/06/24 23:42:49] crowsnest: max_fps: 25
[04/06/24 23:42:49] crowsnest: v4l2ctl: pixelformat=YUYV,saturation=75,hue=-1800,auto_exposure=1,exposure_time_absolute=350,brightness=-6,contrast=1,white_balance_automatic=0,white_balance_temperature=4200,backlight_compensation=3,sharpness=1
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: INFO: Detect available Devices
[04/06/24 23:42:49] crowsnest: INFO: Found 1 total available Device(s)
[04/06/24 23:42:49] crowsnest: INFO: Found 1 available v4l2 (UVC) camera(s)
[04/06/24 23:42:49] crowsnest: /dev/v4l/by-id/usb-SJ-180517-N_1080P_Webcam-video-index0 -> /dev/video2
[04/06/24 23:42:49] crowsnest: Supported Formats:
[04/06/24 23:42:49] crowsnest: [0]: 'MJPG' (Motion-JPEG, compressed)
[04/06/24 23:42:49] crowsnest: Size: Discrete 640x480
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1920x1080
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1280x720
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 320x240
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1024x768
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1280x1024
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 160x120
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 800x600
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: [1]: 'YUYV' (YUYV 4:2:2)
[04/06/24 23:42:49] crowsnest: Size: Discrete 640x480
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1920x1080
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.200s (5.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1280x720
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.167s (6.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 320x240
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1024x768
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.167s (6.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 1280x1024
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.167s (6.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 160x120
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.040s (25.000 fps)
[04/06/24 23:42:49] crowsnest: Size: Discrete 800x600
[04/06/24 23:42:49] crowsnest: Interval: Discrete 0.167s (6.000 fps)
[04/06/24 23:42:49] crowsnest: Supported Controls:
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: User Controls
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=-6
[04/06/24 23:42:49] crowsnest: contrast 0x00980901 (int) : min=0 max=95 step=1 default=0 value=1
[04/06/24 23:42:49] crowsnest: saturation 0x00980902 (int) : min=0 max=100 step=1 default=58 value=75
[04/06/24 23:42:49] crowsnest: hue 0x00980903 (int) : min=-2000 max=2000 step=100 default=0 value=-1800
[04/06/24 23:42:49] crowsnest: white_balance_automatic 0x0098090c (bool) : default=1 value=0
[04/06/24 23:42:49] crowsnest: gamma 0x00980910 (int) : min=100 max=300 step=1 default=100 value=100
[04/06/24 23:42:49] crowsnest: power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=1
[04/06/24 23:42:49] crowsnest: 0: Disabled
[04/06/24 23:42:49] crowsnest: 1: 50 Hz
[04/06/24 23:42:49] crowsnest: 2: 60 Hz
[04/06/24 23:42:49] crowsnest: white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=1 default=4600 value=4200
[04/06/24 23:42:49] crowsnest: sharpness 0x0098091b (int) : min=1 max=7 step=1 default=2 value=1
[04/06/24 23:42:49] crowsnest: backlight_compensation 0x0098091c (int) : min=0 max=3 step=1 default=0 value=3
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: Camera Controls
[04/06/24 23:42:49] crowsnest:
[04/06/24 23:42:49] crowsnest: auto_exposure 0x009a0901 (menu) : min=0 max=3 default=3 value=1
[04/06/24 23:42:49] crowsnest: 1: Manual Mode
[04/06/24 23:42:49] crowsnest: 3: Aperture Priority Mode
[04/06/24 23:42:49] crowsnest: exposure_time_absolute 0x009a0902 (int) : min=78 max=10000 step=1 default=312 value=350
[04/06/24 23:42:49] crowsnest: Try to start configured Cams / Services...
[04/06/24 23:42:52] crowsnest: INFO: Configuration of Section [cam rear] looks good. Continue ...
[04/06/24 23:42:55] crowsnest: INFO: Configuration of Section [cam test] looks good. Continue ...
[04/06/24 23:42:56] crowsnest: V4L2 Control: Device: [cam rear]
[04/06/24 23:42:56] crowsnest: V4L2 Control: Options: pixelformat=YUYV,saturation=75,hue=-1800,auto_exposure=1,exposure_time_absolute=350,brightness=-6,contrast=1,white_balance_automatic=0,white_balance_temperature=4200,backlight_compensation=3,sharpness=1
[04/06/24 23:42:56] crowsnest: V4L2 Control: Parameter 'pixelformat=YUYV' not available for '/dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.2:1.0-video-index0'. Skipped.
[04/06/24 23:42:57] crowsnest: V4L2 Control: Device: [cam test]
[04/06/24 23:42:57] crowsnest: V4L2 Control: Options: pixelformat=YUYV,saturation=75,hue=-1800,auto_exposure=1,exposure_time_absolute=350,brightness=-6,contrast=1,white_balance_automatic=0,white_balance_temperature=4200,backlight_compensation=3,sharpness=1
[04/06/24 23:42:57] crowsnest: V4L2 Control: Parameter 'pixelformat=YUYV' not available for '/dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.4:1.0-video-index0'. Skipped.
[04/06/24 23:43:02] crowsnest: Starting ustreamer with Device /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.4:1.0-video-index0 ...
[04/06/24 23:43:02] crowsnest: Starting ustreamer with Device /dev/v4l/by-path/platform-5200000.usb-usb-0:1.1.2:1.0-video-index0 ...
[04/06/24 23:43:05] crowsnest: ... Done!
Thanks for the output. I still didn't implement anything for this. I needed the output to even have a starting point.
I'm facing something similar. I tried using the by-path
, as per https://crowsnest.mainsail.xyz/faq/how-to-use-identical-usb-cam-models-twice, but after editing (via Mainsail, verifying over SSH the changes were saved), and reboot, the crowsnest.conf
is reset to using /dev/videoN
for my cameras. NOT the by-path
. It's super weird, it just automatically resets it.
Although I notice above the bandwidth issue...which I think will be an issue for me as well. Thinking I might need to use an external RPi, but any way I can have crowsnest reference an external source of the video, rather than direct attach USB cameras? Or should I just redo everything, put Mainsail/etc on an RPi or other similar, and use CB1+Manta M8P with the base Klipper/moonraker?
@Drizzt321 Please stay on the Discord as I'm the person helping here and on the server. Your issue is different. Here is no place for support, it's just there to identify an issue with the code and not with your setup.
And you know it's a different issue, if you right: "It's a similar issue, BUT...."
What happened
When adding multiple cameras (both on the same model), only one detects
crowsnest only detect one camera
Hardware
software
lsusb
v4l2-ctl --list-devices
crowsnest.conf
crowsnest.log
What did you expect to happen
Detect both camera
How to reproduce
Just use multiple camera
Additional information
No response