[Speex-dev] Sound card problem in acoustic echo cancellation
steveu at coppice.org
Thu Jun 10 06:08:25 PDT 2010
On 06/10/2010 10:32 AM, LiMaoquan2000 wrote:
> From: Steve Underwood <steveu at coppice.org <mailto:steveu at coppice.org>>
> > It seems some cards use a PLL for their ADC, so they can lock to an
> > incoming SPDIF signal, but always use a local crystal clock source for
> > their DAC. These cards do not have their ADC and DAC synchronised.
> Do common on-board or PCI sound card lock to some incoming signal?
I already said they do, and what the lock to - SPDIF ports. Most modern
machines have one, and if they don't its generally still there in the
chipset, and there is simply no socket provided.
> Yes, there is a crystal oscillator and a PLL or divider to generate
> assigned clock signal. But if playing and capture are assigned the
> same sampling rate, why clock of ADC and DAC are not synchronised?
There seems no good reason why the DAC rate should not be synchronised
to the ADC rate. In reality, this frequently doesn't happen.
> 1. If it is a pure hardware sound card (no incoming SPDIF signal).
> Why not send ONE clock signal to ADC and DAC?
Because the ADC always runs from the same PLL source, presumably for
> 2. if it is a AC97 or HD sound card, clock frequencies of their hardware
> ADC and DAC are all fixed to 48/196KHz. Then why their are still not
Not really. They are *approx* 48kHz or *approx* 192kHz.
> > It seems like Skype's speakerphone works OK on these machines, so maybe
> > they do something tricky to measure the slip rate and resynchronise in
> > software. On the other hand, they might just fall back to a crude echo
> > suppression scheme. Skype seems to do a reasonable job, though.
> It is difficulty to measure the accurate difference between two sampling
> rate by a software in a short time. So I don't believe Skype do some kind
> of resynchronise or re-sampling work.
They have plenty of time. It is possible to do the necessary resync
*provided* the PLL doesn't drift around too much when it is not being
driven by a proper source. Concern about that point might make them
avoid it completely.
> From: Guilherme Balena Versiani <guibv at comunip.com.br
> <mailto:guibv at comunip.com.br>>
> > Yeah, the ADC and DAC work at different rates. I really don't know
> why these
> > soundcards are designed this way, but I can tell you that this is very
> > common. In fact, I didn't ever find a soundcard with the same
> capture and
> > render rates.
> If it is very common. I have tested more than 20 sound cards. Only 2
> sound cards
> have exactly the same capture and render rates.
> > If you want to sinchronize capture and render parts, you need to
> implement a
> > kind of buffer control, referenced as "skew control" (check it out).
> > is a very common control that removes or increases the delay when
> there is
> > not enough energy on the output stream (i.e. the voice being
> acquired by the
> > microphone).
> Sorry, I don't think so. It will cause sudden change of the echo delay
> is harmful to the adaptive filter of AEC.
> > But these kind of controls seem to put AEC of Speex crazy... When
> the skew
> > control occurs, normally the AEC stops to work fine.
> Yes, of course.
It is quite possible that most hardware actually has the ability to
select clocking arrangements that will ensure the ADC and DAC operate in
lock step. Maybe the facility just isn't exposed in a usable way. In the
end the reasons don't matter all the much. You have to live with what
More information about the Speex-dev