My understanding is that the SpkrQ is only as large as it is because the SpkrThread moves audio in bursts of 5-7 frames.  I have done some tests that support this.  If I can reduce the number of frames that back up before the SpkrThread processes them I should be able to shrink the SpkrQ. 

When the SpkrThread starts it imediately pulls 8 frames from the SpkrQ.  It sets up a callback to get more frames from the queue when windows notifies it that a frame has completed. I could probably save 30-40 ms by reducing the SpkrQ max size to 8 (if I need more than 8 I am going to have sound artifacts anyways), but I am hoping to drop it to 3 with DirectSound.  I have no idea if this is going to actually work or not.

As for whether I have enough experience to fight this problem... I will when I am done...

Charlie

Alexander Chemeris wrote:
Hello,


On 8/28/06, Charlie Hedlin <[EMAIL PROTECTED]> wrote:
I understand there is some delay in FromMic, but it seems to point to
most of the delay being in ToSpkr.  I tried reducing the preload, but
that had very undesirable effects. Does anyone think rewriting
SpeakerThreadWnt and the mic thread to use directx would likely help?

Yeah.. I'm thinking about it. But now I definitely have no time to implement
my thoughts. :(
But if you feel enough abilities to fight this problem -- I'll try to help you.

First thing you should take into account -- there is one data queue
between MicThread and FromMic and there is one more queue between
ToSpkr and SpkrThread. You coud look into attached picture for
flowgraph-to-flowgraph echo path. In my experience under Windows
longest queue is speaker queue, but mic queue is not empty too.
This may queues introduce about 200ms delay (20 msgs).

To solve this we should noticeably rewrite media task under Windows.
Media task is responsible for synchronisation of three threads: mic,
speaker and flowgraph. It is not so easy to decide how to this the best.
And I'm not sure will DirectShow help here or not. This is a point to
more testing.

You may create simple flowgraph with FromMic connected to ToSpkr
to play with this. As an idea how to do this you may use unittests for
mediaLib -- they creates very simple flowgraphs. I've done this way
some time ago to test echo path delay.


Regards,

Alexander Chemeris.




_______________________________________________ sipxtapi-dev mailing list [email protected] List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/


_______________________________________________
sipxtapi-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipxtapi-dev/

Reply via email to