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.

AM335x - USB - UVC Video Capture

Goal: To extract a 640x480 still images from USB camera for post processing using the BeagleBone development board with PSP 4.06.00.08.

Issues:

We are currently looking for a work around for Issue 4. 

Background:

1. Enabled UVC drivers in the Kernal Configuration: http://processors.wiki.ti.com/index.php/Usbgeneralpage#USB_Video

2. Encountered a DMA issue:

  1. Described: https://groups.google.com/forum/?fromgroups=#!topic/beagleboard/sgCwaP5RVUo  
  2. Documented: (ARM_MPU.KERNEL.39) http://processors.wiki.ti.com/index.php/Sitara_SDK_5.05.00_Release_Notes
  3. Work Around: Rebuild kernel with DMA disabled USB DMA disabled (CONFIG_MUSB_PIO_ONLY=y), http://processors.wiki.ti.com/index.php/UsbgeneralpageLinux-v3p1

3. Encountered video artifacts when connecting USB camera to a USB Host port on the board

  1. Described: http://www.mathworks.com/help/simulink/slref/pandaboardv4l2videocapture.html
  2. Work Around:  Force USB port to behave as OTG:
Force USB mode as 'OTG' in 'kernel/arch/arm/mach-omap2/board-am335xevm.c'.

static struct omap_musb_board_data musb_board_data = {
     .interface_type = MUSB_INTERFACE_ULPI,
     /*
      * mode[0:3] = USB0PORT's mode
      * mode[4:7] = USB1PORT's mode
      * AM335X beta EVM has USB0 in OTG mode and USB1 in host mode.
      */
     .mode           = MUSB_OTG,
     .power          = 500,
     .instances      = 1,
};

Refer to below AM335x feature list. MUSB OTG HNP is supported.
http://processors.wiki.ti.com/index.php/AM335x-PSP_04.06.00.08_Features_and_Performance_Guide#MUSB_OTG_controller

4. Encountered issue when opening/closeing UVC several times. Results in "select timeout" or “musb_host_rx 1658: RX13 dma busy, csr 2023“ error message.  Unable to receive video stream until AM335x is power cycled.

  1. Documented: (SDOCM00091464)http://processors.wiki.ti.com/index.php/AM335x-PSP_04.06.00.08_Release_Notes#USB_2
  2. Work Around: ??

 Question:

Can the Video4Linux Frame Grabber API (libfg) be used here?  It seems to be a video4linux derivative that used to capture frames.  Please note that the video4linux project does not support still image capture.

Link to documentation:

Frame Grabber Interface: http://antonym.org/libfg/
Video4Linux feature list and supported devices:  http://www.ideasonboard.org/uvc/.

 

  • Attaching application used to test UVC driver

    0317.TestRepeatOpen.rar

  • In kernel PSP 04.06.00.08. It default confing setting is

    CONFIG_USB_TI_CPPI41_DMA_HW=y
    # CONFIG_MUSB_PIO_ONLY is not set

    so it is not PIO mode... it is DMA mode?

    However, we find an amazing information: During UVC application running, interrupt "cppi41_dma" will generated very high frequency:

    /home # date; more /proc/interrupts;
    Sat Jan  1 00:08:22 UTC 2000
               CPU0
     12:       1703      INTC  edma
     14:          0      INTC  edma_error
     17:    3724496      INTC  cppi41_dma
     18:          0      INTC  musb-hdrc.0
     19:        260      INTC  musb-hdrc.1
     30:         16      INTC  omap_i2c
     40:          0      INTC  cpsw
     43:          0      INTC  cpsw
     64:       7905      INTC  mmc0
     68:       3564      INTC  gp timer
     70:        148      INTC  omap_i2c
     72:       4909      INTC  OMAP UART0
     75:          0      INTC  rtc0
     76:          0      INTC  rtc0
     77:          0      INTC  wkup_m3
     78:          1      INTC  wkup_m3_txev
     93:          0      INTC  cpsw
     94:          0      INTC  cpsw
    166:          0      GPIO  mmc0
    Err:          0
    /home # date; more /proc/interrupts;
    Sat Jan  1 00:08:51 UTC 2000
               CPU0
     12:       1705      INTC  edma
     14:          0      INTC  edma_error
     17:    3956334      INTC  cppi41_dma
     18:          0      INTC  musb-hdrc.0
     19:        260      INTC  musb-hdrc.1
     30:         16      INTC  omap_i2c
     40:          0      INTC  cpsw
     43:          0      INTC  cpsw
     64:       7915      INTC  mmc0
     68:       3827      INTC  gp timer
     70:        148      INTC  omap_i2c
     72:       4963      INTC  OMAP UART0
     75:          0      INTC  rtc0
     76:          0      INTC  rtc0
     77:          0      INTC  wkup_m3
     78:          1      INTC  wkup_m3_txev
     93:          0      INTC  cpsw
     94:          0      INTC  cpsw
    166:          0      GPIO  mmc0
    Err:          0
    /home # date; more /proc/interrupts;
    Sat Jan  1 00:10:55 UTC 2000
               CPU0
     12:       1711      INTC  edma
     14:          0      INTC  edma_error
     17:    4942167      INTC  cppi41_dma
     18:          0      INTC  musb-hdrc.0
     19:        260      INTC  musb-hdrc.1
     30:         16      INTC  omap_i2c
     40:          0      INTC  cpsw
     43:          0      INTC  cpsw
     64:       7945      INTC  mmc0
     68:       4359      INTC  gp timer
     70:        148      INTC  omap_i2c
     72:       5033      INTC  OMAP UART0
     75:          0      INTC  rtc0
     76:          0      INTC  rtc0
     77:          0      INTC  wkup_m3
     78:          1      INTC  wkup_m3_txev
     93:          0      INTC  cpsw
     94:          0      INTC  cpsw
    166:          0      GPIO  mmc0
    Err:          0

       cppi41_dma interrupt generated so high frequency.... it is correct desgin?

  • Lin,
     
    Thanks for joining us on the forums!
     
    Please disable USB DMA (always use PIO).  Instructions to do so can be found at the link below.
     
     
    You can confirm that DMA has been disabled by entering the following commands into your evm's console. 
    Enter the command:
     # zcat /proc/config.gz | grep CPPI41
     
     If you see the following output, DMA is disabled.
     # CONFIG_USB_TI_CPPI41_DMA is not set
     
    But if you see the following, DMA is enabled.
    # CONFIG_USB_TI_CPPI41_DMA_HW=y
    # CONFIG_USB_TI_CPPI41_DMA=y
     
  • Hi Mike

            I have the same problem, So I found you by Google, I use to test your code, "0317.TestRepeatOpen.rar", Also have the same problem

    ”4. Encountered issue when opening/closeing UVC several times. Results in "select timeout" or “musb_host_rx 1658: RX13 dma busy, csr 2023“ error message.  Unable to receive video stream until AM335x is power cycled.“

            You now solve this problem?

     

            Board: SBC8600

            CPU: AM335X

            KERNEL: AM335x-PSP_04.06.00.08

            USB-CAMERA: Logitech C210

            ERROR INF: "musb_host_rx 1658: RX13 dma busy"