This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM388: [DM388] Fail to enable UVC camera when user plugs in the USB connector

Part Number: DM388

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

UVC_fail.txt
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

  • Edwin,

    This product does not have ongoing direct design support from TI. For support while working through your design, you may contact one of the following third parties: D3 Engineering, elnfochips, Ittiam Systems, Path Partner Technology, or Z3 Technologies.

    DM38x has very limited support from TI. You may search the E2E forums for archived posts of previous discussions which may help address your questions. Finally, for additional design support for your video applications design, you can reach out to one of the following third parties:

    https://e2e.ti.com/support/processors/f/791/t/813421

    Regards,
    Pavel

  • I've notified the team, but expect delay in replies due to holidays.

    Best Regards,
    Yordan

  • Hi Yordan,

    Thanks, we will need your support to debug USB packet/URB

    Please assign someone to help.

    BRs, Edwin

  • And here is the content of the strange packet,

    beside the difference of duration and status mentioned previously,

    another difference is at the content of packet

    In normal case
    we got RAW data(00 6F A9 AE 84 6D A9 AE 84 6D) next to the line "Pipe Handle":

    000538: Control Transfer (UP), 2019-12-31 10:02:18.2515272 +0.0066069. (1. Device: UVC Camera (EEM Gadget)) Status: 0x00000000
    Pipe Handle: Control Pipe
     00 6F A9 AE 84 6D A9 AE 84 6D                     .o帑帑. fr     (<------ this line is empty in failure case)
    Setup Packet
     A1 87 00 14 00 01 0A 00                           ?......B
    Recipient: Interface
    Request Type: Class
    Direction: Device->Host
    Request: 0x87 (Unknown)
    Value: 0x1400
    Index: 0x100
    Length: 0xa

    In failure case,
    the content of line next to "Pipe Handle" is empty:

    000490: Control Transfer (UP), 2019-12-31 09:56:29.1751596 +5.0090087. (1. Device: UVC Camera (EEM Gadget)) Status: 0xc0010000
    Pipe Handle: Control Pipe
    Setup Packet
     A1 87 00 14 00 01 0A 00                           ?......0
    Recipient: Interface
    Request Type: Class
    Direction: Device->Host
    Request: 0x87 (Unknown)
    Value: 0x1400
    Index: 0x100
    Length: 0xa

  • Hi,


    Sorry, for the confusion I posted about the same time as Pavel so I haven't noticed that he already answered the thread. He is the engineer responsible for the support of DM388 devices.

    Best Regards,
    Yordan

  • Hi Pavel & Yordan,

    Please help to assign someone to check USB packet/URB related issue.

    We found that DM388 will delay to send the USB packet as I describe previously.

    We need to know how DM388 sends the USB packet.

    Otherwise, we can not debug this issue,

    Please help us as possible as you can, thanks a lot.

    BRs, Edwin