Logitech C920S intermittently fails

I bought a new Logitech C920S webcam to replace an 8MP Raspberry Pi camera module. I switched the settings in octopi.txt to:

camera="auto"
camera_usb_options="-r 1920x1080 -f 30"
camera_http_webroot="./www"
camera_http_options=""

The camera shows up in the Control tab of OctoPrint and works beautifully. I'm also using OctoLapse, which recognizes it and gives me all the nice controls. Everything looks good until I try to print something. Sometimes the camera fails as soon as the printer starts moving. Other times it'll print for a few hours and then the stream goes dead.

Sometimes I can restart it by SSHing to the server and restarting webcamd:
sudo service webcamd restart
but sometimes this fails. If I check webcamd status right after restarting it, I get this:

Jan 04 10:53:40 octopi webcamd[1032]: i: TV-Norm...........: DEFAULT
Jan 04 10:53:40 octopi mjpg_streamer[1056]: MJPG-streamer [1056]: Using V4L2 device.: /dev/video10
Jan 04 10:53:40 octopi webcamd[1032]: Error opening device /dev/video10: video capture not supported.
Jan 04 10:53:40 octopi webcamd[1032]: Init v4L2 failed !! exit fatal
Jan 04 10:53:40 octopi webcamd[1032]: i: init_VideoIn failed
Jan 04 10:53:40 octopi mjpg_streamer[1056]: MJPG-streamer [1056]: Desired Resolution: 1920 x 1080
Jan 04 10:53:40 octopi mjpg_streamer[1056]: MJPG-streamer [1056]: Frames Per Second.: 10
Jan 04 10:53:40 octopi mjpg_streamer[1056]: MJPG-streamer [1056]: Format............: JPEG
Jan 04 10:53:40 octopi mjpg_streamer[1056]: MJPG-streamer [1056]: TV-Norm...........: DEFAULT
Jan 04 10:53:40 octopi mjpg_streamer[1056]: MJPG-streamer [1056]: init_VideoIn failed

Then if I check it again a couple of seconds later:

Jan 04 10:53:43 octopi systemd[1]: webcamd.service: Service RestartSec=100ms expired, scheduling restart.
Jan 04 10:53:43 octopi systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 5.
Jan 04 10:53:43 octopi systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Jan 04 10:53:43 octopi systemd[1]: webcamd.service: Start request repeated too quickly.
Jan 04 10:53:43 octopi systemd[1]: webcamd.service: Failed with result 'start-limit-hit'.
Jan 04 10:53:43 octopi systemd[1]: Failed to start the OctoPi webcam daemon with the user specified config.

Once this error shows up, restarting webcamd no longer fixes the camera. In fact, rebooting the machine no longer fixes it! What ultimately works is to power down the machine, unplug the camera from the USB port, start it up, wait a minute, shut it down, plug the camera back in, and boot again. Crazy I know. But then the camera shows up and works fine until I try to print.

My Raspberry Pi 3B+ is using a Canakit 2.5A power supply. I also tried swapping it for a 3A power supply just in case, but it made no difference.

I have a second Ender 3 Pro, identically configured except that its webcam is an Aukey FHD. Swapping the camera over to that machine made no difference; the Aukey works fine, and the Logitech fails intermittently on either machine.

Restarting Octopi in safe mode made no difference.

I'm not sure what else to try or check. Could it be a bad camera? Is this a solvable issue? Thanks for any help.

Hi boogul, Have you found some solution for this issue? I am having the same problem

Setup: Prusa MK3S+MMU2S+Raspberry4+Logitech c920+Octoprint+Octolapse.

Hi Jakub, unfortunately I have not. I was planning to switch to a clean install on a Pi 4 this weekend, hoping that maybe it was a power issue and the Pi 4 would be able to handle it. But if you're experiencing the same issue with a Pi 4, that's probably not the case.

I'm still going to try a fresh install on the off chance it's some software issue that apt-get update isn't fixing. Not sure what else to do. I'll post results here either way. Please let me know if you figure something out.