From: Clemens Ladisch <clemens-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
To: Alan Stern <stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>
Cc: Daniel Mack <zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Takashi Iwai <tiwai-l3A5Bk7waGM@public.gmane.org>,
Eldad Zack <eldad-v6AqZgAe4C4dvzyIwGCCOg@public.gmane.org>,
USB list <linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org
Subject: Re: [alsa-devel] Buffer size for ALSA USB PCM audio
Date: Sun, 18 Aug 2013 18:56:14 +0200 [thread overview]
Message-ID: <5210FCAE.3090103@ladisch.de> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1308151136180.905-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
Alan Stern wrote:
> On Tue, 13 Aug 2013, Clemens Ladisch wrote:
>>> The difference is that this version tries always to keep a period's
>>> worth of bytes in the USB hardware queue.
>>
>> Having truncated URBs is possible only when URBs are shorter than one
>> period,
>
> No. URBs are truncated when a full-sized URB would extend at least one
> packet beyond the end of a frame.
This thought was in the context of avoiding too-short queues. When
there are multiple URBs per period, the queue is long enough anyway.
>> so I think that a queue length of at least two periods, together
>> with a minimum period size, should ensure the isochrounous scheduling
>> threshold.
>
> This depends on how long a period is.
In that patch, a period is guaranteed to be no smaller than the IST.
>> And while we're at it: the default number of packets per URB was chosen
>> before the driver had the ability to estimate the delay from the current
>> frame number; it should now be quite safe to increase it.
>
> I don't understand how this delay estimation is supposed to work, or
> what it is meant to accomplish. Can you explain?
The "delay" is the difference between the time when a sample is written
by the application and when that sample is actually played, and is
important for things like A/V synchronization. It depends on
1) the amount of samples already in the ring buffer;
2) any processing done by the driver; and
3) any processing done by the hardware.
Most drivers don't do any processing, and most of the hardware has very
low delays, so it is common for drivers to pretend 2) and 3) are zero.
snd-usb-audio computes 2) from the current number of packets in the
queue, with the progress estimated based on the current frame. Without
this computation, it was desirable to have short URBs because the delay
would jump by a large amount whenever a URB was completed.
Regards,
Clemens
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2013-08-18 16:56 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-24 14:41 Buffer size for ALSA USB PCM audio Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307241013190.1313-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-07-24 14:54 ` Takashi Iwai
[not found] ` <s5hsiz4knyf.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-07-24 15:22 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307241108180.1313-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-07-24 15:26 ` Takashi Iwai
[not found] ` <s5hob9skmgs.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-07-24 15:43 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307241138180.1313-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-07-25 8:24 ` Takashi Iwai
[not found] ` <s5hbo5rkpwm.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-07-25 14:50 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307251043470.882-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-07-29 10:03 ` Takashi Iwai
[not found] ` <s5hvc3tfzt7.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-07-29 15:00 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307291041410.1479-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-07-29 17:12 ` Clemens Ladisch
[not found] ` <51F6A262.6010800-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2013-07-29 18:20 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307291400450.1479-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-07-29 19:23 ` Daniel Mack
[not found] ` <51F6C123.7020407-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-07-29 19:38 ` Alan Stern
2013-07-30 6:43 ` [alsa-devel] " Takashi Iwai
[not found] ` <s5hob9k5z0b.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-08-01 17:11 ` Eldad Zack
2013-08-01 17:37 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1307311645190.1546-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-12 13:22 ` [alsa-devel] " Takashi Iwai
[not found] ` <s5h7gfryrgh.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-08-12 14:53 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308121036460.1489-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-12 15:04 ` Takashi Iwai
[not found] ` <s5hvc3bx85c.wl%tiwai-l3A5Bk7waGM@public.gmane.org>
2013-08-12 16:50 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308121218590.1489-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-13 21:06 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308131659320.897-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-13 21:34 ` Daniel Mack
[not found] ` <520AA657.5010704-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-08-14 20:50 ` Eldad Zack
2013-08-15 16:06 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308151136180.905-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-18 16:56 ` Clemens Ladisch [this message]
2013-08-14 18:34 ` Clemens Ladisch
[not found] ` <520BCDBC.2060507-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2013-08-21 21:37 ` [alsa-devel] " Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308211654010.1297-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-26 18:37 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308261419100.886-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-27 6:32 ` James Stone
[not found] ` <CABRv+91ZGMHbHZFW0gYOL-zGP=HbmiJU51z-_C_2Jj+5ATisrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-27 16:53 ` Alan Stern
2013-08-27 7:19 ` Clemens Ladisch
2013-08-27 8:01 ` Pavel Hofman
[not found] ` <521C5CC2.7030809-49v42ZqfXVBBDgjK7y7TUQ@public.gmane.org>
2013-08-27 8:11 ` [alsa-devel] " Clemens Ladisch
[not found] ` <521C5315.3030207-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2013-08-27 16:50 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308271246130.1810-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-27 20:03 ` Clemens Ladisch
[not found] ` <521D060E.4-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2013-08-27 20:11 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308271608430.940-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-28 6:41 ` Clemens Ladisch
[not found] ` <521D9BAE.2060508-P6GI/4k7KOmELgA04lAiVw@public.gmane.org>
2013-08-28 18:46 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308281441090.1541-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-29 8:10 ` James Stone
[not found] ` <CABRv+92cJPKVT9f2dyHJ_rg6sX3hP9Ct6QFas771fS79h7Eu2w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-08-29 15:00 ` Alan Stern
[not found] ` <Pine.LNX.4.44L0.1308291059300.1170-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2013-08-29 17:45 ` James Stone
2013-08-29 18:42 ` Alan Stern
[not found] ` <CABRv+93oVW0rDEJnNeGyfqem2PM42b28-z9q+Ze8r7rky7szDA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-09-03 14:04 ` [alsa-devel] " Alan Stern
2013-09-22 21:50 ` Eldad Zack
2013-09-09 14:20 ` Daniel Mack
[not found] ` <522DD92C.4020009-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2013-09-09 15:36 ` Alan Stern
2013-08-13 21:54 ` Clemens Ladisch
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5210FCAE.3090103@ladisch.de \
--to=clemens-p6gi/4k7komelga04laivw@public.gmane.org \
--cc=alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw@public.gmane.org \
--cc=eldad-v6AqZgAe4C4dvzyIwGCCOg@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
--cc=tiwai-l3A5Bk7waGM@public.gmane.org \
--cc=zonque-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.