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.
Tool/software:
Hello,
LwIP describes socket API as part of "Sequential-style APIs, blocking functions. More overhead, but can be called from any thread except TCPIP thread.".
I'm trying to stream RTP using UDP on my AM2732 but noticed that many of the packets going out were corrupted.
I'm aware that a cache invalidate needs to be performed on the send buffer before sending, and that the send buffer should be a multiple of the cache size:
#define R5F_CACHE_LINE_SIZE (32) #define UTILS_ALIGN(x, align) ((((x) + ((align)-1)) / (align)) * (align)) static u8_t rtp_send_packet[UTILS_ALIGN(RTP_PACKET_SIZE, R5F_CACHE_LINE_SIZE)] __attribute__ ((aligned(R5F_CACHE_LINE_SIZE), section(".bss:UDP_SND_BUF"))); /*...*/ do { /*...*/ CacheP_wbInv(rtp_send_packet, sizeof(rtp_send_packet), CacheP_TYPE_ALLD); if (lwip_sendto(sock, rtp_send_packet, sizeof(struct rtp_hdr) + rtp_payload_size, 0, (struct sockaddr *)to, sizeof(struct sockaddr)) >= 0) { /*...*/ } while (rtp_data_index < sizeof(rtp_data)); /*...*/
Is this the expected solution to this problem? If not, what would be the correct approach to ensure data integrity without significantly impacting performance?
Thank you