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
Describe the bug
On both the beta branches and stable, Photonvision crashes repeatedly when I have 2 CSI cameras connected. I am testing this on a Compute Module 4. Sometimes, it launches and only one camera is detected, then crashes back into the loop again after ~20 seconds. I think the error is related to this (found in syslog):
Jan 31 20:32:10 photonvision java[6190]: [0:05:49.570638142] [6296] #033[1;31mERROR #033[1;37mV4L2 #033[1;34mv4l2_device.cpp:359 #033[0;32m'ov9281 0-0060': #033[0mUnable to set control 0x00980911: Input/output error
Jan 31 20:32:10 photonvision java[6190]: [0:05:49.577598698] [6296] #033[1;31mERROR #033[1;37mV4L2 #033[1;34mv4l2_videodevice.cpp:1906 #033[0;32m/dev/video0[38:cap]: #033[0mFailed to start streaming: Input/output error
Jan 31 20:32:10 photonvision java[6190]: terminate called after throwing an instance of 'std::runtime_error'
Jan 31 20:32:10 photonvision java[6190]: what(): failed to start camera
Jan 31 20:32:10 photonvision kernel: [ 349.578250] ov9281 0-0060: start stream failed while write regs
Jan 31 20:32:10 photonvision kernel: [ 349.578285] unicam fe800000.csi: stream on failed in subdev
Jan 31 20:32:10 photonvision systemd[1]: photonvision.service: Main process exited, code=killed, status=6/ABRT
To Reproduce
Steps to reproduce the behavior:
Install two identical OV9281 cameras (have not tested them with other cameras, but these are directly from the recommended list)
Connect the board to power and Ethernet
Wait for Photonvision to boot and run/crash for 1 minute
Try to open web dashboard and fail
See errors in rpi os syslog
Screenshots / Videos
I don't have photon logs as it crashes before the logger starts. But here is my syslog and config
Syslog:
Jan 31 20:32:03 photonvision systemd[1]: Started PhotonVision server.
Jan 31 20:32:06 photonvision java[6190]: #033[32m[2023-01-31 20:32:06] [General - Main] [INFO] Native libraries loaded.#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[32m[2023-01-31 20:32:06] [Camera - LibCameraJNI] [INFO] Successfully loaded libpicam shared object#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[32m[2023-01-31 20:32:06] [General - Main] [INFO] Logging initialized in debug mode.#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[37m[2023-01-31 20:32:06] [General - ShellExec] [DEBUG] Executing "cat /proc/device-tree/model"#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[37m[2023-01-31 20:32:06] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[32m[2023-01-31 20:32:06] [General - Main] [INFO] Starting PhotonVision version v2024.1.1-beta-3.2 on Linux Raspbian 64-bit (Pi UNKNOWN)#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[37m[2023-01-31 20:32:06] [General - Main] [DEBUG] Loading ConfigManager...#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[37m[2023-01-31 20:32:06] [Config - SqlConfigProvider] [DEBUG] Loading config...#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[31m[2023-01-31 20:32:06] [Config - SqlConfigProvider] [ERROR] Could not deserialize apriltag layout! Loading defaults#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[37m[2023-01-31 20:32:06] [General - Main] [DEBUG] Loading HardwareManager...#033[0m
Jan 31 20:32:06 photonvision java[6190]: #033[32m[2023-01-31 20:32:06] [General - NetworkTablesManager] [INFO] Starting NT Client, server team is 5152#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[31m[2023-01-31 20:32:07] [General - NetworkTablesManager] [ERROR] [NetworkTablesManager] Could not connect to the robot! Will retry in the background...#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - Main] [DEBUG] Loading NetworkManager...#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[32m[2023-01-31 20:32:07] [General - NetworkManager] [INFO] Setting STATIC with team 5152#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "cat /etc/hostname | tr -d " \t\n\r""#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "echo photonvision > /etc/hostname"#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "hostnamectl set-hostname photonvision"#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "sed -i "s/127.0.1.1.*photonvision/127.0.1.1\tphotonvision/g" /etc/hosts"#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "sudo service avahi-daemon restart"#033[0m
Jan 31 20:32:07 photonvision avahi-daemon[6128]: Got SIGTERM, quitting.
Jan 31 20:32:07 photonvision avahi-daemon[6128]: Leaving mDNS multicast group on interface eth0.IPv4 with address 10.51.52.11.
Jan 31 20:32:07 photonvision systemd[1]: Stopping Avahi mDNS/DNS-SD Stack...
Jan 31 20:32:07 photonvision avahi-daemon[6128]: Leaving mDNS multicast group on interface lo.IPv6 with address ::1.
Jan 31 20:32:07 photonvision avahi-daemon[6128]: Leaving mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Jan 31 20:32:07 photonvision avahi-daemon[6128]: avahi-daemon 0.8 exiting.
Jan 31 20:32:07 photonvision systemd[1]: avahi-daemon.service: Succeeded.
Jan 31 20:32:07 photonvision systemd[1]: Stopped Avahi mDNS/DNS-SD Stack.
Jan 31 20:32:07 photonvision systemd[1]: Starting Avahi mDNS/DNS-SD Stack...
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Process 6128 died: No such process; trying to remove PID file. (/run/avahi-daemon//pid)
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Found user 'avahi' (UID 108) and group 'avahi' (GID 112).
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Successfully dropped root privileges.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: avahi-daemon 0.8 starting up.
Jan 31 20:32:07 photonvision systemd[1]: Started Avahi mDNS/DNS-SD Stack.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Successfully called chroot().
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Successfully dropped remaining capabilities.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: No service file found in /etc/avahi/services.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Joining mDNS multicast group on interface eth0.IPv4 with address 10.51.52.11.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: New relevant interface eth0.IPv4 for mDNS.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Joining mDNS multicast group on interface lo.IPv6 with address ::1.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: New relevant interface lo.IPv6 for mDNS.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Joining mDNS multicast group on interface lo.IPv4 with address 127.0.0.1.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: New relevant interface lo.IPv4 for mDNS.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Network interface enumeration completed.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Registering new address record for 10.51.52.11 on eth0.IPv4.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Registering new address record for ::1 on lo.*.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Registering new address record for 127.0.0.1 on lo.IPv4.
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[32m[2023-01-31 20:32:07] [General - NetworkManager] [INFO] Set hostname to photonvision#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "nmcli con mod "Wired connection 1" ipv4.addresses 10.51.52.11/8 ipv4.method "manual" ipv6.method "disabled""#033[0m
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.2999] audit: op="connection-update" uuid="893a97a2-1878-3be8-8561-4329cb3c6e76" name="Wired connection 1" args="connection.timestamp" pid=6255 uid=0 result="success"
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Executing "sh -c 'nmcli con down "Wired connection 1"; nmcli con up "Wired connection 1"'"#033[0m
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.3845] device (eth0): state change: activated -> deactivating (reason 'user-requested', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.3854] manager: NetworkManager state is now DISCONNECTING
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.3884] audit: op="connection-deactivate" uuid="893a97a2-1878-3be8-8561-4329cb3c6e76" name="Wired connection 1" pid=6264 uid=0 result="success"
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.4178] device (eth0): state change: deactivating -> disconnected (reason 'user-requested', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Withdrawing address record for 10.51.52.11 on eth0.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Leaving mDNS multicast group on interface eth0.IPv4 with address 10.51.52.11.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Interface eth0.IPv4 no longer relevant for mDNS.
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.4424] manager: NetworkManager state is now DISCONNECTED
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.4960] agent-manager: agent[2ffdfb0f7c23f70d,:1.242/nmcli-connect/0]: agent registered
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5014] device (eth0): Activation: starting connection 'Wired connection 1' (893a97a2-1878-3be8-8561-4329cb3c6e76)
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5020] audit: op="connection-activate" uuid="893a97a2-1878-3be8-8561-4329cb3c6e76" name="Wired connection 1" pid=6272 uid=0 result="success"
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5025] device (eth0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5055] manager: NetworkManager state is now CONNECTING
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5065] device (eth0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5107] device (eth0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Joining mDNS multicast group on interface eth0.IPv4 with address 10.51.52.11.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: New relevant interface eth0.IPv4 for mDNS.
Jan 31 20:32:07 photonvision avahi-daemon[6253]: Registering new address record for 10.51.52.11 on eth0.IPv4.
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5164] device (eth0): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5237] device (eth0): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5244] device (eth0): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5268] manager: NetworkManager state is now CONNECTED_LOCAL
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - ShellExec] [DEBUG] Got exit code 0#033[0m
Jan 31 20:32:07 photonvision NetworkManager[410]: <info> [1675215127.5357] device (eth0): Activation: successful, device activated.
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - Main] [DEBUG] Loading NetworkTablesManager...#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [General - Main] [DEBUG] Loading VisionSourceManager...#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[32m[2023-01-31 20:32:07] [General - Main] [INFO] Starting server...#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [Camera - VisionSourceManager] [DEBUG] Matching 2 new cameras!#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[32m[2023-01-31 20:32:07] [Camera - VisionSourceManager] [INFO] Adding local video device - "unicam" at "/dev/video0"#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[32m[2023-01-31 20:32:07] [Camera - VisionSourceManager] [INFO] Adding local video device - "unicam" at "/dev/video1"#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[37m[2023-01-31 20:32:07] [Camera - VisionSourceManager] [DEBUG] After matching loaded configs 2 cameras were unmatched.#033[0m
Jan 31 20:32:07 photonvision java[6190]: #033[32m[2023-01-31 20:32:07] [Camera - VisionSourceManager] [INFO] Creating a new camera config for camera unicam#033[0m
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.046521069] [6212] #033[1;32m INFO #033[1;37mCamera #033[1;34mcamera_manager.cpp:299 #033[0mlibcamera v0.0.3+40-9b860a66
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.075676310] [6296] #033[1;33m WARN #033[1;37mCameraSensorProperties #033[1;34mcamera_sensor_properties.cpp:205 #033[0mNo static properties available for 'ov9281'
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.075763625] [6296] #033[1;33m WARN #033[1;37mCameraSensorProperties #033[1;34mcamera_sensor_properties.cpp:207 #033[0mPlease consider updating the camera sensor properties database
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.086740662] [6296] #033[1;32m INFO #033[1;37mRPI #033[1;34mraspberrypi.cpp:1425 #033[0mRegistered camera /base/soc/i2c0mux/i2c@0/ov9281@60 to Unicam device /dev/media1 and ISP device /dev/media4
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.088591069] [6296] #033[1;33m WARN #033[1;37mCameraSensorProperties #033[1;34mcamera_sensor_properties.cpp:205 #033[0mNo static properties available for 'ov9281'
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.088689736] [6296] #033[1;33m WARN #033[1;37mCameraSensorProperties #033[1;34mcamera_sensor_properties.cpp:207 #033[0mPlease consider updating the camera sensor properties database
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.097357495] [6296] #033[1;32m INFO #033[1;37mRPI #033[1;34mraspberrypi.cpp:1425 #033[0mRegistered camera /base/soc/i2c0mux/i2c@1/ov9281@60 to Unicam device /dev/media3 and ISP device /dev/media5
Jan 31 20:32:07 photonvision java[6190]: Checking model: ov9281
Jan 31 20:32:07 photonvision java[6190]: Model 4
Jan 31 20:32:07 photonvision java[6190]: Active areas:
Jan 31 20:32:07 photonvision java[6190]: (0, 0)/1280x800
Jan 31 20:32:07 photonvision java[6190]: Rotation = 30
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.098467125] [6212] #033[1;32m INFO #033[1;37mCamera #033[1;34mcamera.cpp:1028 #033[0mconfiguring streams: (0) 320x240-YUV420
Jan 31 20:32:07 photonvision java[6190]: [0:05:47.099014903] [6296] #033[1;32m INFO #033[1;37mRPI #033[1;34mraspberrypi.cpp:805 #033[0mSensor: /base/soc/i2c0mux/i2c@0/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected unicam format: 640x400-Y10P
Jan 31 20:32:07 photonvision java[6190]: 320x240-YUV420
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [WebServer - DataChangeService] [DEBUG] Added subscriber - Sources: DCS_WEBSOCKET, DCS_HTTP, DCS_NETWORKTABLES, DCS_VISIONMODULE, DCS_OTHER, Destinations: DCD_UI#033[0m
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [WebServer - DataChangeService] [DEBUG] Added subscriber - Sources: DCS_WEBSOCKET, Destinations: DCD_GENSETTINGS#033[0m
Jan 31 20:32:08 photonvision java[6190]: [main] INFO io.javalin.Javalin - Starting Javalin ...
Jan 31 20:32:08 photonvision java[6190]: error: XDG_RUNTIME_DIR not set in the environment.
Jan 31 20:32:08 photonvision java[6190]: Initialized EGL version: 1.4
Jan 31 20:32:08 photonvision java[6190]: Destroying headless
Jan 31 20:32:08 photonvision avahi-daemon[6253]: Server startup complete. Host name is photonvision.local. Local service cookie is 1334927253.
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [Camera - CameraConfiguration] [DEBUG] Creating USB camera configuration for UsbCamera unicam (AKA OV9281) at /dev/video0#033[0m
Jan 31 20:32:08 photonvision java[6190]: #033[32m[2023-01-31 20:32:08] [Camera - VisionSourceManager] [INFO] Creating a new camera config for camera unicam (1)#033[0m
Jan 31 20:32:08 photonvision java[6190]: Checking model: ov9281
Jan 31 20:32:08 photonvision java[6190]: Model 4
Jan 31 20:32:08 photonvision java[6190]: Active areas:
Jan 31 20:32:08 photonvision java[6190]: (0, 0)/1280x800
Jan 31 20:32:08 photonvision java[6190]: Rotation = 30
Jan 31 20:32:08 photonvision java[6190]: [0:05:47.699797921] [6212] #033[1;32m INFO #033[1;37mCamera #033[1;34mcamera.cpp:1028 #033[0mconfiguring streams: (0) 320x240-YUV420
Jan 31 20:32:08 photonvision java[6190]: [0:05:47.700499180] [6296] #033[1;32m INFO #033[1;37mRPI #033[1;34mraspberrypi.cpp:805 #033[0mSensor: /base/soc/i2c0mux/i2c@0/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected unicam format: 640x400-Y10P
Jan 31 20:32:08 photonvision java[6190]: 320x240-YUV420
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [General - ConfigManager] [DEBUG] Saving to disk...#033[0m
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [Config - SqlConfigProvider] [DEBUG] Saving to disk#033[0m
Jan 31 20:32:08 photonvision java[6190]: #033[32m[2023-01-31 20:32:08] [Config - SqlConfigProvider] [INFO] Settings saved!#033[0m
Jan 31 20:32:08 photonvision java[6190]: [main] INFO org.eclipse.jetty.server.Server - jetty-11.0.15; built: 2023-04-11T18:37:53.775Z; git: 5bc5e562c8d05c5862505aebe5cf83a61bdbcb96; jvm 11.0.18+10-post-Debian-1deb11u1
Jan 31 20:32:08 photonvision java[6190]: error: XDG_RUNTIME_DIR not set in the environment.
Jan 31 20:32:08 photonvision java[6190]: Initialized EGL version: 1.4
Jan 31 20:32:08 photonvision java[6190]: Destroying headless
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [Camera - CameraConfiguration] [DEBUG] Creating USB camera configuration for UsbCamera unicam (AKA OV9281) at /dev/video1#033[0m
Jan 31 20:32:08 photonvision java[6190]: #033[37m[2023-01-31 20:32:08] [Camera - VisionSourceManager] [DEBUG] Matched or created 2 camera configs!#033[0m
Jan 31 20:32:08 photonvision java[6190]: [main] INFO org.eclipse.jetty.server.session.DefaultSessionIdManager - Session workerName=node0
Jan 31 20:32:09 photonvision java[6190]: [main] INFO org.eclipse.jetty.server.handler.ContextHandler - Started i.j.j.@61edc883{/,null,AVAILABLE}
Jan 31 20:32:09 photonvision java[6190]: [main] INFO org.eclipse.jetty.server.AbstractConnector - Started ServerConnector@1de5f0ef{HTTP/1.1, (http/1.1)}{0.0.0.0:5800}
Jan 31 20:32:09 photonvision java[6190]: #033[37m[2023-01-31 20:32:09] [Camera - VisionSourceManager] [DEBUG] Creating VisionSource for CameraConfiguration [baseName=unicam, uniqueName=unicam, nickname=OV9281, path=/dev/video0, otherPaths=[/dev/v4l/by-path/platform-fe800000.csi-video-index0], cameraType=UsbCamera, FOV=70.0, calibrations=[], currentPipelineIndex=0, streamIndex=0, pipelineSettings=[], driveModeSettings=CVPipelineSettings{pipelineIndex=-1, pipelineType=DriverMode, inputImageRotationMode=DEG_0, pipelineNickname='Driver Mode', cameraExposure=20.0, cameraBrightness=50, cameraGain=75, cameraRedGain=11, cameraBlueGain=20, cameraVideoModeIndex=0, streamingFrameDivisor=NONE, ledMode=false, inputShouldShow=true, outputShouldShow=true}]#033[0m
Jan 31 20:32:09 photonvision java[6190]: Checking model: ov9281
Jan 31 20:32:09 photonvision java[6190]: Model 4
Jan 31 20:32:09 photonvision java[6190]: Active areas:
Jan 31 20:32:09 photonvision java[6190]: (0, 0)/1280x800
Jan 31 20:32:09 photonvision java[6190]: Rotation = 30
Jan 31 20:32:09 photonvision java[6190]: [0:05:48.601463532] [6212] #033[1;32m INFO #033[1;37mCamera #033[1;34mcamera.cpp:1028 #033[0mconfiguring streams: (0) 320x240-YUV420
Jan 31 20:32:09 photonvision java[6190]: [0:05:48.602113994] [6296] #033[1;32m INFO #033[1;37mRPI #033[1;34mraspberrypi.cpp:805 #033[0mSensor: /base/soc/i2c0mux/i2c@0/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected unicam format: 640x400-Y10P
Jan 31 20:32:09 photonvision java[6190]: 320x240-YUV420
Jan 31 20:32:09 photonvision java[6190]: [main] INFO org.eclipse.jetty.server.Server - Started Server@48c35007{STARTING}[11.0.15,sto=0] @5558ms
Jan 31 20:32:09 photonvision java[6190]: [main] INFO io.javalin.Javalin - Static file handler added: StaticFileConfig(hostedPath=/, directory=web, location=CLASSPATH, precompress=false, aliasCheck=null, headers={Cache-Control=max-age=0}, skipFileFunction=Function1<jakarta.servlet.http.HttpServletRequest, java.lang.Boolean>, mimeTypes=io.javalin.http.staticfiles.MimeTypesConfig@344344fa). File system location: 'jar:file:/opt/photonvision/photonvision.jar!/web'
Jan 31 20:32:09 photonvision java[6190]: [main] INFO io.javalin.Javalin - Listening on http://localhost:5800/
Jan 31 20:32:09 photonvision java[6190]: [main] INFO io.javalin.Javalin - You are running Javalin 5.6.2 (released July 31, 2023).
Jan 31 20:32:09 photonvision java[6190]: [main] INFO io.javalin.Javalin - Javalin started in 1441ms \o/
Jan 31 20:32:09 photonvision java[6190]: error: XDG_RUNTIME_DIR not set in the environment.
Jan 31 20:32:09 photonvision java[6190]: Initialized EGL version: 1.4
Jan 31 20:32:09 photonvision java[6190]: Destroying headless
Jan 31 20:32:09 photonvision java[6190]: #033[32m[2023-01-31 20:32:09] [VisionModule - VisionSourceSettables] [INFO] Setting video mode to FPS: 30 Width: 320 Height: 240 Pixel Format: kUnknown#033[0m
Jan 31 20:32:09 photonvision java[6190]: #033[37m[2023-01-31 20:32:09] [VisionModule - VisionSourceSettables] [DEBUG] Creating libcamera#033[0m
Jan 31 20:32:09 photonvision java[6190]: Checking model: ov9281
Jan 31 20:32:09 photonvision java[6190]: Model 4
Jan 31 20:32:09 photonvision java[6190]: Active areas:
Jan 31 20:32:09 photonvision java[6190]: (0, 0)/1280x800
Jan 31 20:32:09 photonvision java[6190]: Rotation = 0
Jan 31 20:32:09 photonvision java[6190]: [0:05:49.136197031] [6212] #033[1;32m INFO #033[1;37mCamera #033[1;34mcamera.cpp:1028 #033[0mconfiguring streams: (0) 320x240-YUV420
Jan 31 20:32:09 photonvision java[6190]: [0:05:49.136830865] [6296] #033[1;32m INFO #033[1;37mRPI #033[1;34mraspberrypi.cpp:805 #033[0mSensor: /base/soc/i2c0mux/i2c@0/ov9281@60 - Selected sensor format: 640x400-Y10_1X10 - Selected unicam format: 640x400-Y10P
Jan 31 20:32:09 photonvision java[6190]: 320x240-YUV420
Jan 31 20:32:10 photonvision java[6190]: error: XDG_RUNTIME_DIR not set in the environment.
Jan 31 20:32:10 photonvision java[6190]: #033[37m[2023-01-31 20:32:10] [VisionModule - VisionSourceSettables] [DEBUG] Starting libcamera#033[0m
Jan 31 20:32:10 photonvision java[6190]: Initialized EGL version: 1.4
Jan 31 20:32:10 photonvision java[6190]: [0:05:49.570638142] [6296] #033[1;31mERROR #033[1;37mV4L2 #033[1;34mv4l2_device.cpp:359 #033[0;32m'ov9281 0-0060': #033[0mUnable to set control 0x00980911: Input/output error
Jan 31 20:32:10 photonvision java[6190]: [0:05:49.577598698] [6296] #033[1;31mERROR #033[1;37mV4L2 #033[1;34mv4l2_videodevice.cpp:1906 #033[0;32m/dev/video0[38:cap]: #033[0mFailed to start streaming: Input/output error
Jan 31 20:32:10 photonvision java[6190]: terminate called after throwing an instance of 'std::runtime_error'
Jan 31 20:32:10 photonvision java[6190]: what(): failed to start camera
Jan 31 20:32:10 photonvision kernel: [ 349.578250] ov9281 0-0060: start stream failed while write regs
Jan 31 20:32:10 photonvision kernel: [ 349.578285] unicam fe800000.csi: stream on failed in subdev
Jan 31 20:32:10 photonvision systemd[1]: photonvision.service: Main process exited, code=killed, status=6/ABRT
Jan 31 20:32:10 photonvision systemd[1]: photonvision.service: Failed with result 'signal'.
Jan 31 20:32:10 photonvision systemd[1]: photonvision.service: Consumed 12.502s CPU time.
Jan 31 20:32:11 photonvision systemd[1]: photonvision.service: Scheduled restart job, restart counter is at 46.
Jan 31 20:32:11 photonvision systemd[1]: Stopped PhotonVision server.
Jan 31 20:32:11 photonvision systemd[1]: photonvision.service: Consumed 12.502s CPU time.
Jan 31 20:32:11 photonvision systemd[1]: Started PhotonVision server.
Config:
# Automatically load overlays for detected DSI displays/cameras
display_auto_detect=1
# camera_auto_detect=1
### Custom camera config for dual CAM port CM4 (Suggested by board manufacturer)
dtoverlay=ov9281,cam0
dtoverlay=ov9281,cam1
# Enable DRM VC4 V3D driver
dtoverlay=vc4-kms-v3d
max_framebuffers=2
# Run in 64-bit mode
arm_64bit=1
# Disable compensation for displays with overscan
disable_overscan=1
[cm4]
# Enable host mode on the 2711 built-in XHCI USB controller.
# This line should be removed if the legacy DWC2 controller is required
# (e.g. for USB device mode) or if USB support is not required.
otg_mode=1
[pi4]
# Run as fast as firmware / board allows
arm_boost=1
[all]
##############################################################
### PHOTONVISION CAM CONFIG
### Comment/Uncomment to change which camera is supported
### Picam V1, V2 or HQ: uncomment (remove leading # ) from camera_auto_detect=1,
### and comment out all following lines
### IMX290/327/OV9281/Any other cameras that require additional overlays:
### Comment out (add a # ) to camera_auto_detect=1, and uncomment the line for
### the sensor you're trying to user
# cameraAutoDetect=1
# dtoverlay=imx290,clock-frequency=74250000
# dtoverlay=imx290,clock-frequency=37125000
# dtoverlay=imx378
# dtoverlay=ov9281
##############################################################
Platform:
Hardware Platform (ex. Raspberry Pi 4, Windows x64): Raspberry Pi CM4 with CM4-IO-BASE-A
Network Configuration (Connection between the Radio and any devices in between, such as a Network Switch): Tested with P2P, 2nd router port, and switch
PhotonVision Version: Tested with 2024-beta-6 and 2023.4.2
Not exactly shocked. Our camera driver (see photon-libcamera-gl-driver) was written for one CSI camera at a time. And things work if you only use one right?
Also @SeanErn are you on Discord? We've got another contributor interested in supporting dual cam. Suspect this will be a good chunk of C++/native code, would be good to connect in a more real time context
My discord is funky.chicken and I'd be happy to connect with them any time. I have school holiday break coming up from the end of this week to Kickoff so I am pretty open.
Also, you are correct that it works fine with one camera.
Describe the bug
On both the beta branches and stable, Photonvision crashes repeatedly when I have 2 CSI cameras connected. I am testing this on a Compute Module 4. Sometimes, it launches and only one camera is detected, then crashes back into the loop again after ~20 seconds. I think the error is related to this (found in syslog):
To Reproduce
Steps to reproduce the behavior:
Screenshots / Videos
I don't have photon logs as it crashes before the logger starts. But here is my syslog and config
Syslog:
Config:
Platform:
The text was updated successfully, but these errors were encountered: