Hi all experts,
First I'll try to explain what our software is doing and then I'll give a description of the problem.
We have three applications :
- one application is reading analog audio from the audio card and converts it to an audio stream using the GSM 6.10 CODEC. The delphi component used for doing this is droopy eyes. After the conversion to the stream is done, the application sends this stream out to another application using UDP
- the second application receives the stream and sends it out via TCP/IP to a number of connected clients. No audio components are used here, only the Indy 9.0 Delphi components for read the multicast and send it out over TCP/IP. This application is in fact the TCP server.
- the third application (client application) receives the audio signal via a TCP/IP client and delivers the stream packet to the Droopy Eyes component who convert the stream back to analog audio.
As you al may know, TCP/IP is an ACK/NACK protocol causing one packet to be send, an ACK send from the client application and then sending the next packet. So, TCP/IP always waits for sending a new packet untill an ACK is received from the previous sent packet.
There is an option in the TCP layer TCP_NO_DELAY which allows tcp/ip to not waiting an ACK before sending the next packet.
It is necessary to set this option because the packets need to go out fluently to have a good steady audio connection.
Now following problems occur :
- sometimes a client with a bad connection did not ack the last x (can be 25 for example) packets yet causing the TCP server to halt and wait untill he receives ACKs again. This causes all clients to not have an audio signal for some time since the TCP server is completeley blocking
- Sometimes the audio signal is scrambled and it is not clear in any way anymore. This seems to be because several packets are stuck together causing the Droopy Eyes buffer to generate a too big load and not processing the packet.
My questions :
- is there any way that we can infuence TCP/IP to not wait on the ACKs so our server application is not blocking
- can we set an option so packets are NEVER stuck together
- and off course any advice on any level is welcome