photonvision icon indicating copy to clipboard operation
photonvision copied to clipboard

Camera streams do not restart after Offline Update on OrangePi5

Open crschardt opened this issue 1 year ago • 4 comments

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:

  • Hardware Platform (ex. Raspberry Pi 4, Windows x64): OrangePi5
  • Network Configuration (Connection between the Radio and any devices in between, such as a Network Switch): Home Network Switch
  • PhotonVision Version: photonvision-dev-v2024.2.0-8-g57f02f31-linuxarm64_orangepi5.img
  • Browser (with Version) (Chrome, Edge, Firefox, etc.): Edge
  • Camera(s) Used: 2x Arducam OV9281s

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.

crschardt avatar Jan 21 '24 18:01 crschardt

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

mcm001 avatar Jan 21 '24 19:01 mcm001

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?

crschardt avatar Jan 21 '24 19:01 crschardt

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

mcm001 avatar Jan 21 '24 19:01 mcm001

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 avatar Jan 21 '24 20:01 crschardt