Sending TDM samples over UDP
Posted: Fri Apr 10, 2020 10:18 am
Hi,
I want to send TDM audio samples to a PC using UDP. I'm using the xCore-200 Multichannel board directly connected with an ethernet cable to the PC.
I'm currently using the lib_xtcp (ver 6.1.0) and lib_i2s (ver 2.3.0).
The communication between the TDM and UDP tasks, and the buffers are similar to the AVB application note (AN00203): there are 2 buffers (which are swapped as soon as one is full) and I send through the tasks the address of the buffers (not the buffers themselves).
I managed to make it work with 8 channels (1 TDM8 input line) buffering 4 samples for each channel.
So the length of the buffer sent through UDP was: 8channels*4samples = 32 int32_t
Then I tried to increase the number of channels to 16 (2 TDM8 input line) keeping the number of buffered samples to 4.
After some debugging I noticed that the TDM task filled the buffer quicker than the UDP task was able to send the other. I tried to reduce the number of samples buffered to 2 (in this way I was sending the same amount of data of the 8 channel configuration) but without success.
I think that the only difference between the 2 configurations (keeping the amount of sent data equal) is the number of TDM callbacks.
Can this affect the performance of the UDP task or am I not seeing the real problem?
I know that is difficult to understand the structure of the code without seeing it so I can share with you the parts you want to see to better understand.
Thank you
I want to send TDM audio samples to a PC using UDP. I'm using the xCore-200 Multichannel board directly connected with an ethernet cable to the PC.
I'm currently using the lib_xtcp (ver 6.1.0) and lib_i2s (ver 2.3.0).
The communication between the TDM and UDP tasks, and the buffers are similar to the AVB application note (AN00203): there are 2 buffers (which are swapped as soon as one is full) and I send through the tasks the address of the buffers (not the buffers themselves).
I managed to make it work with 8 channels (1 TDM8 input line) buffering 4 samples for each channel.
So the length of the buffer sent through UDP was: 8channels*4samples = 32 int32_t
Then I tried to increase the number of channels to 16 (2 TDM8 input line) keeping the number of buffered samples to 4.
After some debugging I noticed that the TDM task filled the buffer quicker than the UDP task was able to send the other. I tried to reduce the number of samples buffered to 2 (in this way I was sending the same amount of data of the 8 channel configuration) but without success.
I think that the only difference between the 2 configurations (keeping the amount of sent data equal) is the number of TDM callbacks.
Can this affect the performance of the UDP task or am I not seeing the real problem?
I know that is difficult to understand the structure of the code without seeing it so I can share with you the parts you want to see to better understand.
Thank you