* Fast Track Ultra latency and new streaming logic.
@ 2012-05-01 0:18 Grant Diffey
2012-05-01 13:09 ` Felix Homann
` (2 more replies)
0 siblings, 3 replies; 11+ messages in thread
From: Grant Diffey @ 2012-05-01 0:18 UTC (permalink / raw)
To: Daniel Mack, Felix Homann; +Cc: alsa-devel
Daniel,
In continuing my personal habit of looking gift horses in the mouth...
I can't seem to get below 512frames in flight (2 256sample frames or 4 128
or 8 64's) without consistant overruns.
I have a feeling that the pcm <-> urb layer is buffering until a urb is max
urbsize from a quick look at the code does this seem like the right track?
This leads to rather high latencies (22ms+) or is this conclusion bogus?
Grant.
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Fast Track Ultra latency and new streaming logic.
2012-05-01 0:18 Fast Track Ultra latency and new streaming logic Grant Diffey
@ 2012-05-01 13:09 ` Felix Homann
2012-05-02 8:41 ` Daniel Mack
2012-05-03 8:39 ` Felix Homann
2 siblings, 0 replies; 11+ messages in thread
From: Felix Homann @ 2012-05-01 13:09 UTC (permalink / raw)
To: Grant Diffey; +Cc: alsa-devel, Daniel Mack
Hi,
Am 01.05.2012 02:18 schrieb "Grant Diffey" <gdiffey@gmail.com>:
> I can't seem to get below 512frames in flight (2 256sample frames or 4
128 or 8 64's) without consistant overruns.
Yes, I noticed this, too. I carelessly attributed this to the kernel used
for my testing being non-realtime, non-lowlatency. Somehow I forgot to
further investigate...
What could you achieve with the old streaming logic? I think I could go
down to 2x128 frames.
(I'm typing this on my phone and can't tell reliably. I will post an update
as soon as I'm back at my machines/FTU.)
Regards,
Felix
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Fast Track Ultra latency and new streaming logic.
2012-05-01 0:18 Fast Track Ultra latency and new streaming logic Grant Diffey
2012-05-01 13:09 ` Felix Homann
@ 2012-05-02 8:41 ` Daniel Mack
2012-05-03 8:39 ` Felix Homann
2 siblings, 0 replies; 11+ messages in thread
From: Daniel Mack @ 2012-05-02 8:41 UTC (permalink / raw)
To: Grant Diffey; +Cc: alsa-devel, Felix Homann
On 01.05.2012 02:18, Grant Diffey wrote:
> In continuing my personal habit of looking gift horses in the mouth...
Testing is much appreciated :)
> I can't seem to get below 512frames in flight (2 256sample frames or 4
> 128 or 8 64's) without consistant overruns.
>
> I have a feeling that the pcm <-> urb layer is buffering until a urb is
> max urbsize from a quick look at the code does this seem like the right
> track?
No, it doesn't. The implicit feedback streaming model waits for capture
urbs to arrive and then sends back an urb with the same amount of data
for playback. Hence, the number of bytes per playback urb is defined by
the device and the stream it sends to the host.
> This leads to rather high latencies (22ms+) or is this conclusion bogus?
The urb length can't possibly lead to such latencies. With a sample
frequency of 44100 Hz and a stereo stream @16bit, we're dealing with a
data rate of 176400 bytes/s. Even with max urbsizes of 512 bytes, an urb
can only hold ~2,9ms of audio data. With more streams, higher sample
rates or deeper samples, this number is declining. So this can't be the
reason.
Also, I doubt that the rewrite of the streaming code is to blame for
what you're seeing, as it just changed the logical view on internal
structures. The streaming behaviour itself should remain the same.
What you could do, though, is disabling the FTU quirk in
sound/usb/pcm.c:set_format(). That should in theory restore the old
streaming logic. Does that change anything?
Daniel
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Fast Track Ultra latency and new streaming logic.
2012-05-01 0:18 Fast Track Ultra latency and new streaming logic Grant Diffey
2012-05-01 13:09 ` Felix Homann
2012-05-02 8:41 ` Daniel Mack
@ 2012-05-03 8:39 ` Felix Homann
2012-05-03 14:03 ` Felix Homann
2012-05-03 14:13 ` Clemens Ladisch
2 siblings, 2 replies; 11+ messages in thread
From: Felix Homann @ 2012-05-03 8:39 UTC (permalink / raw)
To: Grant Diffey; +Cc: alsa-devel, Daniel Mack
Hi,
2012/5/1 Grant Diffey <gdiffey@gmail.com>:
> I can't seem to get below 512frames in flight (2 256sample frames or 4 128
> or 8 64's) without consistant overruns.
at least at 44.1 and 48 kHz I can get it to run without consistent
xruns with 3 periods/buffer and 128 frames/period.
For 88.2 and 96 kHz I need to go to 4 periods/buffer. Less than 128
frames/period lead to consistent xruns no matter how many
periods/buffer I use.
I've been using a kernel freshly cloned from Tiwai's git with the
latest rt patch on a rather slow laptop. I've switched to Fedora on
that machine a couple of days ago so I don't know yet if my system
settings are properly adjusted for Jack, yet.
> This leads to rather high latencies (22ms+) or is this conclusion bogus?
Yes, I guess that this conclusion is bogus.
First, even at 44.1 kHz I think that you rather get 11.6 ms latency
(512/44.1). At 96 kHz this reduces to 5.3 ms.
I've even done some measurements using jack_iodelay. At 96 kHz I get a
total round trip latency of 17.5 ms. According to the jack_iodelay
manpage this corresponds (if I get it right) to an hardware
input/output latency of the device of ~584 frames (6.1 ms).
This would lead to the (maybe bogus) conclusion that we have a total
output latency of 11.4 ms.
By the way, if you're using jack2 you would probably want to start it
in synchronous mode (with the -S option ). Otherwise you get an
implicit extra period/buffer. (I guess you already know that.)
@Daniel: I could not find any difference between my latest
"old-streaming-logic" kernel and my latest "new-streaming-logic"
kernel.
Regards,
Felix
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: Fast Track Ultra latency and new streaming logic.
2012-05-03 8:39 ` Felix Homann
@ 2012-05-03 14:03 ` Felix Homann
[not found] ` <CAFz=ag4j2OZTZqzeo+h210AaVgToA93hTs5QPL1UPHCCCLJkZg@mail.gmail.com>
2012-05-03 14:13 ` Clemens Ladisch
1 sibling, 1 reply; 11+ messages in thread
From: Felix Homann @ 2012-05-03 14:03 UTC (permalink / raw)
To: Grant Diffey; +Cc: Takashi Iwai, alsa-devel, Clemens Ladisch, Daniel Mack
Some more observations:
I've measured the latency on the same machine running Windows 7 using
Centrance's latency test utility (http://centrance.com/downloads/ltu/)
and got much better results than under Linux. That's a bit
disappointing...
I don't know if these latencies come xrun-free since I don't know how
to detect xruns on Windows. On the other hand, telling Jack not to
complain about xruns from Alsa (softmode) I can get down to 64
frames/period and 2 periods/buffer without any noticable glitches or
crackles (playing a sine test tone). Maybe the Windows driver just
doesn't complain either?
Nevertheless, I'm a bit surprised that just starting Jack without any
clients will result in a flood of xruns at small buffer sizes. Is
there anything we can do about it? Is this to be expected? Is this a
flaw in Alsa, Jack or the USB stack? Is there a way to debug these
xruns?
Any suggestions?
Regards,
Felix
^ permalink raw reply [flat|nested] 11+ messages in thread* Re: Fast Track Ultra latency and new streaming logic.
2012-05-03 8:39 ` Felix Homann
2012-05-03 14:03 ` Felix Homann
@ 2012-05-03 14:13 ` Clemens Ladisch
[not found] ` <CAFz=ag7fvr5+Pz0jePNZ+7xhXZ7n1Td4v3=ZZFQcb6Sqy+RQXw@mail.gmail.com>
1 sibling, 1 reply; 11+ messages in thread
From: Clemens Ladisch @ 2012-05-03 14:13 UTC (permalink / raw)
To: Felix Homann; +Cc: Grant Diffey, alsa-devel, Daniel Mack
Felix Homann wrote:
> I've even done some measurements using jack_iodelay. At 96 kHz I get a
> total round trip latency of 17.5 ms. According to the jack_iodelay
> manpage this corresponds (if I get it right) to an hardware
> input/output latency of the device of ~584 frames (6.1 ms).
USB playback also adds further latency by queueing the packets; the
number of packets can be seen under "URBs" in /proc/asound/card?/stream0.
(There are 1000/8000 packets per second at full/high speed.)
Regards,
Clemens
^ permalink raw reply [flat|nested] 11+ messages in thread
* Fast Track Ultra latency and new streaming logic.
@ 2012-05-08 17:07 Aurélien Leblond
0 siblings, 0 replies; 11+ messages in thread
From: Aurélien Leblond @ 2012-05-08 17:07 UTC (permalink / raw)
To: Grant Diffey, Felix Homann, Daniel Mack, Clemens Ladisch,
alsa-devel
> I can't seem to get below 512frames in flight (2 256sample frames or 4 128
> or 8 64's) without consistant overruns.
On my side, I can run 256 frames ; 3 periods, no xruns at all at 48kHz...
I haven't tried to push the driver more than that,
Aurélien
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2012-05-09 18:13 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-01 0:18 Fast Track Ultra latency and new streaming logic Grant Diffey
2012-05-01 13:09 ` Felix Homann
2012-05-02 8:41 ` Daniel Mack
2012-05-03 8:39 ` Felix Homann
2012-05-03 14:03 ` Felix Homann
[not found] ` <CAFz=ag4j2OZTZqzeo+h210AaVgToA93hTs5QPL1UPHCCCLJkZg@mail.gmail.com>
2012-05-09 13:12 ` Takashi Iwai
2012-05-09 18:13 ` Felix Homann
2012-05-09 15:07 ` Felix Homann
2012-05-03 14:13 ` Clemens Ladisch
[not found] ` <CAFz=ag7fvr5+Pz0jePNZ+7xhXZ7n1Td4v3=ZZFQcb6Sqy+RQXw@mail.gmail.com>
2012-05-03 15:21 ` Clemens Ladisch
-- strict thread matches above, loose matches on Subject: below --
2012-05-08 17:07 Aurélien Leblond
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).