Webcam not working...

Hi there
I'm running Repetier-Server Pro 0.93.1 on a Raspberry Pi 4.  (image from the website...)
I'm using a USB Cam called Razer Kiyo which has worked fine on Octoprint (on same Raspberry Pi 4)
I seems no matter what I do, I cannot get any picture to show up...
Some details from the cmd-line:
root@Repetier-Server:/home/pi# lsusb
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 008: ID 1532:0e03 Razer USA, Ltd
Bus 001 Device 004: ID 2c99:0002
Bus 001 Device 007: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

I have tried to use several of the listed resolutions and frame-rates in the setup...

root@Repetier-Server:/home/pi# v4l2-ctl --list-formats-ext
ioctl: VIDIOC_ENUM_FMT
Type: Video Capture

[0]: 'YUYV' (YUYV 4:2:2)
Size: Discrete 864x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
[1]: 'MJPG' (Motion-JPEG, compressed)
Size: Discrete 1280x720
Interval: Discrete 0.017s (60.000 fps)
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 864x480
Interval: Discrete 0.033s (30.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
[2]: 'H264' (H.264, compressed)
Size: Discrete 1280x720
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Size: Discrete 640x360
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Size: Discrete 864x480
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)
Size: Discrete 1920x1080
Interval: Discrete 0.033s (30.000 fps)
Interval: Discrete 0.042s (24.000 fps)
Interval: Discrete 0.050s (20.000 fps)

Strangely this command reports no supported or detected cameras...
root@Repetier-Server:/home/pi# /usr/bin/vcgencmd get_camera
supported=0 detected=0

Seems like this works...?
root@Repetier-Server:/home/pi# mjpg_streamer -i "input_uvc.so" -o "output_http.so"
MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
 i: Using V4L2 device.: /dev/video0
 i: Desired Resolution: 640 x 480
 i: Frames Per Second.: -1
 i: Format............: JPEG
 i: TV-Norm...........: DEFAULT
 i: The specified resolution is unavailable, using: width 640 height 360 instead
UVCIOC_CTRL_ADD - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_ADD - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt (relative): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Pan/tilt Reset: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Focus (absolute): Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Mode: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at LED1 Frequency: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Disable video processing: Inappropriate ioctl for device (25)
UVCIOC_CTRL_MAP - Error at Raw bits per pixel: Inappropriate ioctl for device (25)
 o: www-folder-path......: disabled
 o: HTTP TCP port........: 8080
 o: HTTP Listen Address..: (null)
 o: username:password....: disabled
 o: commands.............: enabled
 i: select() timeout
 i: cleaning up resources allocated by input thread
^Csetting signal to stop
force cancellation of threads and cleanup resources
 o: cleaning up resources allocated by server thread #00
done

This is what I see in the messages log... when I try to restart the webcam server...  the resolution is strange... and it seems no matter that I put in the GUI, the desired resolution is always 0 x 0...

Dec 13 16:29:36 Repetier-Server MJPG-streamer [23130]: starting application
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23130]: enabling daemon mode
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: Using V4L2 device.: /dev/video0
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: Desired Resolution: 0 x 0
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: Frames Per Second.: 0
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: Format............: JPEG
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: TV-Norm...........: DEFAULT
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23132]: init_VideoIn failed
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23143]: starting application
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23143]: enabling daemon mode
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: MJPG Streamer Version: git rev: 501f6362c5afddcfb41055f97ae484252c85c912
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: Using V4L2 device.: /dev/video1
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: Desired Resolution: 0 x 0
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: Frames Per Second.: 0
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: Format............: YUYV
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: JPEG Quality......: 85
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: TV-Norm...........: DEFAULT
Dec 13 16:29:36 Repetier-Server MJPG-streamer [23145]: init_VideoIn failed

I have tried to download the latest server, recompile it "over the existing one"... but still no dice...

It's strange mostly because the cam worked fine with the Octoprint software... but I'm not sure if they use the same webcam server...
Is there anything else I can try?  
I might give a total reinstall a try, but I suspect it will result in the same issue...

Any help is welcome...

/Heino

Comments

  • OK a bit of update...
    I tried to re-image a new MicroSD card and reinstall everything...
    Same result pretty much...
    I have not recompiled the webcam server as with the previous installation...

    Here is what I get.. from the cmdline...

    Strangely it will not show anything here...
    root@Repetier-Server:/home/pi# v4l2-ctl --list-formats-ext
    Cannot open device /dev/video0, exiting.

    But it now shows one supported device, yet none detected which seems strange?

    root@Repetier-Server:/home/pi# /usr/bin/vcgencmd get_camera
    supported=1 detected=0

    In the messages log I see the resolutiuon has now been "fixed"...

    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3363]: starting application
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3363]: enabling daemon mode
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: MJPG Streamer Version: git rev: 821c330ea6bbb5fbed98d48e00aac156e923161b
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: Using V4L2 device.: /dev/video0
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: Desired Resolution: 640 x 360
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: Frames Per Second.: 30
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: Format............: JPEG
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: TV-Norm...........: DEFAULT
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: www-folder-path......: /usr/local/share/mjpg-streamer/www/
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: HTTP TCP port........: 8080
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: HTTP Listen Address..: (null)
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: username:password....: disabled
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: commands.............: enabled
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: starting input plugin /usr/local/lib/mjpg-streamer/input_uvc.so
    Dec 13 16:12:05 Repetier-Server MJPG-streamer [3365]: starting output plugin: /usr/local/lib/mjpg-streamer/output_http.so (ID: 00)


    Every time I restart the webcam server the camera inits... it has a light "halo" which turns off and on every time... so it has some kind of contact with the camera...

    Any other suggestions?
  • /usr/bin/vcgencmd get_camera
    is only for raspi webcam, so for usb webcam ignore what it detects.

    With our image you do not need to compile mjpg_streamer - we have included it with some automatic script to start it directly. In server webcam setup of printer you just select the webcam from list and assign it, which normally works. Port is 8080+ depending on number of webcams. Each gets a new port. Infos like resolution and framerate are all taken from our config file and can be changed in the same interface at the bottom. So please do not try your add mjpg_streamer solution on top - that will get conflicts with our autodetect/autostart scripts.

    Your last log looks like it started correctly. When you say light goes on/off it sounds like it is restarting webcam. So look in the log further down to see why it disabled it. One reason might be if linux disconnected usb to reduce power drops. Before I go to deep into this you should say if you added own solution on top and what the log says about exit reason for mjpg_streamer.
Sign In or Register to comment.