[BUG] UVC demo app does not work with OAK-D-Lite
See original GitHub issueDescribe the bug
Running python3 demo_script.py --app uvc
with OAK-D-Lite creates /dev/video* device(s) only for a few seconds, the camera then disconnects and reconnects again as a non-uvc device, the /dev/video* devices disappear.
To Reproduce (interlaced with console and dmesg outputs)
- Connect OAK-D-Lite
dmesg
:
[ 3283.174698] usb 1-1: new high-speed USB device number 36 using xhci_hcd
[ 3283.315643] usb 1-1: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[ 3283.315665] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3283.315674] usb 1-1: Product: Movidius MyriadX
[ 3283.315681] usb 1-1: Manufacturer: Movidius Ltd.
[ 3283.315687] usb 1-1: SerialNumber: 03e72485
v4l2-ctl --list-device
:
v4l2loopback (platform:v4l2loopback-000):
/dev/video9
HD WebCam: HD WebCam (usb-0000:00:14.0-7):
/dev/video0
/dev/video1
/dev/media0
- Run
python3 depthai_demo.py --app uvc
python3 depthai_demo.py --app uvc
console:
Existing venv found.
Installing requirements...
Requirement already satisfied: pip in ./venv/lib/python3.10/site-packages (21.3.1)
Looking in indexes: https://pypi.org/simple, https://artifacts.luxonis.com/artifactory/luxonis-python-snapshot-local/
Requirement already satisfied: depthai==2.13.3.0.dev+f513b0f27b4f07a9940cd9dfe65d7fd6deeaf29d in ./venv/lib/python3.10/site-packages (from -r /home/zegkljan/tmp/depthai/apps/uvc/requirements.txt (line 2)) (2.13.3.0.dev0+f513b0f27b4f07a9940cd9dfe65d7fd6deeaf29d)
[18443010312C7C0F00] [89.076] [system] [info] PRINT:LeonCss: bss_init took 42.307 ms
BootloaderConfig.options1 checksum doesn't match. Is: 0x10304418 should be: 0x7018171A
BootloaderConfig.options2 checksum doesn't match. Is: 0x00214442 should be: 0x11FD80E1
GPIO boot mode 0x16, interface USBD
Setting aons(0..4) back to boot from flash (offset = 0)
====ENABLE WATCHDOG====1
--> brdInit ...
initial keepalive, countdown: 10
PLL0: 700000 AUX_IO0: 24000 AUX_IO1: 24000 MCFG: 24000 MECFG: 24000
Board init ret 3
brdInitAuxDevices: Error: SC = 27: io_initialize expander_cam_gpios_1 [OK]
spi_N25Q_init: Flash JEDEC ID: ff ff ff
eeprom_read_status 0!
Reading VERSION 6 --- ->
Closing EEPROm!
Is booted from flash by bootloader: 0
Networking not available...
Called by: LOS, controller: LOS
Enumerating on socket: Cam_A / RGB / Center
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 9281, read 0000
Probe failed I2C1 0x10 reg 300a: expected 7750, read 0000
Probe failed I2C1 0x10 reg 300a: expected 7750, read 0000
Probe failed I2C1 0x10 reg 300a: expected 7750, read 0000
Probe failed I2C1 0x10 reg 300a: expected 7750, read 0000
>> Registered camera IMX214R0 (imx214) as /dev/Camera_0
Enumerating on socket: Cam_B / Left
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
>> Registered camera MV200 (ov7750) as /dev/Camera_1
Enumerating on socket: Cam_C / Right
Probe failed I2C2 0x62 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
Probe failed I2C2 0x60 reg 300a: expected 9281, read 7750
>> Registered camera MV200 (ov7750) as /dev/Camera_2
Enumerating on socket: CAM_D
initial keepalive, countdown: 9
Initializing XLink...
UsbPumpVscAppI_Event: 5 VSC2_EVENT_ATTACH
UsbPumpVscAppI_Event: 2 VSC2_EVENT_SUSPEND
UsbPumpVscAppI_Event: 3 VSC2_EVENT_RESUME
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
initial keepalive, countdown: 8
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
UsbPumpVscAppI_Event: 4 VSC2_EVENT_RESET
UsbPumpVscAppI_Event: 2 VSC2_EVENT_SUSPEND
UsbPumpVscAppI_Event: 3 VSC2_EVENT_RESUME
UsbPumpVscAppI_Event: 0 VSC2_EVENT_INTERFACE_UP
UsbPumpVscAppI_Event: 2 VSC2_EVENT_SUSPEND
UsbPumpVscAppI_Event: 3 VSC2_EVENT_RESUME
UsbPumpVscAppI_Event: 2 VSC2_EVENT_SUSPEND
UsbPumpVscAppI_Event: 3 VSC2_EVENT_RESUME
Done!
Usb connection speed: High - USB 2.0
I: [Timesync] [ 1797428] [main] startSync:116 Timesync | Callback not set
Temperature: Driver registered.
Temperature: Initialized driver.
Temperature: Sensor opened: CSS.
Temperature: Sensor opened: MSS.
Temperature: Sensor opened: UPA.
Temperature: Sensor opened: DSS.
[18443010312C7C0F00] [89.076] [system] [info] PRINT:LeonMss: Called by: LRT, controller: LOS
Device started, please keep this process running
and open an UVC viewer. Example on Linux:
guvcview -d /dev/video0
To close: Ctrl+C
dmesg
:
[ 3390.764840] usb 1-1: Found UVC 1.00 device Luxonis Device (03e7:f63b)
[ 3390.765830] usb 1-1: Failed to query (GET_INFO) UVC control 9 on unit 1: -32 (exp. 1).
[ 3393.705249] usb 1-1: USB disconnect, device number 37
[ 3394.011224] usb 1-1: new high-speed USB device number 38 using xhci_hcd
[ 3394.151918] usb 1-1: New USB device found, idVendor=03e7, idProduct=2485, bcdDevice= 0.01
[ 3394.151922] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 3394.151924] usb 1-1: Product: Movidius MyriadX
[ 3394.151926] usb 1-1: Manufacturer: Movidius Ltd.
[ 3394.151927] usb 1-1: SerialNumber: 03e72485
- There are no new
/dev/video*
devices. Also, the app uses 100 % of one CPU core.v4l2-ctl --list-device
:
v4l2loopback (platform:v4l2loopback-000):
/dev/video9
HD WebCam: HD WebCam (usb-0000:00:14.0-7):
/dev/video0
/dev/video1
/dev/media0
Sometimes, however it takes some time (on the order of seconds, or lower 10s of secods) during which the /dev/video*
devices are present:
v4l2loopback (platform:v4l2loopback-000):
/dev/video9
Luxonis Device: UVC Video Contr (usb-0000:00:14.0-1):
/dev/video2
/dev/video3
/dev/media1
HD WebCam: HD WebCam (usb-0000:00:14.0-7):
/dev/video0
/dev/video1
/dev/media0
Sometimes I also get the following segfault from depthai_demo.py
(and in that case it does not use up 100 % of CPU, but does not exit either, I still have to Ctrl-C it):
...
Device started, please keep this process running
and open an UVC viewer. Example on Linux:
guvcview -d /dev/video0
To close: Ctrl+C
Stack trace (most recent call last) in thread 11826:
#2 Object "[", at 0, in nil
#1 Object "/usr/lib/libc.so.6", at 0x7f420ec0ed9f, in
#0 Object "/home/zegkljan/tmp/depthai/apps/uvc/venv/lib/python3.10/site-packages/depthai.cpython-310-x86_64-linux-gnu.so", at 0x7f420d6fb785, in backward::SignalHandling::sig_handler(int, siginfo_t*, void*)
Segmentation fault (Address not mapped to object [(nil)])
The two “sometimes” alternatives happen seemingly at random, I have not noticed any pattern.
Expected behavior The UVC app should work, i.e. provide a working UVC device(s).
System log
{
"architecture": "64bit ELF",
"machine": "x86_64",
"platform": "Linux-5.16.1-arch1-1-x86_64-with-glibc2.33",
"processor": "",
"python_build": "main Dec 18 2021 23:53:45",
"python_compiler": "GCC 11.1.0",
"python_implementation": "CPython",
"python_version": "3.10.1",
"release": "5.16.1-arch1-1",
"system": "Linux",
"version": "#1 SMP PREEMPT Sun, 16 Jan 2022 11:39:23 +0000",
"win32_ver": "",
"packages": [
"appdirs==1.4.4",
"Brlapi==0.8.3",
"btrfsutil==5.16",
"CacheControl==0.12.6",
"cffi==1.15.0",
"chardet==4.0.0",
"chrome-gnome-shell==0.0.0",
"colorama==0.4.4",
"contextlib2==0.6.0.post1",
"cryptography==36.0.1",
"depthai==2.14.1.0",
"distlib==0.3.4",
"distro==1.6.0",
"dnspython==2.1.0",
"filelock==3.4.0",
"guake==3.8.1",
"html5lib==1.1",
"idna==3.3",
"importlib-metadata==4.8.1",
"lensfun==0.3.95",
"libfdt==1.6.1",
"louis==3.20.0",
"Markdown==3.3.6",
"more-itertools==8.10.0",
"msgpack==1.0.3",
"netsnmp-python==1.0a1",
"numpy==1.21.5",
"opencv-contrib-python==4.5.5.62",
"opencv-python==4.5.5.62",
"ordered-set==4.0.2",
"packaging==20.9",
"pbr==5.8.0",
"pep517==0.12.0",
"pip==20.3.4",
"platformdirs==2.4.1",
"ply==3.11",
"progress==1.6",
"pwquality==1.4.4",
"pybind11==2.9.0",
"pycairo==1.20.1",
"pycparser==2.21",
"PyGObject==3.42.0",
"pyOpenSSL==21.0.0",
"pyparsing==2.4.7",
"pyvirtualcam==0.9.0",
"pyxdg==0.27",
"requests==2.26.0",
"resolvelib==0.5.5",
"retrying==1.3.3",
"setuptools==59.1.1",
"six==1.16.0",
"TBB==0.2",
"team==1.0",
"toml==0.10.2",
"tomli==1.2.3",
"urllib3==1.26.7",
"virtualenv==20.11.0",
"webencodings==0.5.1",
"zipp==3.6.0"
],
"usb": [
"NoLib"
],
"uname": [
"Linux eddie 5.16.1-arch1-1 #1 SMP PREEMPT Sun, 16 Jan 2022 11:39:23 +0000 x86_64"
]
}
Additional context The OAK-D-Lite is connected via USB-C to USB-A cable, sadly only an USB 2 cable. I’m getting an USB 3.1 cable very soon.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:18 (3 by maintainers)
@arafattehsin replacing the cable with USB3 one should resolve this issue
Hi @arafattehsin, As it’s a Windows machine, may be a little more complicated to check the USB speed in the system, but our demo should print it. Do you see
UsbSpeed.HIGH
(equivalent to USB2) as below when the demo runs in standard mode?If that’s the case, what type-C cable are you using, are both ends type-C, or it’s type-A to type-C? With the latter, there’s a possibility the device could be enumerated in USB2 mode if type-A is plugged first (so it’s powered) and then the type-C end is plugged into the device and it’s done “slowly” (first the power pins inside the type-C making contact, then data pins). A power-cycle (cable reconnection) is needed to recover from this.
The console logs are fine for the first part, I’m observing the same on Windows, it doesn’t advance to printing the status unless an UVC consumer (e.g. Camera app) is started.