From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: ring buffer pointer accuracy.
Date: Thu, 10 Jul 2003 16:31:28 +0100 [thread overview]
Message-ID: <3F0D86D0.6040905@superbug.demon.co.uk> (raw)
Hi,
When an application reads the "avail" or "delay" pcm values: -
1) how accurate are they?
2) does the accuracy depend on the sound card driver being used.
The reason I ask this, is that I am going to be writing an alsa driver
for bluetooth headsets.
With bluetooth headsets, sound is sent to the bluetooth headset inside a
packet.
This packet is 27 bytes long, and contains 24 audio samples (8 bit mono,
8000hz) and 3 bytes header.
This would mean that the "avail" and "delay" pointers will only be
updated once every 24 samples, and will always go in 24 sample increments.
This means that the "avail" and "delay" pointers are only accurate to
the nearest 3 ms.
Do any other alsa drivers suffer from this, or are they all sample
accurate and updated as each sample is sent to the speakers.
It would be nice for the application to be able to determine how
accurate the "avail" and "delay" pointers are.
If an application is trying to syncronise video to audio, it will need
to know how accurate the snd_pcm_delay() pointer is.
I.E. Is snd_pcm_delay() updated as each sample is output to the
speakers, or is it only updated as each block of 24 samples are output.
As you can see, if the application trys to syncronise to sample
accuracy, it will fail badly with bluetooth headsets, but if the
application can be told by alsa that it should only try to syncronise if
it is more that 24 samples out of sync, the problem will be solved.
Cheers
James
-------------------------------------------------------
This SF.Net email sponsored by: Parasoft
Error proof Web apps, automate testing & more.
Download & eval WebKing and get a free book.
www.parasoft.com/bulletproofapps
next reply other threads:[~2003-07-10 15:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-07-10 15:31 James Courtier-Dutton [this message]
2003-07-11 15:28 ` ring buffer pointer accuracy Giuliano Pochini
2003-07-14 14:29 ` Takashi Iwai
2003-07-14 14:51 ` James Courtier-Dutton
2003-07-14 15:57 ` Giuliano Pochini
2003-07-14 16:53 ` Måns Rullgård
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=3F0D86D0.6040905@superbug.demon.co.uk \
--to=james@superbug.demon.co.uk \
--cc=alsa-devel@lists.sourceforge.net \
/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.