From: David Henningsson <david.henningsson@canonical.com>
To: "alsa-devel@alsa-project.org" <alsa-devel@alsa-project.org>,
Daniel Mack <zonque@gmail.com>
Subject: Delay calculations for USB audio?
Date: Fri, 28 Sep 2012 13:00:30 +0200 [thread overview]
Message-ID: <5065834E.4010707@canonical.com> (raw)
Hi,
While researching some crackling audio problem, I noticed that I got
these messages in my dmesg:
delay: estimated 0, actual 384
delay: estimated 384, actual 768
They come at every start of playback. I want to understand this stuff,
so I tried to dig a little. It looks like the endpoint is started in the
prepare stage, so between prepare and trigger, silence data will be sent.
First question: Isn't this messing up the delay calculations? If you
fill some "urb buffer" [1] with silence, depending on the urb buffer
size, delay calculation should take this into account for proper
lipsync. I mean, the USB audio device would first have to play all the
silence data before it could start the audio data, right?
(And how big is this buffer anyway?)
Second question: This also means that some of the silence packets will
go through retire_playback_urb, right? Isn't this also messing with the
delay calculation?
(Oh, and btw, if you have an idea of the crackling/distorted USB audio,
let me know. I'm using a standard Logitech USB Headset, using
speaker-test -c 2 -D plughw:Headset -t sine -r 48000
I can make the problem go away using any of these options:
* Booting a 3.2 kernel - I've tried 3.5, 3.6-rc7 and 3.2
* Choosing the 44100 sample rate instead of the default of 48000
* Selecting the outer USB port instead of the inner one. Yes, there
are two USB ports next to each other, and this only happens on one of
them. (!))
--
David Henningsson, Canonical Ltd.
https://launchpad.net/~diwic
[1] maybe there's a better name for it?
next reply other threads:[~2012-09-28 11:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 11:00 David Henningsson [this message]
2012-09-28 11:23 ` Delay calculations for USB audio? Gabriel M. Beddingfield
2012-09-28 11:56 ` David Henningsson
2012-09-28 12:30 ` Clemens Ladisch
2012-09-28 17:29 ` David Henningsson
2012-09-28 18:01 ` Gabriel Beddingfield
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=5065834E.4010707@canonical.com \
--to=david.henningsson@canonical.com \
--cc=alsa-devel@alsa-project.org \
--cc=zonque@gmail.com \
/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.