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.

CC3220SF: UDP Jitter

Part Number: CC3220SF

Hi TI!

I am receiving video (UDP) from a camera and retransmitting it. But there are visible delays in the video playback.

The code I do it on the udpecho sample project (SDK 6_10). I removed all code on the udpEcho.c file and put my own code, so I take advantage of the part of the access point connection code.

I show the thread that receives and transmits the video packets. The thread has priority 1, if I increase the priority to 5 there is no improvement, and if I increase the priority to a higher number 12, 20, 30 it does not work.

What can you recommend me to increase the speed and have better video playback?

Thank yuo very much. 

Best regards. 

Void task_camera_udp(UArg arg0, UArg arg1)
{

for (;;)
{

_i8 buffer[1500];
_i16 RecBytes = sl_RecvFrom(socket_udp_camera, buffer, 1500,0, (SlSockAddr_t *)&UDPCameraAddr, (SlSocklen_t*)&AddrSize);
if(RecBytes > 0){
status = sl_SendTo(socket_udp_client, buffer, RecBytes, 0, (SlSockAddr_t *)&UDPClientAddr, AddrSize);
}

Task_sleep(1);

}
}

  • Hi,

    It depends on the main reason for the latency (Wi-Fi?, UDP?, RTOS?, other).

    When you increase the priority too high above the SL task which I believe is set to 9, unexpected behavior may happen since the SL task is the host driver task which handles all activities with the device.

    It could be that the device goes into power save mode and thus it takes time until the next beacon wakeup to pull more packets.

    Air sniffer captures would probably shed some light here if you have this option.

    what I suggest to quickly see if there is an improvements is to place the device in always-on in terms of power save and see if it makes a difference.

    the way to do it is:

    sl_WlanPolicySet(SL_WLAN_POLICY_PM , SL_WLAN_ALWAYS_ON_POLICY, NULL,0)

    regards,

    Shlomi

  • Hi Shlomi Itzhak

    Thank you very much. 

    I have tested it but there is no improvement.

    Can we try more things? Please.

    The playback seems 1 or 2 seconds smooth and the next second is delayed and so on continuously.

    Best Regards.

  • this is the only straightforward step I can suggest.

    from this point, we need to see an air sniffer to understand what is going on.

    can you provide the followings:

    • what is the amount of data you send to the device? what is the expected throughput?
    • are you sure the transmitting side isn't stalling?
    • are you testing in a clean environment?

    Shlomi

  • Hi Shlomi!

    I have big improvements. Now much better.

    If in the thread I change Task_sleep(1) to Task_sleep(0)

    However, there is still some delay at some points.

    How can I increase the system speed?
    (Of course I have already tried increasing the thread priority).
    Maybe the DMA or increase the PLL frequency?
    Please could you also provide me with some sample code of a possible solution? solution.

    Thank you very much. 

    Attached the thread code.

    Void task_camera_udp(UArg arg0, UArg arg1)
    {

    for (;;)
    {

    _i8 buffer[1500];
    _i16 RecBytes = sl_RecvFrom(socket_udp_camera, buffer, 1500,0, (SlSockAddr_t *)&UDPCameraAddr, (SlSocklen_t*)&AddrSize);
    if(RecBytes > 0){
    status = sl_SendTo(socket_udp_client, buffer, RecBytes, 0, (SlSockAddr_t *)&UDPClientAddr, AddrSize);
    }

    Task_sleep(0);

    }
    }

  • Hi,

    There is no magic solution here without understanding where the stall is coming from.

    If you had a delay then it makes sense to remove it as you did.

    The communication with the NWP already works with DMA so nothing can be done there.

    As I suggested, to understand more please provide:

    • what is the amount of data you send to the device? what is the expected throughput?
    • are you testing in a clean environment?

    An air sniffer would shed light if you can have it.

    Regards,

    Shlomi