• Not Answered

usb webcam can't work on DM365

Hello :

I have a problem with usb webcam working on dm365.
I load usbcore and musb_hdrc modules first, then I plug in the usb webcam.
After that I load the usb webccam driver module gspca.ko, I got the following messages:

/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: USB GSPCA cam
era found.(ZC3XX)
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: [spca5xx_prob
e:4275] Camera type JPEG
/home/pencil722/獢/DM365/useful/gspcav1-20071224/Vimicro/zc3xx.h: [zc3xx_con
fig:669] Find Sensor HV7131R(c)
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: [spca5xx_getc
apability:1249] maxw 640 maxh 480 minw 160 minh 120
usbcore: registered new driver gspca
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: gspca driver
01.00.20 registered

I think this message means the usb webcam devices is working with the driver.
And I can see the /dev/video.
But When I ran the DVSDK sample code encode, I got the following error message:

/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: init isoc: us
b_submit_urb(0) ret -28
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: [gspca_set_is
oc_ep:945] ISO EndPoint found 0x81 AlternateSet 6
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: init isoc: us
b_submit_urb(0) ret -28
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: [gspca_set_is
oc_ep:945] ISO EndPoint found 0x81 AlternateSet 5
/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: [spca50x_move
_data:1611] ISOC data error: [1] len=0, status=-18

/home/pencil722/獢/DM365/useful/gspcav1-20071224/gspca_core.c: [spca50x_move
_data:1611] ISOC data error: [2] len=0, status=-18

I don't know what happened? Is the sample code wrong? Or the driver can't work for dm365?
can anyone help solving the problems.

Peter. 

21 Replies

  • In reply to Ajay:

    Ajay,

    Thank you for your reply.
    Because our kernel has been edited with the display component, I can't change my kernel version.
    Then I want to patch my musb driver back, but I ca't find the old version of kernel source on TI's website.(TI's website provide DM365 only with the 2.6.18_pro500 version)
    Could you tell me where I can get the kernel version which you know can support the usb webcam?
    Or could you send me an email with that musb driver?

    My email address is : pencil722@gmail.com

    Regards,

    Peter

  • In reply to Peter Chen14428:

    The latest musb driver can be found at linus's tree below,

    http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=tree;h=2bfc96a127bc1cc94d26bfaa40159966064f9c8c;hb=2bfc96a127bc1cc94d26bfaa40159966064f9c8c

    Please be aware that there was a API change between usb core and HCD so using complete musb folder may not compile. You might have to change some code to make latest

    driver compatible to v2.6.18.

    Regards,
    Ajay

  • In reply to Ajay:

    Hi ,

    I have problem with musb driver when tried to support Realtek 8192CU wifi module over usb. It give kernel oops message, and major portion of that is shown below. I'm also using 2.6.18 kernel.

    Unable to handle kernel NULL pointer dereference at virtual address 00000038

    pgd = c0004000

    [00000038] *pgd=00000000

    Internal error: Oops: 17 [#1]

    Modules linked in: 8192cu sbull iscsi_tcp libiscsi scsi_transport_iscsi usbmon musb_hdrc usbcore ppp_deflate ppp_async ppp_synctty ppp_generic slhc tun loopl

    CPU: 0

    PC is at musb_start_urb+0x4c/0x928 [musb_hdrc]

    LR is at musb_urb_enqueue+0x3cc/0x454 [musb_hdrc]

    pc : [<bf0bf704>]    lr : [<bf0c0a4c>]    Not tainted

    .........

    Backtrace: 

    [<bf0bf6b8>] (musb_start_urb+0x0/0x928 [musb_hdrc]) from [<bf0c0a4c>] (musb_urb_enqueue+0x3cc/0x454 [musb_hdrc])

    [<bf0c0680>] (musb_urb_enqueue+0x0/0x454 [musb_hdrc]) from [<bf0a40a4>] (hcd_submit_urb+0x86c/0x964 [usbcore])

    [<bf0a3838>] (hcd_submit_urb+0x0/0x964 [usbcore]) from [<bf0a4534>] (usb_submit_urb+0x300/0x350 [usbcore])

    [<bf0a4234>] (usb_submit_urb+0x0/0x350 [usbcore]) from [<bf0a4d00>] (usb_start_wait_urb+0x44/0x174 [usbcore])

    [<bf0a4cbc>] (usb_start_wait_urb+0x0/0x174 [usbcore]) from [<bf0a5030>] (usb_control_msg+0xe0/0x104 [usbcore])

    [<bf0a4f50>] (usb_control_msg+0x0/0x104 [usbcore]) from [<bf108184>] (usbctrl_vendorreq+0xd0/0x158 [8192cu])

    [<bf1080b4>] (usbctrl_vendorreq+0x0/0x158 [8192cu]) from [<bf108364>] (usb_write8+0x48/0x88 [8192cu])

     

    Video and audio is streaming over wifi for around 5 mins @ 720P resoution, 30 FPS.

    I tried the methods described above in the thread except backporting to the latest usb driver. Could you please suggest me if any workaround possible in 2.6.18 musb driver ?

     

    Thank you

    tvs

  • In reply to Sudheesh:

    the problem comes form the High-bandwidth ISO mode webcam with DM365.

    check it out: section 4.72 about USB. the source code about this part is
    now:

    musb_core.c,musb_core_init:
       if (reg & MUSB_CONFIGDATA_HBRXE) {
                  strcat(aInfo, ", HB-ISO Rx");
                  musb->hb_iso_rx = true;
           }
           if (reg & MUSB_CONFIGDATA_HBTXE) {
                  strcat(aInfo, ", HB-ISO Tx");
                  musb->hb_iso_tx = true;
           }

    musb_host.c, musb_urb_enqueue
          /* Bits 11 & 12 of wMaxPacketSize encode high bandwidth multiplier.
           * Some musb cores don't support high bandwidth ISO transfers; and
           * we don't (yet!) support high bandwidth interrupt transfers.
           */
           qh->hb_mult = 1 + ((qh->maxpacket >> 11) & 0x03);
           if (qh->hb_mult > 1) {
                  int ok = (qh->type == USB_ENDPOINT_XFER_ISOC);

                  if (ok)
                         ok = (usb_pipein(urb->pipe) && musb->hb_iso_rx)
                                || (usb_pipeout(urb->pipe) && musb->hb_iso_tx);
                  if (!ok) {
                         ret = -EMSGSIZE;
                         goto done;
                  }
                  qh->maxpacket &= 0x7ff;
           }

    please check link1, link2 and link3   out

    Regards, Mike

  • In reply to zanget:

     i just want to know is there anyway to implement the driver to support the High-bandwidth ISO mode on DM365 ? can we try to init the usb webcam to negotiate about the bandwidth ??
    someone told me that:

    "However, it is very difficult to find a ISO mode webcam chip which have the packet size smaller than 1024 bytes in VGA/D1 or 720p resolution."

    we get a webcam to be supported but it is :
    usb.txt

    it seems to be High-bandwidth ISO mode ?
         wMaxPacketSize     0x0b20  2x 800 bytes
         wMaxPacketSize     0x1320  3x 800 bytes
         wMaxPacketSize     0x1400  3x 1024 bytes

  • In reply to zanget:

    there seems to no sample way to get it work with the high-bandwidth iso mode except hack the source code, cus i found the hardware handle:

    3.2.4.1.3 Error Handling
    If a CRC or bit-stuff error occurs during the reception of a packet, the packet will still be stored in the FIFO
    but the DATAERR_NAKTIMEOUT bit of HOST_RXCSR (bit 3) is set to indicate that the data may be
    corrupt

    if we donot take care of the NAKTIMEOUT errror, what will happen with more then 1kb data package? is it the only way to make it works ?

    Thanks in advance

    Regards, Mike

  • In reply to zanget:

    Mike,

    DM365 doesn't support high bandwidth iso transfer.

    Regards,

    Ajay

  • In reply to Ajay:

    hi, Ajay

     

    yes,you are right.

     it was confirmed with the FAE.

    regards,Mike

  • In reply to Ajay:

    Hi  Ajay,

    Is  high bandwidth iso transfer not possible because of hardware limitation or is it a s/w problem ? After going through SPRUFH9A  document section (3.3.2.1 ), i feel that it could be a s/w problem. Rx buffer size can be between 1 to 64k size

    As per section 3.3.2.7 i,,e Transparent Mode and RNDIS Mode Receive DMA Operation

    RNDIS mode DMA is used to receive DMA packets which are larger than USB MaxPktSize. This is
    accomplished by breaking the larger packet into smaller packets, not larger than USB MaxPktSize. This
    implies that multiple USB packets of MaxPktSize will be received and transferred together as a single
    large DMA packet and the DMA interrupt is generated only at the end of the complete reception of DMA
    packet.

    From the above definition enabling RNDIS mode DMA, the usb host should be able to receive the packets with larger size in isochronous transfer. Is there any patch which fixes the issue ?

    The same problem was seen on DM 8148 but got fixed after applying the patch. I feel the same should be the case with DM 368

    regards

    pradeep

  • In reply to Pradeep Acharya:

    Pradeep,

    It depends on platform in use. TI platforms DM365, DM644x, DM646x don't support high bandwidth iso tramsfer in hardware but AM35x, DM37x, TI814x, TI816x and AM335x do support it.

    You can refer to latest kernel tree for TI814x at http://arago-project.org/git/projects/?p=linux-omap3.git;a=shortlog;h=refs/heads/TI814XPSP_04.01.00.07 which gets updated as and when there is a fix available.

    Ajay