UAC1 explicit feedback, full-duplex on Windows

95 views
Skip to first unread message

adolf....@dsignt.de

unread,
Mar 20, 2019, 10:06:39 AM3/20/19
to Audio-Widget
Hi all,

I am trying to implement UAC on a DSP data acquisition board. The code is not related to the audio-widget project, however, I hope that your long experience with the audio-widget project may provide some help...

I plan to finally implement UAC2, but started with UAC1. I use asynchronous mode with explicit feedback.

DAC playback works fine. The feedback value is adjusted in a +/-1 sample per frame range to compensate the host-device timebase mismatch. I get no buffer overflows or underruns.
ADC recording is also ok, the number of samples per frame is again adjusted +/-1 depending on the sample buffer filling level (implicit feedback).
But if I try full-duplex, i.e playback during record at 44.1kHz, the number of received DAC samples per frame drop from the nominal 44-45 samples to
39-40, with sporadic peaks at 48-49, although the feedback values remain identical to DAC-only half duplex mode.

This problem exists on Win7-64 and Win10 (18.09). If I disable feedback and remove the feedback endpoint descriptor, the average number of DAC samples in full duplex mode stays constant at 44-45, but since the host and DSP device clocks drift, periodic buffer underruns occur. So, implicit feedback seems not supported.

Has anyone ever experienced a similar behaviour? Can you confirm that UAC1 explicit feedback works on Windows full-duplex ?

Many thanks!
-- Adolf

Børge Strand-Bergesen

unread,
Mar 20, 2019, 4:34:24 PM3/20/19
to audio-...@googlegroups.com
Hi Adolf,

My impression is that DAC-only uses the feedback endpoint, while DAC+ADC uses the ADC sample rate to tell the Host which rate to use for the DAC. And that for the two of them combined there should be no FB EP.

However, I don’t remember the source of that off the top of my head. 

Also, in the AW code the delta for the FB EP is +-64. I believe that was for compatibility with Win7 but it is something I haven’t fiddled with. The verification effort just wasn’t worth it, stability was good.

FB uses stpecial fixed-point formats to convey ssmple rate in Hz. But for the ADC rate is determined from the data rata. The Host may very well do that in jumps as long as the average sample rates of DAC and ADC match.

Best,
Børge
--
You received this message because you are subscribed to the Google Groups "Audio-Widget" group.
To unsubscribe from this group and stop receiving emails from it, send an email to audio-widget+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adolf Klemenz

unread,
Mar 21, 2019, 11:38:11 AM3/21/19
to audio-...@googlegroups.com
Hi Borge,

many thanks for your feedback! (pun intended)

I finally solved this issue - a very silly mistake: the USB controller
used in this DSP has a unified internal buffer memory which needs to be
partitioned to the active endpoints. This is done with a granularity of
8 bytes, but I used the 3 byte size from the feedback endpoint
descriptor wMaxPacketSize, which violated the memory layout. This had no
effect on DAC playback only, but as soon as the ADC IN endpoint was
active, the feedback endpoint data was overwritten with ADC data.


Am 20.03.2019 um 21:34 schrieb Børge Strand-Bergesen:
> My impression is that DAC-only uses the feedback endpoint, while DAC+ADC
> uses the ADC sample rate to tell the Host which rate to use for the DAC.
> And that for the two of them combined there should be no FB EP.

I cannot confirm this: on the two Windows systems I tested (Win7 and
Win10 18.09), UAC1 does not support this kind of implicit feedback. A
Feedback endpoint is required in any case.


> Also, in the AW code the delta for the FB EP is +-64. I believe that was
> for compatibility with Win7 but it is something I haven’t fiddled with.
> The verification effort just wasn’t worth it, stability was good.

64 corresponds to a 4Hz sampling frequency change. On my Win7 system
smaller deltas are supported too (minimum 1 Hz). Maybe +/-64 was
required for early Win7 releases...

Many thanks!
-- Adolf

Reply all
Reply to author
Forward
0 new messages