PhotonVision / photonvision

PhotonVision is the free, fast, and easy-to-use computer vision solution for the FIRST Robotics Competition.
https://photonvision.org
GNU General Public License v3.0
277 stars 193 forks source link

Camera streams do not restart after Offline Update on OrangePi5 #1187

Closed crschardt closed 2 months ago

crschardt commented 9 months ago

Describe the bug After doing an offline update for photonvision, the system restarts, but camera streams fail to load. The log shows repeating errors like CS: ERROR: ioctl VIDIOC_S_FMT failed at UsbCameraImpl.cpp:976: Device or resource busy (UsbUtil.cpp:156). Neither hard refreshing the browser window nor restarting the photonvision service fix the problem. The only way to recover is by restarting the entire device.

Platform:

Additional context ~During debugging, I installed v4l-utils and the problem went away. I removed v4l-utils and it came back. I think we should add v4l-utils to the install script for Ubuntu installs.~ <- this was a red herring.

mcm001 commented 9 months ago

Why installing v4l-utils fixes things is beyond befuddling to me. Would be good to get someone else to reproduce or find the root cause, but it's easy to install for us yeah

crschardt commented 9 months ago

I'm starting to question that conclusion. I'm doing more testing.

Is it possible that there the streams sometimes don't get released properly when photonvision shuts down?

mcm001 commented 9 months ago

I think possible. Perhaps a longer shutdown delay in systemd is needed?

crschardt commented 9 months ago

It's turning out to be very intermittent. I can sometimes get it to happen a couple times in a row, but then I'm not able to reproduce it. I'll keep monitoring it to see if I can find some consistent way to reproduce.

crschardt commented 2 months ago

This hasn't come up recently, so closing.