You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Booting an image on a Pi without an attached camera to test
Looked into /var/log/syslog and noticed the camera daemon kept restarting every other second
What did you expect to happen?
The daemon not to restart right away, but to keep running but sleep for 120s between each scan loop.
What happened instead?
The daemon script exited. The systemd file then made it immediately restart again. Endless loop.
Did the same happen when running OctoPrint in safe mode?
Not tied to OctoPrint.
Version of OctoPi
1.0.0, current devel branch pulled this morning. Also confirmed on 0.18.0.
Printer model & used firmware incl. version
Not tied to a printer (also no printer connected)
Screenshot(s)/video(s) showing the problem:
Jun 29 12:26:15 octopiC systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Jun 29 12:26:15 octopiC root: Starting USB webcam
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: starting application
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: Using V4L2 device.: /dev/video10
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: Desired Resolution: 640 x 480
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: Frames Per Second.: 10
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: Format............: JPEG
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: TV-Norm...........: DEFAULT
Jun 29 12:26:15 octopiC MJPG-streamer [22341]: init_VideoIn failed
Jun 29 12:26:16 octopiC systemd[1]: webcamd.service: Succeeded.
Jun 29 12:26:16 octopiC systemd[1]: Started the OctoPi webcam daemon with the user specified config.
Jun 29 12:26:18 octopiC systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 812.
Jun 29 12:26:18 octopiC systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Jun 29 12:26:18 octopiC systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Jun 29 12:26:18 octopiC root: Starting USB webcam
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: starting application
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: Using V4L2 device.: /dev/video10
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: Desired Resolution: 640 x 480
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: Frames Per Second.: 10
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: Format............: JPEG
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: TV-Norm...........: DEFAULT
Jun 29 12:26:18 octopiC MJPG-streamer [22367]: init_VideoIn failed
Jun 29 12:26:19 octopiC systemd[1]: webcamd.service: Succeeded.
Jun 29 12:26:19 octopiC systemd[1]: Started the OctoPi webcam daemon with the user specified config.
Jun 29 12:26:20 octopiC systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 813.
Jun 29 12:26:20 octopiC systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Jun 29 12:26:20 octopiC systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Jun 29 12:26:20 octopiC root: Starting USB webcam
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: starting application
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: Using V4L2 device.: /dev/video10
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: Desired Resolution: 640 x 480
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: Frames Per Second.: 10
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: Format............: JPEG
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: TV-Norm...........: DEFAULT
Jun 29 12:26:20 octopiC MJPG-streamer [22393]: init_VideoIn failed
Jun 29 12:26:21 octopiC systemd[1]: webcamd.service: Succeeded.
Jun 29 12:26:21 octopiC systemd[1]: Started the OctoPi webcam daemon with the user specified config.
Jun 29 12:26:22 octopiC systemd[1]: webcamd.service: Scheduled restart job, restart counter is at 814.
Jun 29 12:26:22 octopiC systemd[1]: Stopped the OctoPi webcam daemon with the user specified config.
Jun 29 12:26:22 octopiC systemd[1]: Starting the OctoPi webcam daemon with the user specified config...
Jun 29 12:26:22 octopiC root: Starting USB webcam
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: starting application
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: MJPG Streamer Version: git rev: 310b29f4a94c46652b20c4b7b6e5cf24e532af39
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: Using V4L2 device.: /dev/video10
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: Desired Resolution: 640 x 480
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: Frames Per Second.: 10
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: Format............: JPEG
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: TV-Norm...........: DEFAULT
Jun 29 12:26:22 octopiC MJPG-streamer [22423]: init_VideoIn failed
Jun 29 12:26:23 octopiC systemd[1]: webcamd.service: Succeeded.
Jun 29 12:26:23 octopiC systemd[1]: Started the OctoPi webcam daemon with the user specified config.
webcamd was originally intended to never exit (which is also while there's a while true in there) and only sleep 2min whenever inactive before running another rescan. Some changes introduced with 555b28b / #596 / #597 have changed this, and now things end in a restart storm if no webcam is connected as a consequence.
I suggest we remove the while True and instead leave it up to the restart policy in the system unit to take care of the 2min rescans. At least that's the only thing I can see working right now, since the multi cam support and array matching there changed the script so much from the original that I have no idea what I would break in touching THAT.
The text was updated successfully, but these errors were encountered:
foosel
changed the title
webcamd service keeps endlessly restarting every second if there's no camera attached
webcamd service keeps endlessly restarting every second if there's no compatible camera attached
Jun 29, 2021
Small addendum and correction, no working camera attached. The script will find some hardcoded video devices that apparently are memory mapped devices for encoding purposes and not compatible to mjpg streamer.
What were you doing?
/var/log/syslog
and noticed the camera daemon kept restarting every other secondWhat did you expect to happen?
The daemon not to restart right away, but to keep running but sleep for 120s between each scan loop.
What happened instead?
The daemon script exited. The systemd file then made it immediately restart again. Endless loop.
Did the same happen when running OctoPrint in safe mode?
Not tied to OctoPrint.
Version of OctoPi
1.0.0, current
devel
branch pulled this morning. Also confirmed on 0.18.0.Printer model & used firmware incl. version
Not tied to a printer (also no printer connected)
Screenshot(s)/video(s) showing the problem:
Additional notes
This seems to be caused by a combination of these lines in the
webcamd
script:and the
Restart: always
behaviour of the system unit file.webcamd
was originally intended to never exit (which is also while there's awhile true
in there) and only sleep 2min whenever inactive before running another rescan. Some changes introduced with 555b28b / #596 / #597 have changed this, and now things end in a restart storm if no webcam is connected as a consequence.I suggest we remove the
while True
and instead leave it up to the restart policy in the system unit to take care of the 2min rescans. At least that's the only thing I can see working right now, since the multi cam support and array matching there changed the script so much from the original that I have no idea what I would break in touching THAT.The text was updated successfully, but these errors were encountered: