Re:synchronization of Acoustic echo cancellation inputs RRS feed

  • Question

  • I am working in Acoustic echo cancellation algorithms, algorithm is working fine in stand alone cases(for simulated audio files). But in real time facing the problem of synchronization of input samples, such that what are samples I am rendering to the loud speaker and samples captured from the microphone are not matching in time, there is a random lag between the samples(some times 500 to 600ms). I am using windows XP OS and realtek AC'97 sound card. I gone through some websites, some authors revealing that for sample accurate synchronization ASIO is the best bet. Actually I dont know much about driver programming. My doubt is can we able to achieve such low latency as in ASIO with Windows drivers using any other methods apart from ASIO.

    i am waiting for desperate assistance, please help me
    Tuesday, June 30, 2009 10:01 AM

All replies

  • I'm not sure what XP offers to AEC developers.  I know that in Vista and Win7 WASAPI has a number of features targeted towards this scenario; for example, loopback capture allows you to see what's heading out of the speakers, and you can query the latency at both ends.

    Loopback capture sample:

    Matthew van Eerde
    Thursday, July 2, 2009 5:39 PM
  • The reason ASIO may have been recommended is because input and output are synchronous, i.e. buffer transfer for input and output are done in the same operation.  Additionally latency is typically fixed (to a configurable value).  However ... the big catch is that ASIO is only available from vendors that have written an ASIO driver, which is few and far between for consumer audio hardware.  You could try with ASIO4ALL, but because that is a wrapper over kernel streaming there is no guarantee that input and output remain synchronous.
    Thursday, July 2, 2009 9:24 PM
  • Thank you very much for your suggestions.
    Monday, July 6, 2009 11:55 AM
  • Dear  Matthew van Eerde,

     I gone through the links, what you provided for the reference of loop back capture(records what you hear). Actually iam very new to this task, dont know much about loopback capture. If it is possible, I need a brief explaination and basic fundamentals about the loopback capture feature.

     I am waiting curiously for your reply....... 
    Monday, July 6, 2009 12:09 PM
  • Thanks for the suggesstions, I already tried with ASIO4ALL but i dont want to use ASIO family due to some reasons, could I able to achive low latency (accurate synchronization) using any other methods or techniques(except ASIO)?........

    plz reply me.......

    Monday, July 6, 2009 12:13 PM
  • You can use DirectSound in full duplex mode which will be synchronized between input and output if supported in the hardware.  The output latency will be a little bit higher due to the kernel mixer (around 25ms).  To bypass the kernel mixer the only option is to use kernel streaming (which is what ASIO4ALL uses underneath) which will achieve very low latency, and you will have exclusive access to the device.
    Monday, July 6, 2009 4:02 PM
  • DirectSound is a wrapper around WASAPI.  The kernel mixer was removed in Vista; you can get very good latency using WASAPI exclusive mode, particularly on WaveRT devices.
    Matthew van Eerde
    Tuesday, July 7, 2009 5:33 PM
  • Very few developers get the choice to use WASAPI unless they want to write their code twice.  70% of the Microsoft users are still running XP compared to the 27% running Vista.  I'm still surprised by the number of Windows 2K systems I keep running into and have to support.
    Tuesday, July 7, 2009 8:45 PM
  • Dear  Matthew van Eerde,

    I gone through the AEC system filter architecture. As AEC system filter is accessing, like that could we able to access the Wave device directly (to get low latency)for our application?... 
    Wednesday, July 15, 2009 1:44 PM