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.

DM365 USB Host Problem with USB Hub



Hi all,

We encounter a USB Host problem in our DM365 EVM with a USB 2.0 Hub.  As we plan to connect 2 USB webcams with a USB 2.0 hub, we tested the following three cases:

Case 1:   DM365 EVM < --- > USB Webcam

Successfully capture video from the webcam.

Case 2:   DM365 EVM < --- > USB 2.0 Hub < --- > USB Webcam

We still can capture video from the webcam for a while but with the following recursive messages:

musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020

.....

Eventually,  it stop capturing any frame.

 

Case 3:   DM365 EVM < --- > USB 2.0 Hub < --- >  2 USB Webcam

We tried to capture a video from a USB Webcam but no frame can be captured.  And, the following recursive messages came ouit

musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020
musb_host_rx 1696: RX3 dma busy, csr 2020

.....

The conditions for testing the 3 cases are:

Linux Kernel: 2.6.18 (LSP 02_10_00_14) with HDSC patch

Configuration: davinci_dm365_defconfig

In order to enhance the usb host ISO RX response, we enabled USB FIFO double buffering in musb_core.c with the following change:

...

static ushort __initdata fifo_mode=5;

...

static struct fifo_cfg __initdata mode_5_cfg[] = {

{.hw_ep_num=1,.style=FIFO_RXTX,.maxpacket=512,.mode=BUF_DOUBLE,}

{.hw_ep_num=2,.style=FIFO_RXTX,.maxpacket=512,.mode=BUF_DOUBLE,}

{.hw_ep_num=3,.style=FIFO_RXTX,.maxpacket=512,.mode=BUF_DOUBLE,}

{.hw_ep_num=4,.style=FIFO_RXTX,.maxpacket=512,}

};

...

static int __init ep_config_from_table(struct musb *musb)

{

...

   switch(fifo_mode) {

...

   case 5:

         cfg = mode_5_cfg;

         n=ARRAY_SIZE(mode_5_cfg);

         break;

   }

....

 

Could anybody give me help and hints to resolve the issues in Cases 2 & 3?

Thank you so much in advance!

 

Best Regards,

Chitat

  • Hi ,

     

    Please, could you detail how do you capture the video from the webcam ?

    Do you use a UVC driver ?

    I would like to use webcam with the UVC driver but I don't know how to port it exactly.

    In order to capture the video, do you use any application or do you make your own application.

     

    Thank you in advance !!

    Best Regards,

    Joan.

  • Joan,

    You are right!  We use uvcvideo driver which is provided by our webcam supplier and also uses the supplier provided api for capturing video.

    Basically, you can find some information how to capture video using v4l2 api in the following link:

    http://www.linuxtv.org/downloads/video4linux/API/V4L2_API/spec-single/v4l2.html

    Hope this will help you to some extent.

    Best Regards,

    Chitat

  • Chitat,

    Could you try interfacing 2 Webcams on the Aarago GIT kernel that supports DM355 and verify whether the use case scenario's work?

    We have successfully verified the same on the Aarago GIT usnig 1 UVC web cam.

    regards

    swami

  • Swami,

    Thank you so much for your suggestion.  I cloned a copy of linux kernel source of 2.6.32-rc2 from Arago GIT yesterday but the uvcvideo we are using can't be compiled with the latest kernel.  I'm right now trying to work around it.

    Once it is done, I'll report it as soon as possible.

    By the way, have you ever tried the last scenario with 2 UVC web cams and a USB 2.0 hub?

    Best Regards,

    Chitat

  • I have not tried it yet.  Let me try out and let you know.

    regards

    swami

  • Swami,

    I applied some workaround of our uvcvideo kernel driver due to the prototype changes in the following

    v4l_compat_translate_ioctl() and video_usercopy()

    as the inode argument was removed.

    The uvcvideo kernel driver right now is able to build with the arago kernel 2.6.32-rc2 and it can load and detect my uvc webcam.  However, my test app can't open our video device node /dev/video1 and its errno is 14.

    Do you know what is going wrong?

    Best Regards,

    Chitat

  • Have you verified whether the webcam is indeed getting associated with Video1 node ?

    Can you provide the related screen dumps/logs?

    regards

    swami

  • Dear Swami,

    I think you're right.  I guess the webcam may probably not yet be assoicated with /dev/video1 node.  I checked /sys/bus/usb/drivers/uvcvideo/1-1.2:1.0 and found that video4linux was not assoicated with video1 as the case in kernel 2.6.18, e.g. video4linux:video1.  However, we found the /dev/video1 was created after our modified uvcvideo.ko loaded.

    And, the

    insmod uvcvideo.ko

    uvcvideo: Found UVC 1.00 device QCM10Q (0408:1fb1)
    uvcvideo: Found UVC 1.00 device QCM10Q (0408:1fb1)
    input: QCM10Q as /devices/platform/musb_hdrc/usb1/1-1/1-1.2/1-1.2:1.0/input/input1
    evbug.c: Connected device: input1 (QCM10Q at usb-musb_hdrc-1.2)

     ./example1 -s 640x480 -D -f 30 -g 30 -b 5000000 -
    o test.264

    Cam library initializing
    Cam debug_print (INFO):cam #0 demux set to ON
    Cam debug_print (CRIT):Cannot open '/dev/video1': 14, Bad address

    Do you have any ideas? 

    Best Regards,

    Chitat

  • Chitat,

    You had indicated earlier that you doing some custom modifications to get the UVC working.  Could you confirm that these modifications are not interfereing/causing this behavior.

    regards

    swami

  • Can you also provide the lsusb -v ourput with the webcam's connected.  Also ensure that the needed fifo modifications are done in the musb driver.

    regards

    swami

  • Dear Swami,

    Our uvcvideo kernel module was working fine in my linux PC (Ubuntu 8.04, kernel version 2.6.24-25-generic), and in DM365EVM (ti-davinci linux-2.6.18_pro500 and linux-2.6.18_pro500 with SDHC patch).  I guess it might probably be due to my new modification due to the function prototype change of v4l_compat_translate_ioctl() and video_usercopy() (the inode argument was removed in kernel 2.6.32-rc2).  Do you think so?

    Anyway, the following is the output of lsusb -v for your reference:

    Bus 001 Device 004: ID 0408:10fb XXXX Computer, Inc.
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass          239 Miscellaneous Device
      bDeviceSubClass         2 Common Class
      bDeviceProtocol         1 Interface Association
      bMaxPacketSize0        64
      idVendor           0x0408 XXXX Computer, Inc.
      idProduct          0x10fb
      bcdDevice           21.13
      iManufacturer           1 QCM
      iProduct                2 QCM10Q
      iSerial                 3 1802A
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength          887
        bNumInterfaces          3
        bConfigurationValue     1
        iConfiguration          2 QCM10Q
        bmAttributes         0x80
        MaxPower              250mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      1 Video Control
          bInterfaceProtocol      0
          iInterface              2 QCM10Q
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0020  bytes 32 once
            bInterval               6
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       1
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x1400  bytes 0 once
            bInterval               1
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       2
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x12f8  bytes 760 once
            bInterval               1
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       3
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0400  bytes 0 once
            bInterval               1
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        1
          bAlternateSetting       4
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x82  EP 2 IN
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0200  bytes 512 once
            bInterval               1
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       0
          bNumEndpoints           0
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       1
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x83  EP 3 IN
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0318  bytes 792 once
            bInterval               1
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        2
          bAlternateSetting       2
          bNumEndpoints           1
          bInterfaceClass        14 Video
          bInterfaceSubClass      2 Video Streaming
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x83  EP 3 IN
            bmAttributes            5
              Transfer Type            Isochronous
              Synch Type               Asynchronous
              Usage Type               Data
            wMaxPacketSize     0x0100  bytes 256 once
            bInterval               1

    Bus 001 Device 003: ID 05e3:0608 YYYY Computers, Inc.
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            9 Hub
      bDeviceSubClass         0 Unused
      bDeviceProtocol         1 Single TT
      bMaxPacketSize0        64
      idVendor           0x05e3 YYYY Computers, Inc.
      idProduct          0x0608
      bcdDevice            7.02
      iManufacturer           0
      iProduct                1 USB2.0 Hub
      iSerial                 0
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength           25
        bNumInterfaces          1
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0xe0
          Self Powered
          Remote Wakeup
        MaxPower              100mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         9 Hub
          bInterfaceSubClass      0 Unused
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0001  bytes 1 once
            bInterval              12

    Bus 001 Device 001: ID 1d6b:0002 
    Device Descriptor:
      bLength                18
      bDescriptorType         1
      bcdUSB               2.00
      bDeviceClass            9 Hub
      bDeviceSubClass         0 Unused
      bDeviceProtocol         0
      bMaxPacketSize0        64
      idVendor           0x1d6b
      idProduct          0x0002
      bcdDevice            2.06
      iManufacturer           3 Linux 2.6.32-rc2-davinci1-00000-DEV.DaVinciPSP.03.01.00.28 musb-hcd
      iProduct                2 MUSB HDRC host driver
      iSerial                 1 musb_hdrc
      bNumConfigurations      1
      Configuration Descriptor:
        bLength                 9
        bDescriptorType         2
        wTotalLength           25
        bNumInterfaces          1
        bConfigurationValue     1
        iConfiguration          0
        bmAttributes         0xe0
          Self Powered
          Remote Wakeup
        MaxPower                0mA
        Interface Descriptor:
          bLength                 9
          bDescriptorType         4
          bInterfaceNumber        0
          bAlternateSetting       0
          bNumEndpoints           1
          bInterfaceClass         9 Hub
          bInterfaceSubClass      0 Unused
          bInterfaceProtocol      0
          iInterface              0
          Endpoint Descriptor:
            bLength                 7
            bDescriptorType         5
            bEndpointAddress     0x81  EP 1 IN
            bmAttributes            3
              Transfer Type            Interrupt
              Synch Type               None
              Usage Type               Data
            wMaxPacketSize     0x0004  bytes 4 three times
            bInterval              12

    Thank you so much for your kindly help!

    Best Regards,

    Chitat

  • Chitat,

    Can you try lowering the capture resolution to say 320x240?

    I assume at this point you are using one Webcam, meaning only one webcam is connected to the hub.

    regards

    swami

  • Swami,

    I think a lower capture resolution may not work as our test app can't even open the /dev/video1 in kernel 2.6.32-rc2 from Arago.

    Anyway, I'll test it in the case of kernel 2.6.18 pro500 with SDHC patch, which is the case working fine with a webcam without a usb hub.  Also, I need to figure out why my new modified uvcvideo can't work in kernel 2.32-rc2.

    Best Regards,

    Chitat