@veye_xumm 好的,我再觀察比較ㄧ下不同環境跟不同攝像頭看看。
Posts made by coolmitch
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 另一個想法,如果仿照這作法,camera 收到 USB 0x5514 做 reset (reboot) 可行嗎?
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 那是否也能把 power_line_frequency 也放進去支援 60hz ? 或是如果是特製版,那能直接把預設做成 60hz 嗎?
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 我的意思是,就目前的版本,我也無法去設定他的值(但在其他的攝像頭可以設定)。所以是否改的冒用的版本也不能用?
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@coolmitch 我用另一個別的廠牌的 uvc camera 可以這樣設定。
v4l2-ctl -d /dev/video1 --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : USB Camera
Bus info : usb-70090000.xusb-2.1
Driver version: 4.9.201
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'MJPG'
Field : None
Bytes per Line : 0
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 720
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 720
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=100 step=1 default=38 value=38
saturation 0x00980902 (int) : min=0 max=100 step=1 default=60 value=60
hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=50
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=100 max=500 step=1 default=440 value=440
gain 0x00980913 (int) : min=0 max=128 step=1 default=40 value=40
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=2
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=10 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=0 max=100 step=1 default=80 value=80
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=0 value=1
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=50 max=10000 step=1 default=166 value=50 flags=inactive
exposure_auto_priority 0x009a0903 (bool) : default=0 value=1
focus_absolute 0x009a090a (int) : min=0 max=1023 step=1 default=68 value=68 flags=inactive
focus_auto 0x009a090c (bool) : default=1 value=1
aaeon@aaeon2-desktop:/var/log$ v4l2-ctl -d /dev/video1 --set-ctrl=hue=0
aaeon@aaeon2-desktop:/var/log$ v4l2-ctl -d /dev/video1 --all
Driver Info (not using libv4l2):
Driver name : uvcvideo
Card type : USB Camera
Bus info : usb-70090000.xusb-2.1
Driver version: 4.9.201
Capabilities : 0x84200001
Video Capture
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x04200001
Video Capture
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
Width/Height : 1280/720
Pixel Format : 'MJPG'
Field : None
Bytes per Line : 0
Size Image : 1843200
Colorspace : sRGB
Transfer Function : Default (maps to sRGB)
YCbCr/HSV Encoding: Default (maps to ITU-R 601)
Quantization : Default (maps to Full Range)
Flags :
Crop Capability Video Capture:
Bounds : Left 0, Top 0, Width 1280, Height 720
Default : Left 0, Top 0, Width 1280, Height 720
Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 1280, Height 720
Selection: crop_bounds, Left 0, Top 0, Width 1280, Height 720
Streaming Parameters Video Capture:
Capabilities : timeperframe
Frames per second: 30.000 (30/1)
Read buffers : 0
brightness 0x00980900 (int) : min=-64 max=64 step=1 default=0 value=0
contrast 0x00980901 (int) : min=0 max=100 step=1 default=38 value=38
saturation 0x00980902 (int) : min=0 max=100 step=1 default=60 value=60
hue 0x00980903 (int) : min=-180 max=180 step=1 default=0 value=0
white_balance_temperature_auto 0x0098090c (bool) : default=1 value=1
gamma 0x00980910 (int) : min=100 max=500 step=1 default=440 value=440
gain 0x00980913 (int) : min=0 max=128 step=1 default=40 value=40
power_line_frequency 0x00980918 (menu) : min=0 max=2 default=1 value=2
white_balance_temperature 0x0098091a (int) : min=2800 max=6500 step=10 default=4600 value=4600 flags=inactive
sharpness 0x0098091b (int) : min=0 max=100 step=1 default=80 value=80
backlight_compensation 0x0098091c (int) : min=0 max=2 step=1 default=0 value=1
exposure_auto 0x009a0901 (menu) : min=0 max=3 default=3 value=3
exposure_absolute 0x009a0902 (int) : min=50 max=10000 step=1 default=166 value=50 flags=inactive
exposure_auto_priority 0x009a0903 (bool) : default=0 value=1
focus_absolute 0x009a090a (int) : min=0 max=1023 step=1 default=68 value=68 flags=inactive
focus_auto 0x009a090c (bool) : default=1 value=1 -
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm
色度是指這個嗎?我可以試看看
hue 0x00980903 (int) : min=0 max=100 step=1 default=50 value=50
我用 v4l2-ctl 下
v4l2-ctl -d /dev/video0 --set-ctrl=hue=0
可是它還是顯示 value=50 -
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 這篇我有看過,當時看它是對 usb hub 下命令,所以我就沒去試了。其實我的機器不是開發板,是用 nvidia computer module 做的機器。我也會問看看主機板供應商有沒有辦法(之前問過是說不行)。還要再麻煩你幫我看看有沒有辦法不斷電讓它連續運行(雖然目前有大幅度進步,但仍然久了還是會斷線)或是說有什麼 uvc 的命令可以讓它自動 reset 重啟我這邊也可以配合來下相對應的命令。
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 已確認下 reboot 指令時 usb 不會斷電。
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 我可以試試看每天夜間定時重啟看看。但已知的狀況是,當 disconnect 發生時,重啟 jetson nano 是無效的(不斷電)。目前的硬體機制沒辦法讓他斷電重啟。
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
不好的消息
執行 29525 次之後,再度發生一樣的狀況。不過至少不是 6000 次斷。 -
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm
對了,在 CS-USB-IMX307 新版韌體更新後,插入主機時會出現以下訊息,請問那些 Failed to query (GET_DEF) UVC control ... 是否就是 driver 要去讀取 uvccamera 參數時讀不到的錯誤?[66391.767449] usb 1-2.4: new high-speed USB device number 5 using tegra-xusb
[66391.788802] usb 1-2.4: New USB device found, idVendor=12d1, idProduct=4321
[66391.788807] usb 1-2.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[66391.788810] usb 1-2.4: Product: CS-USB-IMX307
[66391.788813] usb 1-2.4: Manufacturer: Tianjin Zhonganyijia
[66391.788815] usb 1-2.4: SerialNumber: 2021-04-29-v1.5
[66391.790104] uvcvideo: Found UVC 1.10 device CS-USB-IMX307 (12d1:4321)
[66391.791116] uvcvideo 1-2.4:1.0: Entity type for entity Processing 2 was not initialized!
[66391.799329] uvcvideo 1-2.4:1.0: Entity type for entity Extension 10 was not initialized!
[66391.807507] uvcvideo 1-2.4:1.0: Entity type for entity Camera 1 was not initialized!
[66391.815533] input: CS-USB-IMX307 as /devices/70090000.xusb/usb1/1-2/1-2.4/1-2.4:1.0/input/input3
[66391.860569] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.868750] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.876889] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.885043] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.893245] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.901418] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.909611] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.917744] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.925863] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.933954] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.942076] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.950219] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.958366] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.966488] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.974603] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.982734] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[66391.990897] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66391.999007] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.007219] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.015352] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.023488] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.031630] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.039743] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.047865] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.056021] uvcvideo: Failed to query (GET_DEF) UVC control 4 on unit 2: -32 (exp. 2).
[66392.064287] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.072494] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.080699] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.088904] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.097111] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.105311] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.113525] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.121728] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.129935] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.138162] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[66392.146380] uvcvideo: Failed to query (GET_DEF) UVC control 8 on unit 2: -32 (exp. 2).
[66392.154495] uvcvideo: Failed to query (GET_DEF) UVC control 8 on unit 2: -32 (exp. 2).
[66392.162626] uvcvideo: Failed to query (GET_DEF) UVC control 8 on unit 2: -32 (exp. 2).
[66392.170738] uvcvideo: Failed to query (GET_DEF) UVC control 1 on unit 2: -32 (exp. 2).
[66392.178855] uvcvideo: Failed to query (GET_DEF) UVC control 1 on unit 2: -32 (exp. 2).
[66392.186981] uvcvideo: Failed to query (GET_DEF) UVC control 1 on unit 2: -32 (exp. 2). -
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 瞭解。昨晚的還繼續在跑。我今天會做另一個測試站雙重測試。uvccamera 的參數看有沒有辦法讓有支援的都給出來,這樣在 linux 這邊會比較好處理(之前用 python 的那個 fourcc 的處理方式,因為沒有完整 uvc 的參數,搞了很久才找到那個怪方法...)
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm 我昨晚也跑了 22000+ 次,這樣應該就過了。所以是什麼原因造成的?
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm
升級後,開機看到這個
[ 48.421580] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[ 53.659534] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[ 53.672858] uvcvideo: Failed to query (GET_CUR) UVC control 11 on unit 2: -32 (exp. 1).
[ 53.681295] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[ 89.889940] uvcvideo: Failed to query (GET_DEF) UVC control 9 on unit 2: -32 (exp. 2).
[ 410.317273] uvcvideo: Failed to resubmit video URB (-1).不過我還是讓他去跑著測試了...
今晚先用 python3 的程式跑跑看... -
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm
cmake --version
cmake version 3.10.2CMake suite maintained and supported by Kitware (kitware.com/cmake).
我的也是 3.10.2
所以會不會是有什麼 dependent lib 沒有安裝完全? -
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
重新把程式碼排版ㄧ下...
#! /usr/bin/python3 import cv2 def run_once(): cap = cv2.VideoCapture('/dev/video0', cv2.CAP_V4L) # cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('M','J','P','G')) cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('h','2','6','4')) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080) cap.set(cv2.CAP_PROP_FPS, 30) # 讀取 10 個 frames for i in range(10): ret, frame = cap.read() cap.release() def main(): cap_count = 0 while True: run_once() print('-- %d --' % cap_count) cap_count += 1 if __name__ == '__main__': main()
-
RE: CS-USB-IMX307 OpenCV 連續採集影像造成 USB disconnct
@veye_xumm cmake 可能需要重新安裝新版。
參考這個(我有點忘記更新 cmake 的程序了)
https://stackoverflow.com/questions/49859457/how-to-reinstall-the-latest-cmake-version----------------- BEGIN imx307_debug.py --------------------
import cv2
def run_once():
cap = cv2.VideoCapture('/dev/video0', cv2.CAP_V4L) # cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('M','J','P','G')) cap.set(cv2.CAP_PROP_FOURCC, cv2.VideoWriter.fourcc('h','2','6','4')) cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1920) cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 1080) cap.set(cv2.CAP_PROP_FPS, 30) # 讀取 10 個 frames for i in range(10): ret, frame = cap.read() cap.release()
def main():
cap_count = 0
while True:
run_once()
print('-- %d --' % cap_count)
cap_count += 1if name == 'main':
main()----------------- END imx307_debug.py --------------------