Round-trip latency of USB Audio is not stable Topic is solved

If you have a simple question and just want an answer.
xmosfan
Member
Posts: 12
Joined: Tue Dec 13, 2016 9:45 am

Round-trip latency of USB Audio is not stable

Postby xmosfan » Wed Dec 21, 2016 12:08 pm

Hello.
I'm checking the round-trip latency of USB Audio with XK-AUDIO-216-MC and PC (Windows 7 Pro SP1).
I added loop-back to the mixer module of XMOS FW - USB Audio 2.0 Device Software Ver.6.12.5, and measured interval between USB Audio Out and In.
I used Thesycon USB ASIO Driver Ver.3.34. Following is the setting of TUSBAudio Control Panel and round-trip latency (USB Audio Out - In) and total latency of application at 44100Hz sample rate.

<Sample Rate: 44100Hz, USB Streaming Mode: Minimum Latency, ASIO Buffer Size: Auto>
USB Audio Out - IN: 498us
Total Latency of App: 273samples

I tried about 10 times, the results were stable - 498us. Then, I changed sample rate like following, and measured again.

44100Hz => 48000Hz => 44100Hz

<Sample Rate: 44100Hz, USB Streaming Mode: Minimum Latency, ASIO Buffer Size: Auto>
USB Audio Out - IN: 373us
Total Latency of App: 267samples

I tried about 10 times, the results were stable - 373us.
It seems that this change is occurred by reopening USB Audio stream and changing sample rate.

Why is the round-trip latency in XMOS changed? Host PC shouldn't affect this latency.
I changed the USB Streaming Mode of TUSBAudio Control Panel to Extra Safe.

<Sample Rate: 44100Hz, USB Streaming Mode: Extra Safe, ASIO Buffer Size: Auto>
USB Audio Out - IN: 498us
Total Latency of App: 5869samples

44100Hz => 48000Hz => 44100Hz

<Sample Rate: 44100Hz, USB Streaming Mode: Extra Safe, ASIO Buffer Size: Auto>
USB Audio Out - IN: 373us
Total Latency of App: 5862samples

Difference of the round-trip latency (USB Audio Out - In) is 125us (=5.5125samples at 44100Hz).
Difference of the total latency of application is 6 or 7 samples.
They are nearly equal. I would like to the round-trip latency be stable.
I added zip file which include png files of USB log.

Thank you in advance.
Attachments
RoundTripLatency.zip
(713.15 KiB) Downloaded 174 times
RoundTripLatency.zip
(713.15 KiB) Downloaded 174 times
View Solution
User avatar
Ross
XCore Expert
Posts: 768
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Wed Jan 18, 2017 11:31 am

This could well be due to underflow checks not properly accounting for different packet sizes in async mode. Have you tried the latest FW version?
xmosfan
Member
Posts: 12
Joined: Tue Dec 13, 2016 9:45 am

Postby xmosfan » Thu Mar 30, 2017 3:53 am

Sorry for late to reply. No, I have not yet. Because I use patch file - decouple.xc which improve latency. It does not work with 6.15.2. If you want to know about the detail of patch file, please contact to me directly.
I tried to use the latest FW 6.15.2 with Explicit Feedback and not improved latency.

----------------------
1st trial
----------------------
<Sample Rate: 44100Hz, USB Streaming Mode: Minimum Latency, ASIO Buffer Size: Auto>
USB Audio Out - In: 3497us
Total Latency of App: 405 samples

44.1kHz -> 48kHz -> 44.1kHz

<Sample Rate: 44100Hz, USB Streaming Mode: Minimum Latency, ASIO Buffer Size: Auto>
USB Audio Out - In: 3377us
Total Latency of App: 401 samples

Difference of the round-trip latency (USB Audio Out - In) is 120us (=5.292samples at 44100Hz).
Difference of the total latency of application is 4 samples.

----------------------
2nd trial
----------------------
<Sample Rate: 44100Hz, USB Streaming Mode: Minimum Latency, ASIO Buffer Size: Auto>
USB Audio Out - In: 4252us
Total Latency of App: 437 samples

44.1kHz -> 48kHz -> 44.1kHz

<Sample Rate: 44100Hz, USB Streaming Mode: Minimum Latency, ASIO Buffer Size: Auto>
USB Audio Out - In: 4627us
Total Latency of App: 454sample

Difference of the round-trip latency (USB Audio Out - In) is 375us (=16.5375samples at 44100Hz).
Difference of the total latency of application is 17 samples.

In conclusion, it seems that the fluctuation of round-trip latency is related to the internal latency of XMOS.
DAW needs the information of stable latency value from the audio device via ASIO driver. But I can't define the value by this problem.
Please give me some advice.
Last edited by xmosfan on Thu Dec 07, 2017 6:14 am, edited 1 time in total.
xmosfan
Member
Posts: 12
Joined: Tue Dec 13, 2016 9:45 am

Postby xmosfan » Thu Mar 30, 2017 5:08 am

xmosfan wrote:I tried to use the latest FW 6.15.2 with Explicit Feedback and not improved latency.

I checked USB log with above FW. Even though `UAC_FORCE_FEEDBACK_EP' is defined, I couldn't see the transaction of EP1 IN for Explicit Feedback. (I confirmed that EP1 IN exists in Endpoint Descriptor.)
Then, I checked USB log with 6.12.5. There is no transaction of EP1 IN, too.
Under the emvironment - Windows and Thesycon driver, does Explicit Feedback work properly? I don't know there is relation between unstable round-trip latnecy and this symptom whether or not.
Unchyu2
Member++
Posts: 29
Joined: Tue Jun 17, 2014 11:40 am

Postby Unchyu2 » Tue Jun 06, 2017 4:08 pm

Hello,

We are experiencing the same issue, have you had any luck in stabilizing the round-trip latency?

I can add that we have tested this and we have observed the same inconsistency both on Windows 10 using CEntrance ASIO Latency Test Utility and on Linux using jack_iodelay toolkit.
We have also tested this with two development boards: xCORE-200 Multichannel Audio Platform and xCORE-200 sliceKIT.

Is is something in the USB AUDIO 2.0 firmware that we can change in order to solve this?

Thank you in advance,
Ilie
xmosfan
Member
Posts: 12
Joined: Tue Dec 13, 2016 9:45 am

Postby xmosfan » Wed Jun 07, 2017 2:46 am

Unchyu2 wrote:We are experiencing the same issue, have you had any luck in stabilizing the round-trip latency?

No. I could not find the way to stabilize the latency.
I guess that XMOS has fluctuation of latency. At least, it is a few micro frame (n x 125us).
Unchyu2
Member++
Posts: 29
Joined: Tue Jun 17, 2014 11:40 am

Postby Unchyu2 » Wed Jun 07, 2017 10:30 am

Thank you for your reply.
Jokke
Newbie
Posts: 1
Joined: Wed Feb 21, 2018 1:49 pm

Postby Jokke » Wed Feb 21, 2018 1:53 pm

Hey
We are having the same issues, any news?
xmosfan
Member
Posts: 12
Joined: Tue Dec 13, 2016 9:45 am

Postby xmosfan » Thu Feb 22, 2018 1:20 am

Jokke wrote:Hey
We are having the same issues, any news?

No. I have decided the Terminal Latency value in the descriptor by the first measurement.
1. Connect to PC
2. Select driver setting
3. Measure Latency
User avatar
Ross
XCore Expert
Posts: 768
Joined: Thu Dec 10, 2009 9:20 pm

Postby Ross » Thu Feb 22, 2018 12:39 pm

Unchyu2 wrote:I checked USB log with above FW. Even though `UAC_FORCE_FEEDBACK_EP' is defined, I couldn't see the transaction of EP1 IN for Explicit Feedback. (I confirmed that EP1 IN exists in Endpoint Descriptor.)
Then, I checked USB log with 6.12.5. There is no transaction of EP1 IN, too.
Under the emvironment - Windows and Thesycon driver, does Explicit Feedback work properly? I don't know there is relation between unstable round-trip latnecy and this symptom whether or not.


The Thesycon driver implementation ignores the feedback pipe and always uses the input stream when available. You should see it use it for and output only device.

Who is online

Users browsing this forum: Patriotwle and 25 guests