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.

What sort of transfer speeds are to be expected throught the USB-net protocol on DM365?

Hi, I've now completed a set of algorithms that build an 'image' array, places it into a pattern sequence packet and loads it into the DLP. The algorithm accepts any number of images to be built and loaded, but it only loads 96 at a time (I've chose not to use extended pattern sequence due to it's minimum exposure time being too high). I've used the clock() function in the <time.h> library  (c/c++) to count the time it takes the cpu to execute all the instructions, including building the 'images', 'rotate' them (in order to have a true square), load them into a 'bmp' structure array, load that into packets, load the packets to the DLP, load the DLP with a <start sequence> packet, <advance sequence> packets and a <stop sequence> packet. The clock() estimates under 0.04s for each 96 pattern sequence, but I've timed it with a chronometer and it takes around 7.5s for each 96 pattern sequence. Is this due to the usb->internet communication protocols? I'd b expecting about 50MB/s through USB 2.0, but 7.5s for ~5MB is much lower.

Thanks

  • Hi,

    Can you elaborate more on the USB network setup ? Does DM365 act as RNDIS device or acts as USB Host connecting to a USB network dongle ?

    Please refer to the pdf, where USB performance numbers are discussed for DM365 : www.ti.com/.../sprs566a.pdf
  • Jmfras,

    DM365 BSP package contains a performance guide inside the document section, which might help you in further analysis. 

    However, please note that 50MBps for USB 2.0 on DM365 are the very high expectations :)

    This may not be feasible to reach this numbers on practical end-applications due to high CPU load. Please find the below link FYR for tested speeds. 

    Good part is,  there is definite scope for improvement in USB throughput by optimizing the software including BSP and your applications :)

    Based on the use case requirements, we can improve the throughput :)

  • I don't know, the DM365 is built in a DLP3000, but I can't find in the documentation how it acts. I just know it goes USB->Net from the GUI source code. Currently I'm using the following code (should it help) to connect with the DLP:

    /* Socket Structure */
    struct sockaddr_in sa;
    sa.sin_family = AF_INET;
    sa.sin_addr.s_addr = inet_addr(ip);
    sa.sin_port = htons(0x5555);
    int dm365 = socket(AF_INET,SOCK_STREAM,0);

    /* Attempt to Establish Connection */
    if (connect(dm365,(sockaddr*) &sa,sizeof(sa))!=-1){
    cout<<"Connected."<<endl;
    cout<<" "<<endl;}
    else{
    cout<<"Connection failed."<<endl;
    return -1;}
  • I wasn't really expecting such high rate of transfer, but certainly not having to wait 8s for 5MB. I've been clocking all functions I'm using and on my end it's taking 0.05s per sequence (of 96 patterns with 52kB each), the problem is the clocking only accounts cpu tics, so it isn't considering hang time, so I'm not sure exactly what the problem is.
  • Hi,

    I would suggest you to perform iperf test, You can cross compile and run to check. Also what is the turn around time when you give a ping command in shell ?
    Also it would be helpful if you can give your dmesg logs and ifconfig output
  • ping:
    --- 192.168.1.100 ping statistics ---
    26 packets transmitted, 26 received, 0% packet loss, time 24998ms
    rtt min/avg/max/mdev = 0.482/0.534/0.607/0.035 ms

    ifconfing:
    usb0 Link encap:Ethernet HWaddr 0a:87:55:02:f8:6a
    inet addr:192.168.1.99 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::887:55ff:fe02:f86a/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:174 errors:0 dropped:0 overruns:0 frame:0
    TX packets:1745 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:10464 (10.4 KB) TX bytes:2063727 (2.0 MB)

    I'll look into that iperf test, see if I can manage to do that. As for dmesg I have no clue.
  • Hi,

    Just type in command line like ifconfig
    # dmesg

    Your ping takes really long time. Also if can share the kernel config being used. What version of kernel ? How it is connected to network(may be any cable like ethernet connected to DM36x ?)
  • So, I guess it's acting as RNDIS. It's connected through USB.

    dmesg:
    [61606.464243] usb 3-2: new full-speed USB device number 19 using xhci_hcd
    [61606.592424] usb 3-2: not running at top speed; connect to a high speed hub
    [61606.593490] usb 3-2: New USB device found, idVendor=0525, idProduct=a4a2
    [61606.593492] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [61606.593494] usb 3-2: Product: RNDIS/Ethernet Gadget
    [61606.593495] usb 3-2: Manufacturer: Linux 2.6.32.17-davinci1 with musb_hdrc
    [61606.600062] cdc_ether 3-2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-2, CDC Ethernet Device, 0a:87:55:02:f8:6a
    [61606.674317] cdc_ether 3-2:1.0 usb0: kevent 12 may have been dropped
    [61888.627052] systemd-hostnamed[7812]: Warning: nss-myhostname is not installed. Changing the local hostname might make it unresolveable. Please install nss-myhostname!
    [62060.446749] usb 3-2: USB disconnect, device number 19
    [62060.446822] cdc_ether 3-2:1.0 usb0: unregister 'cdc_ether' usb-0000:00:14.0-2, CDC Ethernet Device
    [62357.364379] usb 3-2: new full-speed USB device number 20 using xhci_hcd
    [62357.492567] usb 3-2: not running at top speed; connect to a high speed hub
    [62357.493469] usb 3-2: New USB device found, idVendor=0525, idProduct=a4a2
    [62357.493472] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [62357.493474] usb 3-2: Product: RNDIS/Ethernet Gadget
    [62357.493477] usb 3-2: Manufacturer: Linux 2.6.32.17-davinci1 with musb_hdrc
    [62357.499962] cdc_ether 3-2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-2, CDC Ethernet Device, 0a:87:55:02:f8:6a
    [62357.570131] cdc_ether 3-2:1.0 usb0: kevent 12 may have been dropped
    [62641.085674] usb 3-2: USB disconnect, device number 20
    [62641.085739] cdc_ether 3-2:1.0 usb0: unregister 'cdc_ether' usb-0000:00:14.0-2, CDC Ethernet Device
    [63187.368544] usb 3-2: new full-speed USB device number 21 using xhci_hcd
    [63187.496732] usb 3-2: not running at top speed; connect to a high speed hub
    [63187.497662] usb 3-2: New USB device found, idVendor=0525, idProduct=a4a2
    [63187.497665] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [63187.497667] usb 3-2: Product: RNDIS/Ethernet Gadget
    [63187.497668] usb 3-2: Manufacturer: Linux 2.6.32.17-davinci1 with musb_hdrc
    [63187.504067] cdc_ether 3-2:1.0 usb0: register 'cdc_ether' at usb-0000:00:14.0-2, CDC Ethernet Device, 0a:87:55:02:f8:6a
    [63187.580074] cdc_ether 3-2:1.0 usb0: kevent 12 may have been dropped

    kernel:

    4.4.0-97-generic

  • Hi,

    This looks to be dmesg from PC side. Can you share the dmesg from the DM36x side too ? Looks like it is configured as full speed(USB 1.1).
  • Same as done in PC. If you are getting DM36x shell, type
    # dmesg
  • Oh, sorry the ping info I left before was also done on my end not on the DM36x shell. How do I access it?
  • Sorry, but how do I access DM365's shell?
  • Finally I have some results:

    ifconfig:
    usb0 Link encap:Ethernet HWaddr 2A:C2:28:8B:90:6B
    inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:67750 errors:37 dropped:0 overruns:0 frame:37
    TX packets:66769 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:4402136 (4.1 MiB) TX bytes:3624886 (3.4 MiB)

    dmesg:
    Linux version 2.6.32.17-davinci1 (sanjeev@sanjeev-VirtualBox) (gcc version 4.4.1 (Sourcery G++ Lite 2010q1-202) ) #5 PREEMPT Fri Sep 20 16:14:26 IST 2013
    CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=00053177
    CPU: VIVT data cache, VIVT instruction cache
    Machine: DaVinci DM365 LCr
    Memory policy: ECC disabled, Data cache writeback
    On node 0 totalpages: 29696
    free_area_init_node: node 0, pgdat c0342804, node_mem_map c035a000
    DMA zone: 232 pages used for memmap
    DMA zone: 0 pages reserved
    DMA zone: 29464 pages, LIFO batch:7
    DaVinci dm36x_rev1.2 variant 0x8
    Built 1 zonelists in Zone order, mobility grouping on. Total pages: 29464
    Kernel command line: mem=116M console=ttyS0,115200n8 root=/dev/ram0 rw initrd=0x82000000,5M ramdisk_size=15360 ip=off video=davincifb:vid0=1216x684x16,4050K:vid1=off:osd0=0x0x8,0K:osd1=0x0x8,0K dm365_imp.oper_mode=0 davinci_enc_mngr.ch0_output=LCD davinci_enc_mngr.ch0_mode=1216x684YUV vpfe_capture.interface=1
    PID hash table entries: 512 (order: -1, 2048 bytes)
    Dentry cache hash table entries: 16384 (order: 4, 65536 bytes)
    Inode-cache hash table entries: 8192 (order: 3, 32768 bytes)
    Memory: 116MB = 116MB total
    Memory: 108956KB available (3024K code, 243K data, 124K init, 0K highmem)
    SLUB: Genslabs=11, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
    Hierarchical RCU implementation.
    NR_IRQS:245
    Console: colour dummy device 80x30
    Calibrating delay loop... 147.86 BogoMIPS (lpj=739328)
    Mount-cache hash table entries: 512
    CPU: Testing write buffer coherency: ok
    DaVinci: 8 gpio irqs
    NET: Registered protocol family 16
    davinci_serial_init:97: failed to get UART2 clock
    bio: create slab <bio-0> at 0
    DM365 IPIPE initialized in Continuous mode
    vpss vpss: dm365_vpss vpss probed
    vpss vpss: dm365_vpss vpss probe success
    dm365_afew_hw_init
    ch0 default output "LCD", mode "1216x684YUV"
    be_encoder_setoutput>
    Setting output to Composite
    Start of vpbe_encoder_setmode..
    pbe_encoder_setmode>
    pbe_encoder_setoutput>
    VPBE Encoder initialized
    be_encoder_enumoutput>
    pbe_encoder_enumoutput>
    be_encoder_enumoutput>
    pbe_encoder_enumoutput>
    be_encoder_enumoutput>
    pbe_encoder_enumoutput>
    be_encoder_getoutput>
    pbe_encoder_getoutput>
    be_encoder_getmode>
    be_encoder_getmode/>
    VPBE Encoder Initialized
    VPBE Encoder de-initialized
    gicpd_encoder_setoutput>
    Start of logicpd_encoder_setmode..
    ogicpd_encoder_setoutput>
    LogicPD Encoder initialized
    gicpd_encoder_enumoutput>
    ogicpd_encoder_enumoutput>
    gicpd_encoder_setoutput>
    Start of logicpd_encoder_setmode..
    ogicpd_encoder_setoutput>
    Start of logicpd_encoder_setmode..
    gicpd_encoder_getoutput>
    ogicpd_encoder_getoutput>
    gicpd_encoder_getmode>
    ogicpd_encoder_getmode>
    LogicPD encoder initialized
    Switching to clocksource timer0_1
    musb_hdrc: version 6.0, cppi-dma, peripheral, debug=0
    musb_hdrc: ConfigData=0x06 (UTMI-8, dyn FIFOs, SoftConn)
    musb_hdrc: MHDRC RTL version 1.500
    musb_hdrc: setup fifo_mode 2
    musb_hdrc: 9/9 max ep, 4032/4096 memory
    musb_hdrc: USB Peripheral mode controller at fec64000 using DMA, IRQ 12
    NET: Registered protocol family 2
    IP route cache hash table entries: 1024 (order: 0, 4096 bytes)
    TCP established hash table entries: 4096 (order: 3, 32768 bytes)
    TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    TCP: Hash tables configured (established 4096 bind 4096)
    TCP reno registered
    NET: Registered protocol family 1
    Trying to unpack rootfs image as initramfs...
    rootfs image is not initramfs (no cpio magic); looks like an initrd
    Freeing initrd memory: 5120K
    JFFS2 version 2.2. (NAND) © 2001-2006 Red Hat, Inc.
    msgmni has been set to 223
    alg: No test for stdrng (krng)
    io scheduler noop registered
    io scheduler anticipatory registered (default)
    gicpd_encoder_getmode>
    ogicpd_encoder_getmode>
    gicpd_encoder_getmode>
    ogicpd_encoder_getmode>
    gicpd_encoder_getmode>
    ogicpd_encoder_getmode>
    davincifb davincifb.0: dm_vid0_fb: 1216x684x16@0,0 with framebuffer size 4050KB
    DM365 IPIPEIF probed
    imp serializer initialized
    davinci_previewer initialized
    davinci_resizer initialized
    Serial: 8250/16550 driver, 2 ports, IRQ sharing disabled
    serial8250.0: ttyS0 at MMIO 0x1c20000 (irq = 40) is a 16550A
    console [ttyS0] enabled
    serial8250.0: ttyS1 at MMIO 0x1d06000 (irq = 41) is a 16550A
    brd: module loaded
    loop: module loaded
    NAND device: Manufacturer ID: 0xec, Chip ID: 0xf1 (Samsung NAND 128MiB 3,3V 8-bit)
    Bad block table found at page 65472, version 0x01
    Bad block table found at page 65408, version 0x01
    nand_read_bbt: Bad block at 0x000000040000
    nand_read_bbt: Bad block at 0x0000007a0000
    nand_read_bbt: Bad block at 0x000002480000
    nand_read_bbt: Bad block at 0x0000039c0000
    nand_read_bbt: Bad block at 0x000004a60000
    nand_read_bbt: Bad block at 0x000004f40000
    nand_read_bbt: Bad block at 0x000007700000
    Creating 4 MTD partitions on "davinci_nand.0":
    0x000000000000-0x000000400000 : "bootloader"
    0x000000400000-0x000000800000 : "kernel"
    0x000000800000-0x000000c00000 : "rootfs"
    0x000000c00000-0x000008000000 : "data"
    davinci_nand davinci_nand.0: controller rev. 2.3
    spi_davinci spi_davinci.0: Controller at 0xfec66000
    g_ether gadget: using random self ethernet address
    g_ether gadget: using random host ethernet address
    usb0: MAC 2a:c2:28:8b:90:6b
    usb0: HOST MAC aa:28:9a:26:ac:40
    g_ether gadget: Ethernet Gadget, version: Memorial Day 2008
    g_ether gadget: g_ether ready
    i2c /dev entries driver
    Linux video capture interface: v2.00
    vpfe_init
    vpfe-capture: vpss clock vpss_master enabled
    vpfe-capture vpfe-capture: v4l2 device registered
    vpfe-capture vpfe-capture: video device registered
    IndPico : switch to HD imager-MT9P031 video input
    Sanjeev::MT9P031-> Probing for the camera device...
    Sanjeev::MT9P031-> Camera device not detected!!!
    vpfe-capture vpfe-capture: v4l2 sub device mt9p031 register fails
    suresh:mt9m112_probe()
    Sanjeev::MT9M112-> Probing for the camera device...
    suresh:mt9m112 : f0 <= 0
    mt9m112 : page reg write failed !!!!!!!
    mt9m112 1-0048: No MT9M11x chip detected, register read ffffff87
    Sanjeev::MT9M112-> Camera device not detected!!!
    vpfe-capture vpfe-capture: v4l2 sub device mt9m112 register fails
    mt9v113 1-003c: No MT9V113 chip detected, register read ffffff87
    vpfe-capture vpfe-capture: v4l2 sub device mt9v113 register fails
    No sub devices registered
    vpfe_register_ccdc_device: DM365 ISIF
    dm365_isif: probe of dm365_isif failed with error -22
    af major#: 252, minor# 0
    AF Driver initialized
    aew major#: 251, minor# 0
    AEW Driver initialized
    vinci_display_init>
    Trying to register davinci display video device.
    layer=c669a000,layer->video_dev=c669a164
    Trying to register davinci display video device.
    layer=c669a400,layer->video_dev=c669a564
    davinci_init:DaVinci V4L2 Display Driver V1.0 loaded
    avinci_init>
    watchdog watchdog: heartbeat 60 sec
    davinci_mmc davinci_mmc.0: Using DMA, 4-bit mode
    TCP cubic registered
    NET: Registered protocol family 17
    Clocks: disable unused mmcsd1
    Clocks: disable unused spi1
    Clocks: disable unused spi2
    Clocks: disable unused spi3
    Clocks: disable unused spi4
    Clocks: disable unused pwm0
    Clocks: disable unused pwm1
    Clocks: disable unused pwm2
    Clocks: disable unused pwm3
    Clocks: disable unused timer1
    Clocks: disable unused timer3
    Clocks: disable unused emac
    Clocks: disable unused voice_codec
    Clocks: disable unused asp0
    Clocks: disable unused rto
    Clocks: disable unused mjcp
    RAMDISK: gzip image found at block 0
    g_ether gadget: full speed config #1: CDC Ethernet (ECM)
    VFS: Mounted root (ext2 filesystem) on device 1:0.
    Freeing init memory: 124K
    g_ether gadget: full speed config #1: CDC Ethernet (ECM)
  • Hi,

    It is running as full speed USB device. So theoretical maximum is 1.5MB/s and you are getting around 666KBps which is not very bad(considering the network overhead). Would suggest you to configure as High speed gadget. Also try to tune the Network related buffers of kernel and check.
  • In the pdf you linked to I couldn't find such maximum referenced, it was something of the order of 5-10MB/s, could you point me to where that value is mentioned?
    What sort of tuning do you recommend?
  • That is the standard, which you can find online for Full Speed USB. I am talking about tuning the kernel buffer sizes like read and write like in this link: wwwx.cs.unc.edu/.../network_tuning.php