Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robot program crashes if camera stream is loaded, camera is disconnected, and camera stream is reloaded #7776

Open
Gold856 opened this issue Feb 12, 2025 · 1 comment
Labels
type: bug Something isn't working.

Comments

@Gold856
Copy link
Contributor

Gold856 commented Feb 12, 2025

Describe the bug
A crash can be triggered by loading a camera stream, e.g., with a dashboard or visiting the URL directly, disconnecting the camera, and then reloading the camera stream.

To Reproduce
Steps to reproduce the behavior:

  1. Add CameraServer.startAutomaticCapture(); to your robot program.
  2. Start the simulator.
  3. Load the camera stream and observe your camera working.
  4. On Windows 11, go into the Settings app and disable the camera. The image from the camera stream should now be frozen (since the camera got disconnected.)
  5. Reload the camera stream. Observe a crash.

Expected behavior
I expected the behavior to be the same as when the camera was never connected.

Desktop (please complete the following information):

  • OS: Windows 11 24H2
  • Project Information:
  • WPILib Information:
    Project Version: 2025.1.1
    VS Code Version: 1.96.2
    WPILib Extension Version: 2025.2.1
    C++ Extension Version: 1.23.5
    Java Extension Version: 1.38.0
    Java Debug Extension Version: 0.58.2024090204
    Java Dependencies Extension Version 0.24.1
    Java Version: 17
    Java Location: C:\Users\Public\wpilib\2025\jdk
    Vendor Libraries:
    CTRE-Phoenix (v6) (25.2.1)
    REVLib (2025.0.2)
    Studica (2025.0.1)
    URCL (2025.0.1)
    WPILib-New-Commands (1.0.0)

Additional context
I see this in the console:

Source Reader error: 0xC00D3EA2
CS: USB Camera 0: Disconnected from \\?\USB#VID_30C9&PID_0065&MI_00#7&2ad6c492&0&0000#{65e8773d-8f56-11d0-a3b9-00a0c9223196}\GLOBAL

Crashes have not been replicated on a Linux machine or a RIO. It's possible this crash only happens on Windows.

@Gold856 Gold856 added the type: bug Something isn't working. label Feb 12, 2025
@sciencewhiz
Copy link
Contributor

sciencewhiz commented Feb 12, 2025

I suspect it is OS and camera and disable method specific. The other day I was running the simple vision example on my laptop with windows 11 with the webcam and enabled/disabled the camera with the hardware switch on my laptop and it didn't crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working.
Projects
None yet
Development

No branches or pull requests

2 participants