[wdmaudiodev] Re: Windows Clock Compensation

  • From: "Troy Gentry" <dmarc-noreply@xxxxxxxxxxxxx> (Redacted sender "tge96" for DMARC)
  • To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx>
  • Date: Wed, 18 Oct 2017 19:44:53 +0000 (UTC)

UAC inherits from USB base spec.  Specifically, for this topic, ISO transfer 
types :: Async, Sync, Adaptive.  It is the responsibility for UAC device to 
maintain buffer management (one method or another) ::

   
   - ISO Async - explicit vs implicit feedback mechanism --- audio buffers are 
maintained via the device explicitly telling the host that it is one sample 
ahead (-a), one sample behind (+1), or in lock step (0) via separate ISO 
feedback endpoint, or implied by the behavior of the recording stream (dynamic 
slight adjustments as noted for explicit)
   - ISO Sync - the UAC device is responsible to adjust it's local audio master 
clock to maintain buffer management
   - ISO Adaptive method is not as common


Unless the device/system is poorly implemented, above mechanisms are how audio 
buffers are managed for UAC systems.      From: Matthew van Eerde 
<dmarc-noreply@xxxxxxxxxxxxx>
 To: "wdmaudiodev@xxxxxxxxxxxxx" <wdmaudiodev@xxxxxxxxxxxxx> 
 Sent: Wednesday, October 18, 2017 11:46 AM
 Subject: [wdmaudiodev] Re: Windows Clock Compensation
   
#yiv8594650276 #yiv8594650276 -- .yiv8594650276EmailQuote 
{margin-left:1pt;padding-left:4pt;border-left:#800000 2px solid;}#yiv8594650276 
#yiv8594650276 #yiv8594650276 _filtered #yiv8594650276 {} _filtered 
#yiv8594650276 {font-family:Calibri;}#yiv8594650276 p.yiv8594650276x_MsoNormal, 
#yiv8594650276 li.yiv8594650276x_MsoNormal, #yiv8594650276 
div.yiv8594650276x_MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv8594650276 a:x_link, 
#yiv8594650276 span.yiv8594650276x_MsoHyperlink 
{color:blue;text-decoration:underline;}#yiv8594650276 a:x_visited, 
#yiv8594650276 span.yiv8594650276x_MsoHyperlinkFollowed 
{color:#954F72;text-decoration:underline;}#yiv8594650276 
p.yiv8594650276x_MsoListParagraph, #yiv8594650276 
li.yiv8594650276x_MsoListParagraph, #yiv8594650276 
div.yiv8594650276x_MsoListParagraph 
{margin-top:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt;font-size:11.0pt;}#yiv8594650276
 .yiv8594650276x_MsoChpDefault {} _filtered #yiv8594650276 {margin:1.0in 1.0in 
1.0in 1.0in;}#yiv8594650276 div.yiv8594650276x_WordSection1 {}#yiv8594650276 ol 
{margin-bottom:0in;}#yiv8594650276 ul {margin-bottom:0in;}#yiv8594650276 
Several things:    
   - Often inputs and outputs are from and to the same audio peripheral, which 
uses the same clock for render and capture. So although the clock may be off 
(e.g., 47.995 kHz instead of true 48 kHz), both the input clock and the output 
clock are off in the same direction by the same amount.
   - In cases like video conferencing where the input and output are on totally 
different device, skew compensation is done in software. For example, Windows 
offers the IAudioClockAdjustment interface at the WASAPI layer; if a VOIP app 
(say, Skype for Business) detects that one particular participant’s clock is 
running 0.03% slow, it can direct Windows to inject a 
micro-sample-rate-converter accordingly.
   - And no doubt there are situations where an app that does not do skew 
compensation tries to connect two devices that run on different clocks. In 
these cases there are inevitably pops and clicks.
 From: wdmaudiodev-bounce@xxxxxxxxxxxxx <wdmaudiodev-bounce@xxxxxxxxxxxxx> on 
behalf of Tim Roberts <timr@xxxxxxxxx>
Sent: Wednesday, October 18, 2017 11:40:34 AM
To: wdmaudiodev@xxxxxxxxxxxxx
Subject: [wdmaudiodev] Windows Clock Compensation We all know that crystals are 
not perfect.  Even if both ends of an
audio conversation agree to a nominal 48kHz sampling rate, with a 100ppm
crystal, the actual rate might be between 47,995 and 48,005 samples per
second.  And if the input and the output are on different boards, they
might be at opposite ends of that range.  And yet, we do not hear
complaints from users of cheap commodity hardware about periodic
glitches in their video conferences.

Why is that?  Is the Audio Engine compensating for this?  Is it
monitoring average byte-per-second rates over long periods and doing
smoothly adjusting the frames?  Or is it sheer luck that we don't get
pops and clicks?

-- 
Tim Roberts, timr@xxxxxxxxx
Providenza & Boekelheide, Inc.

******************

WDMAUDIODEV addresses:
Post message: mailto:wdmaudiodev@xxxxxxxxxxxxx
Subscribe:    mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=subscribe
Unsubscribe:  mailto:wdmaudiodev-request@xxxxxxxxxxxxx?subject=unsubscribe
Moderator:    mailto:wdmaudiodev-moderators@xxxxxxxxxxxxx

URL to WDMAUDIODEV page:
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.wdmaudiodev.com%2F&data=02%7C01%7CMatthew.van.Eerde%40microsoft.com%7Ce04d5f462bd14496954908d51657d572%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636439488899868903&sdata=j5IUCZBBNdJG3iuJWZXY9rBS8Y837Hpgk23dLudGK1Q%3D&reserved=0



   

Other related posts: