Hi sirs,
We have implemented UVC driver on DM388 to support UVC camera.
However, we found that, the UVC camera sometimes fails to initialize
when user plugs in USB connector with PC.
In normal case, once user plugs in USB cable to PC,
PC and DM388 will communicate with lots of USB packets.
We have installed a USB protocol analyzer software - device Monitoring studio
and we found that, some USB packets will lose in failure case.
In normal case, we will get 22 USB packets totally.
But in failure case, there are only 20 USB packets only.
Here is the last five packets in normal case:
Time Diff Direction Status Function
+0.0142013 DOWN 0x00000000 URB_FUNCTION_CLASS_INTERFACE
+0.0066069 UP 0x00000000 URB_FUNCTION_CONTROL_TRANSFER
+0.0000120 DOWN 0x00000090 URB_FUNCTION_CLASS_INTERFACE (<------ Lose in failure case)
+0.0083606 UP 0x00000000 URB_FUNCTION_CONTROL_TRANSFER (<------ Lose in failure case)
+0.0001924 UP 0xc0010000 URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
And here is the last three packets in failure case:
Time Diff Direction Status Function
+0.0039810 DOWN 0x00000000 URB_FUNCTION_CLASS_INTERFACE
+5.0090087 UP 0xc0010000 URB_FUNCTION_CONTROL_TRANSFER (<------ Time Diff and Status is strange)
+0.0002795 UP 0xc0010000 URB_FUNCTION_BULK_OR_INTERRUPT_TRANSFER
It loses two USB packets in failure case -
"URB_FUNCTION_CLASS_INTERFACE" and "URB_FUNCTION_CONTROL_TRANSFER"
the direction "UP" means send USB packet from device(DM388) to host(PC)
and "DOWN" is opposite.
You can also found that, before the missed two packets-
"URB_FUNCTION_CLASS_INTERFACE" and "URB_FUNCTION_CONTROL_TRANSFER"
the "Time Diff" and "Status" of the packet "URB_FUNCTION_CONTROL_TRANSFER" in failure case
is so strange, it is "+5.0090087" and "0xc0010000".
lt is also different with normal case.
We think that DM388 may get something wrong to delay to send this packet to PC with 5.0090087s.
And this duration 5.0090087s is too long to cause timeout, so it doesn't the follows two packets in normal case.
Therefore, the question is,
1. What does status code 0xc0010000 means? How to check it?
2. Why sometimes DM388 delays 5.0090087s to send USB packet? How to check it?
3. Can we enable any related logs of DM388 platform to debug this issue?
Thanks for your help
Fail log
USB Power: Power=a0 HandleUVC_SDCard_HDMI:1,0,30,1 g_webcam gadget: uvc_function_bind uvc_function_bind g_webcam gadget: Webcam Video Gadget g_webcam gadget: g_webcam ready musb-hdrc musb-hdrc.1: MUSB HDRC host driver musb-hdrc musb-hdrc.1: new USB bus registered, assigned bus number 2 usb usb2: New USB device found, idVendor=1d6b, idProduct=0002 usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1 usb usb2: Product: MUSB HDRC host driver usb usb2: Manufacturer: Linux 2.6.37_DM388_IPNC_3.80.00 musb-hcd usb usb2: SerialNumber: musb-hdrc.1 hub 2-0:1.0: USB hub found hub 2-0:1.0: 1 port detected UVCThread1 MultiCh_MiiS_CloseHDMIChannel open succeeded, file descriptor = 25 device is musb-hdrc on bus gadget [host] [host] ORG 0x48105200: 3010101 [host] NEW 0x48105200: 3010100 [host] ChangeResolutionforUVC_640 MultiCh_MiiS_SetDisableMode:30 g_webcam gadget: high speed config #1: Video g_webcam gadget: uvc_function_set_alt(0, 0) g_webcam gadget: uvc_function_set_alt(1, 0) g_webcam gadget: always return at uvc_function_set_alt(x, 0) SetDisableModeIng_webcam gadget: uvc_function_set_alt(1, 0) g_webcam gadget: always return at uvc_function_set_alt(x, 0) dicateJPGfps:30 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 1 [g_webcam gadget: uvc_function_set_alt(1, 0) g_webcam gadget: always return at uvc_function_set_alt(x, 0) host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 0 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 1 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 0 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 1 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 0 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 1 [host] key type: 0 ; code: 0 ; value: 0 [host] key type: 1 ; code: 6 ; value: 0 [host] key type: 0 ; code: 0 ; value: 0 [m3vpss ] RszCfg_A ******** crop: start(0 ,0) [m3vpss ] w / h: (2560,1920) [m3video] Channel:1 inputframerate:30 targetfps:30 [m3video] JPGLINK: new targetframerate to set:30000 for bitrate 4000000 [m3video] JPGLINK: Run time parameters changed 0 [host] Usecase is Active !!!
Best regards,
Edwin