mainsail-crew / crowsnest

Webcam Service for multiple Cams
GNU General Public License v3.0
324 stars 77 forks source link

Calling blockyfix unconditionally breaks camera without support of certain v4l2ctl parameters #107

Closed RayYHan closed 1 year ago

RayYHan commented 1 year ago

What happened

Webcam show blank display

What did you expect to happen

Webcam shows video feed

How to reproduce

Connect a Microsoft LifeCam NX-6000 to the sbc running crowsnest

Additional information

Log shows crowsnest dies with error ERROR: Error 1 occured on line 150. Further check shows the line 150 is of libs/v4l2_control.sh. The line is part of the blockyfix function, which is introduced to fix an issue with raspcam, https://github.com/mainsail-crew/crowsnest/issues/33. The function is called unconditionally from crowsnest even though the fix is only intended for raspcams. This would break cameras without support for the parameter the function sets. The webcam becomes functional after blockyfix is commented out.

Log:

[04/16/23 05:45:53] crowsnest: crowsnest - A webcam Service for multiple Cams and Stream Services.
[04/16/23 05:45:53] crowsnest: Version: v3.0.7-3-g20ed6a8
[04/16/23 05:45:53] crowsnest: Prepare Startup ...
[04/16/23 05:45:53] crowsnest: INFO: Host information:
[04/16/23 05:45:54] crowsnest: Host Info: Distribution: Raspbian GNU/Linux 11 (bullseye)
[04/16/23 05:45:54] crowsnest: Host Info: Release: MainsailOS release 1.1.1 (bullseye)
[04/16/23 05:45:54] crowsnest: Host Info: Kernel: Linux 6.1.19-v7+ armv7l
[04/16/23 05:45:54] crowsnest: Host Info: Model: Raspberry Pi 2 Model B Rev 1.1
[04/16/23 05:45:54] crowsnest: Host Info: Available CPU Cores: 4
[04/16/23 05:45:54] crowsnest: Host Info: Available Memory: 761404 kB
[04/16/23 05:45:54] crowsnest: Host Info: Diskspace (avail. / total): 221G / 235G
[04/16/23 05:45:54] crowsnest: INFO: Checking Dependencys
[04/16/23 05:45:54] crowsnest: Dependency: 'crudini' found in /usr/bin/crudini.
[04/16/23 05:45:54] crowsnest: Dependency: 'find' found in /usr/bin/find.
[04/16/23 05:45:54] crowsnest: Dependency: 'logger' found in /usr/bin/logger.
[04/16/23 05:45:54] crowsnest: Dependency: 'xargs' found in /usr/bin/xargs.
[04/16/23 05:45:54] crowsnest: Dependency: 'ffmpeg' found in /usr/bin/ffmpeg.
[04/16/23 05:45:54] crowsnest: Dependency: 'ustreamer' found in bin/ustreamer/ustreamer.
[04/16/23 05:45:54] crowsnest: Dependency: 'rtsp-simple-server' found in bin/rtsp-simple-server/rtsp-simple-server.
[04/16/23 05:45:54] crowsnest: Version Control: ustreamer is up to date. (v5.38)
[04/16/23 05:45:55] crowsnest: Version Control: rtsp-simple-server is up to date. (v0.20.2)
[04/16/23 05:45:56] crowsnest: Version Control: ffmpeg is up to date. (4.3.5-0+deb11u1+rpt3)
[04/16/23 05:45:56] crowsnest: INFO: Print Configfile: '/home/pi/printer_data/config/crowsnest.conf'
[04/16/23 05:45:56] crowsnest:      v
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      [crowsnest]
[04/16/23 05:45:56] crowsnest:      log_path: ~/printer_data/logs/crowsnest.log
[04/16/23 05:45:56] crowsnest:      log_level: verbose
[04/16/23 05:45:56] crowsnest:      delete_log: false
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      [1]
[04/16/23 05:45:56] crowsnest:      mode: mjpg
[04/16/23 05:45:56] crowsnest:      port: 8080
[04/16/23 05:45:56] crowsnest:      device: /dev/video0
[04/16/23 05:45:56] crowsnest:      resolution: 640x480
[04/16/23 05:45:56] crowsnest:      max_fps: 30
[04/16/23 05:45:57] crowsnest: INFO: Detect available Devices
[04/16/23 05:45:57] crowsnest: INFO: Found 1 total available Device(s)
[04/16/23 05:45:57] crowsnest: INFO: Found 1 available camera(s)
[04/16/23 05:45:57] crowsnest: /dev/v4l/by-id/usb-Microsoft_Microsoft®_LifeCam_NX-6000-video-index0 -> /dev/video0
[04/16/23 05:45:57] crowsnest: Supported Formats:
[04/16/23 05:45:57] crowsnest:      [0]: 'MJPG' (Motion-JPEG, compressed)
[04/16/23 05:45:57] crowsnest:      Size: Discrete 352x288
[04/16/23 05:45:57] crowsnest:      Interval: Discrete 0.033s (30.000 fps)
[04/16/23 05:45:57] crowsnest:      Size: Discrete 1600x1200
[04/16/23 05:45:57] crowsnest:      Interval: Discrete 0.133s (7.500 fps)
[04/16/23 05:45:57] crowsnest:      Size: Discrete 1280x1024
[04/16/23 05:45:57] crowsnest:      Interval: Discrete 0.133s (7.500 fps)
[04/16/23 05:45:57] crowsnest:      Size: Discrete 1024x768
[04/16/23 05:45:57] crowsnest:      Interval: Discrete 0.133s (7.500 fps)
[04/16/23 05:45:57] crowsnest:      Size: Discrete 800x600
[04/16/23 05:45:58] crowsnest:      Interval: Discrete 0.033s (30.000 fps)
[04/16/23 05:45:58] crowsnest:      Size: Discrete 640x480
[04/16/23 05:45:58] crowsnest:      Interval: Discrete 0.033s (30.000 fps)
[04/16/23 05:45:58] crowsnest:      Size: Discrete 320x240
[04/16/23 05:45:58] crowsnest:      Interval: Discrete 0.033s (30.000 fps)
[04/16/23 05:45:58] crowsnest:      Size: Discrete 176x144
[04/16/23 05:45:58] crowsnest:      Interval: Discrete 0.033s (30.000 fps)
[04/16/23 05:45:58] crowsnest:      Size: Discrete 160x120
[04/16/23 05:45:58] crowsnest:      Interval: Discrete 0.033s (30.000 fps)
[04/16/23 05:45:58] crowsnest: Supported Controls:
[04/16/23 05:45:58] crowsnest:      
[04/16/23 05:45:58] crowsnest:      User Controls
[04/16/23 05:45:58] crowsnest:      
[04/16/23 05:45:58] crowsnest:      brightness 0x00980900 (int) : min=0 max=160 step=1 default=128 value=128
[04/16/23 05:45:58] crowsnest:      contrast 0x00980901 (int) : min=5 max=50 step=1 default=43 value=43
[04/16/23 05:45:58] crowsnest:      saturation 0x00980902 (int) : min=0 max=150 step=1 default=48 value=48
[04/16/23 05:45:58] crowsnest:      hue 0x00980903 (int) : min=-127 max=127 step=1 default=0 value=0
[04/16/23 05:45:58] crowsnest:      white_balance_automatic 0x0098090c (bool) : default=1 value=1
[04/16/23 05:45:58] crowsnest:      gamma 0x00980910 (int) : min=1 max=5 step=1 default=3 value=3
[04/16/23 05:45:58] crowsnest:      power_line_frequency 0x00980918 (menu) : min=0 max=2 default=2 value=2
[04/16/23 05:45:58] crowsnest:      0: Disabled
[04/16/23 05:45:58] crowsnest:      1: 50 Hz
[04/16/23 05:45:58] crowsnest:      2: 60 Hz
[04/16/23 05:45:58] crowsnest:      white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=10 default=4600 value=4600 flags=inactive
[04/16/23 05:45:59] crowsnest:      sharpness 0x0098091b (int) : min=0 max=160 step=1 default=13 value=13
[04/16/23 05:45:59] crowsnest:      backlight_compensation 0x0098091c (int) : min=0 max=4 step=1 default=3 value=3
[04/16/23 05:45:59] crowsnest:      
[04/16/23 05:45:59] crowsnest:      Camera Controls
[04/16/23 05:45:59] crowsnest:      
[04/16/23 05:45:59] crowsnest:      pan_absolute 0x009a0908 (int) : min=-36000 max=36000 step=3600 default=0 value=0
[04/16/23 05:45:59] crowsnest:      tilt_absolute 0x009a0909 (int) : min=-36000 max=36000 step=3600 default=0 value=0
[04/16/23 05:45:59] crowsnest:      zoom_absolute 0x009a090d (int) : min=0 max=10 step=1 default=0 value=0
[04/16/23 05:45:59] crowsnest: INFO: No usable CSI Devices found.
[04/16/23 05:46:01] crowsnest: V4L2 Control: No parameters set for [cam DEFAULT]. Skipped.
[04/16/23 05:46:02] crowsnest: V4L2 Control: No parameters set for [cam 1]. Skipped.
[04/16/23 05:46:03] crowsnest: ERROR: Error 1 occured on line 150
[04/16/23 05:46:03] crowsnest: ERROR: Stopping crowsnest.
[04/16/23 05:46:04] crowsnest: Goodbye...
github-actions[bot] commented 1 year ago

Ahoi!

It looks like this ticket is a request for help (or similar). Many helpful people will not see your message here and you are unlikely to get a useful response.

We use github to handle bugreports, feature requests and planning new releases.

Please use our Discord-Server for help: discord.gg/mainsail

This ticket will be automatically closed.

Fair wind and a following sea! ~ Your friendly MainsailGithubBot

PS: I'm just an automated script, not a real sailor.

KwadFan commented 1 year ago

Simply nope!

[04/16/23 05:45:56] crowsnest: INFO: Print Configfile: '/home/pi/printer_data/config/crowsnest.conf'
[04/16/23 05:45:56] crowsnest:      v
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      [crowsnest]
[04/16/23 05:45:56] crowsnest:      log_path: ~/printer_data/logs/crowsnest.log
[04/16/23 05:45:56] crowsnest:      log_level: verbose
[04/16/23 05:45:56] crowsnest:      delete_log: false
[04/16/23 05:45:56] crowsnest:      
[04/16/23 05:45:56] crowsnest:      [1]
[04/16/23 05:45:56] crowsnest:      mode: mjpg
[04/16/23 05:45:56] crowsnest:      port: 8080
[04/16/23 05:45:56] crowsnest:      device: /dev/video0
[04/16/23 05:45:56] crowsnest:      resolution: 640x480
[04/16/23 05:45:56] crowsnest:      max_fps: 30

-> https://crowsnest.mainsail.xyz/configuration/cam-section

Regards Kwad