doing it this way, is as Tim says an "extremely tricky problem" - agreeddoing
it this way, will likely produce noticeable audible synchronization clocking
artifacts in the actual audio stream itself (depending on the actual clock
mismatch between the USB Host and the USB device)
if this is all one has for their audio buffer management mechanism, then
switching to ASYNC synchronization method would be highly recommended.
From: Akshaykeerti Sharma <asharma@xxxxxxxxxxxxxxxxxxxxx>
To: wdmaudiodev@xxxxxxxxxxxxx
Sent: Wednesday, October 18, 2017 4:51 PM
Subject: [wdmaudiodev] Re: Windows Clock Compensation
Yes, we are monitoring the micro controller queues live to ensure that there is
no problem. If I remember correctly the usb audio 1.0 spec we are using
transmits 48samples/ms(48khz) in our implementation. Making a very small change
to our I2S reference clock(this is what drives the audio out to a speaker
essentially) controls the FIFO queue. The trim setting on the micro is accurate
enough to ensure precise enough changes to the clock to sometimes even match
the input data stream.
Another way is to sync to the usb frame start of frame which results in getting
the same information. You would sync to the start frame and up/down the clock
appropriately.
The disadvantage is that we are introducing harmonic distortion in the signal.
Albeit it is small enough to have no noticeable difference on the not-so-great
speaker.
Again, this is using the USB synchronous mode.
Since the digital stream on the microconroller side is continuous if you start
over/underflowing data it really messes up the sound. Currently our
implementation works without any discontinuity. We still have some qualitative
tests to do to ensure that the reproduction is top notch.
For a high quality audio application I would recommend ASYNC mode to control
the data stream in software.
Sent from my iPhone
On Oct 18, 2017, at 4:40 PM, Tim Roberts <timr@xxxxxxxxx> wrote:
Akshaykeerti Sharma wrote:
One possible solution we implemented for usb-audio using synchronous
mode was to adjust the reference clocks on the micro-controller in
realtime by a very small amount to ensure that there are no
underflow/overflow conditions that manifest themselves as
pops/clicks(we did have pops and clicks otherwise)
How would you know? By monitoring the levels in your onboard FIFOs?
This is an extremely tricky problem, because even though audio seems to
be smoothly continuous, at the microscopic level it is rather chunky.
Audio Engine tries to transfer 10ms at a time, and applications commonly
work in buffers even larger than that.
--
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:
http://www.wdmaudiodev.com/