From: Steve K. <st...@st...> - 2004-03-15 16:52:21
|
Steven Sokol wrote: >I have been playing with IAX Phone and the library in an attempt to >determine what is the cause of the fairly large delay that seems to take >place when using IAX phone. > >From what I can tell, the process of encoding the PC's linear PCM stream >into GSM packets is fairly fast. The process of decoding GSM frames into a >linear PCM stream is fairly slow. This is anecdotal, but is seems fairly >consistent from PC to PC. > >The delay for audio data coming FROM my IAX Phone and going TO my >Grandstream BT101 (and through my Asterisk where it is trans-coded from GSM >to G.711) is minimal - perhaps 100-200ms. The delay for sound FROM the >Grandstream to IAX Phone through Asterisk (which again trans-codes the g.711 >to GSM) is MUCH larger -- perhaps as much as 750-1000ms. > >I suppose the additional delay could be the fault of the Asterisk in the >middle, but somehow I seriously doubt it. Does anybody out there have any >guess as to the culprit? In testing the same scenarios with Firefly, I >found that the latency is noticeably less. Does this indicate PA, or >perhaps the version of the GSM code, or is it the set of ring buffers in the >audio interface? > >Any suggestions would be helpful! > > It's not the decoding; the major source of delays is portaudio, and you can control this to some extent with the environment variable. See http://sourceforge.net/mailarchive/message.php?msg_id=7258386 and the messages it refers to earlier in the list archives. We are looking at this ourselves, in order to try and tune out some latency. Currently, we're a) Using the portaudio defaults, which may or may not be too conservative. b) Not necessarily shrinking internal ringbuffers as we could. So, what I'd suggest that would be helpful, is to play with the environment variable a bit, and post results to the list. You can definitely cut it down, and get an immediate and measurable decrease in playback latency. |