I have encountered an issue with the client suddenly throwing out a lot of " Discarding UDP packet due to EAGAIN" messages (about 4 pr ms and up to a couple of thousand at the time).
I don't know exactly why this happens but i suspect it happens when there are a lot of traffic on my WiFi or other WiFis on the same channel in the vicinity (2.4GHz). So if my WiFi adapter is in collision avoidance mode (waiting to transmit) the buffer will fill up and therefore the socket throws out the EAGAIN message. I also notice from wireshark dumps that the last packet before the EAGAIN messages is neither transmitted nor reported as discarded.
After a series of these EAGAIN message the audio becomes glitchy and sometimes never recover. I suspect that the client tries to write the same audio packet to the socket over and over while at the same time incrementing the sequence number.
I was able to solve the issue by adding the lines:
block->index += block->length;
block->length = 0;
after the udp packet has been discarded in the send udp audio packet function. But I don't know if that's the best way to solve it.
I have encountered an issue with the client suddenly throwing out a lot of " Discarding UDP packet due to EAGAIN" messages (about 4 pr ms and up to a couple of thousand at the time).
I don't know exactly why this happens but i suspect it happens when there are a lot of traffic on my WiFi or other WiFis on the same channel in the vicinity (2.4GHz). So if my WiFi adapter is in collision avoidance mode (waiting to transmit) the buffer will fill up and therefore the socket throws out the EAGAIN message. I also notice from wireshark dumps that the last packet before the EAGAIN messages is neither transmitted nor reported as discarded.
After a series of these EAGAIN message the audio becomes glitchy and sometimes never recover. I suspect that the client tries to write the same audio packet to the socket over and over while at the same time incrementing the sequence number.
I was able to solve the issue by adding the lines:
block->index += block->length;
block->length = 0;
after the udp packet has been discarded in the send udp audio packet function. But I don't know if that's the best way to solve it.