USB Webcam 4x Logitech HD270 won't work as expected

edited November 2022 in Repetier-Server
Hi,
I use a Fujitsu S740 with Celeron 4105 for my Prusa farm.
Before I switched from a Pi4 4GB I could map all cams over the usb-selection on the bottom of the webcam menu.
now.... I can only use the streams.



root       10179  0.2  0.3 390384 12572 ?        Sl   18:34   0:01 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video0 --fps 10 -q 85 -r 1280x960  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8080 -w /usr/local/share/mjpg-streamer/www -b
root       10203  0.0  0.3 309420 12408 ?        Sl   18:34   0:00 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video4 --fps 10 -q 85 -r 1280x960  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8081 -w /usr/local/share/mjpg-streamer/www -b
root       10227  0.0  0.3 309420 12572 ?        Sl   18:34   0:00 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video2 --fps 10 -q 85 -r 1280x960  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8082 -w /usr/local/share/mjpg-streamer/www -b
root       10251  0.0  0.3 309420 12340 ?        Sl   18:34   0:00 /usr/local/bin/mjpg_streamer -i /usr/local/lib/mjpg-streamer/input_uvc.so -d /dev/video6 --fps 10 -q 85 -r 1280x960  -o /usr/local/lib/mjpg-streamer/output_http.so -p 8083 -w /usr/local/share/mjpg-streamer/www -b
root       10722  0.0  0.0   6476  2236 pts/0    S+   18:47   0:00 grep --color=auto mjpg


the only functional stream is on 8080 all other streams are malfunctioning.

Where is my fault?

Comments

  • This is what I can see in the syslog.

    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: Using V4L2 device.: /dev/video2
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: Desired Resolution: 1280 x 960
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: Frames Per Second.: 10
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: Format............: JPEG
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: TV-Norm...........: DEFAULT
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: www-folder-path......: /usr/local/share/mjpg-streamer/www/
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: HTTP TCP port........: 8082
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: HTTP Listen Address..: (null)
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: username:password....: disabled
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: commands.............: enabled
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: starting input plugin /usr/local/lib/mjpg-streamer/input_uvc.so
    Nov 13 18:51:03 addapp20 MJPG-streamer [10896]: starting output plugin: /usr/local/lib/mjpg-streamer/output_http.so (ID: 00)
    Nov 13 18:51:03 addapp20 MJPG-streamer [10918]: starting application
    Nov 13 18:51:03 addapp20 MJPG-streamer [10918]: enabling daemon mode
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: Using V4L2 device.: /dev/video6
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: Desired Resolution: 1280 x 960
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: Frames Per Second.: 10
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: Format............: JPEG
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: TV-Norm...........: DEFAULT
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: www-folder-path......: /usr/local/share/mjpg-streamer/www/
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: HTTP TCP port........: 8083
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: HTTP Listen Address..: (null)
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: username:password....: disabled
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: commands.............: enabled
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: starting input plugin /usr/local/lib/mjpg-streamer/input_uvc.so
    Nov 13 18:51:03 addapp20 MJPG-streamer [10920]: starting output plugin: /usr/local/lib/mjpg-streamer/output_http.so (ID: 00)
    Nov 13 18:51:04 addapp20 kernel: [ 7550.223021] usb 1-8.3.4: Not enough bandwidth for new device state.
    Nov 13 18:51:04 addapp20 kernel: [ 7550.223040] usb 1-8.3.4: Not enough bandwidth for altsetting 7
    Nov 13 18:51:04 addapp20 kernel: [ 7550.223849] usb 1-8.4.2: Not enough bandwidth for new device state.
    Nov 13 18:51:04 addapp20 kernel: [ 7550.223879] usb 1-8.4.2: Not enough bandwidth for altsetting 7
    Nov 13 18:51:04 addapp20 kernel: [ 7550.224523] usb 1-8.4.4: Not enough bandwidth for new device state.
    Nov 13 18:51:04 addapp20 kernel: [ 7550.224535] usb 1-8.4.4: Not enough bandwidth for altsetting 7
    Nov 13 18:51:04 addapp20 MJPG-streamer [10872]: Can't enable video in first time
    Nov 13 18:51:04 addapp20 MJPG-streamer [10896]: Can't enable video in first time
    Nov 13 18:51:04 addapp20 MJPG-streamer [10872]: cleaning up resources allocated by input thread
    Nov 13 18:51:04 addapp20 MJPG-streamer [10896]: cleaning up resources allocated by input thread
    Nov 13 18:51:04 addapp20 MJPG-streamer [10920]: Can't enable video in first time
    Nov 13 18:51:04 addapp20 MJPG-streamer [10920]: cleaning up resources allocated by input thread


    Does this mean, I need more power for the USB-Cams?
  • Nov 13 18:51:04 addapp20 kernel: [ 7550.223021] usb 1-8.3.4: Not enough bandwidth for new device state.

    That means usb bandwidth is exceeded. I wonder why since this webcam supports the better compressed MJPG format. I know yuyv raw format can only handle one webcam due to high bandwidth. Is this a usb 2.0 USB Port?

    You might use 640x480 wirg 5hz in server settings and restart webcams. That reduces bandwidth and should work. Once it works you can try increasing resolution of framerate to see when it starts failing. Leave some margin so printer communication does not get out of bandwidth. You canm also try using other usb ports so a different usb driver is used and not all webcams use 1-8 as path.

    lsusb -t

    shows a tree on how cams are connected over external or internal usb hubs.
  • lsusb -t
    /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/7p, 5000M
        |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 5000M
        |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 5000M
    /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/9p, 480M
        |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 1: Dev 4, If 0, Class=Communications, Driver=cdc_acm, 12M
            |__ Port 1: Dev 4, If 1, Class=CDC Data, Driver=cdc_acm, 12M
            |__ Port 2: Dev 7, If 3, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 7, If 1, Class=Video, Driver=uvcvideo, 480M
            |__ Port 2: Dev 7, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 7, If 0, Class=Video, Driver=uvcvideo, 480M
            |__ Port 4: Dev 9, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 9, If 0, Class=Video, Driver=uvcvideo, 480M
            |__ Port 4: Dev 9, If 3, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 9, If 1, Class=Video, Driver=uvcvideo, 480M
        |__ Port 2: Dev 3, If 0, Class=Hub, Driver=hub/4p, 480M
            |__ Port 4: Dev 8, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 8, If 0, Class=Video, Driver=uvcvideo, 480M
            |__ Port 4: Dev 8, If 3, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 4: Dev 8, If 1, Class=Video, Driver=uvcvideo, 480M
            |__ Port 2: Dev 6, If 3, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 6, If 1, Class=Video, Driver=uvcvideo, 480M
            |__ Port 2: Dev 6, If 2, Class=Audio, Driver=snd-usb-audio, 480M
            |__ Port 2: Dev 6, If 0, Class=Video, Driver=uvcvideo, 480M
        |__ Port 8: Dev 5, If 0, Class=Hub, Driver=hub/4p, 480M
  • There are 4 C270 cams on two usb 3.0 ports with usb 3.1 splitter.
    in the past I used this setup on the raspberry pi 4 with some faults on printing.

    Now I want to switch it like this.

    1st usb 3.0 port with usb hub 3.1 and two c270
    2nd usb 3.0 port with usb hub 3.1 and two c270

    Then on USB2 Port, with USB3 hub the 4 Prusa Printers. This should solve it.
    What do you think about? 

  • > USB2 Port, with USB3 hub
    If you have a lower usb speed closer to cpu the speed is definitvely throttled. So usb2 port means speed is max. 480M even for usb 3 hub. You need usb 3 hub on usb 3 port to allow more throughput.

    A bit confused from usb tree. There I see 2 hubs with 4 webcams each. At least I assume uvcvideo means it is a webcam. I also see there are 2 3.x ports with 5000M speed unused and 2 ports with 480M speed are used by webcams.

    I haven't tested this, but usb 3 hub on usb 3 port should have no issues with 4 usb 2 webcams. Except it switches downstream to usb 2 to adjust to lowest device speed, but I think it converts the incoming data to output speed.
  • Im switched back to the pi4 and added a active usb hub with external power supply. Since now it seems to work better with 4 active printers and 4 active webcams. The fujitsu S740 is not good for repetier if you want to use more then 2 webcam parallel.
Sign In or Register to comment.