From: Carl Orsborn <cjo@csr.com>
To: BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] snd-bt-sco development teamup...
Date: Tue, 10 Aug 2004 15:26:01 +0100 [thread overview]
Message-ID: <4118DAF9.2080204@csr.com> (raw)
In-Reply-To: <Pine.LNX.4.59.9999.0408101435250.22497@brava.dcs.gla.ac.uk>
I know nothing of snd-bt-sco or alsa, so some of my comments
below will doubtless expose my ignorance, but I know something
of how CSR devices handle SCO traffic (or, at least, how
they're *supposed* to handle SCO traffic).
I can't find anything in this thread that reveals whether you're
trying to send SCO traffic over USB or UART. The data handling
for the two cases have subtle differences.
Over USB, there's an isochronous connection - the bus provides
capacity for 8 ksamples/second in each direction. If a CSR
device somehow fails to receive SCO traffic from air it fills
the embarrassing gap in the USB to-host flow with dummy
data. Thus, the host continues to receive 8 ksamples/second.
Over UART, the same compensation mechanism applies - the CSR
device makes up data for any from-air gaps. This allows the
host to match its tx sample rate to the connection's rx
sample rate, and so removes the need for the host to maintain
an accurate 8 kHz clock.
The Bluetooth device has a pair of *small* ring buffers for each
SCO connection - one for each direction. They are small to
keep audio latency low; manufacturers of audio devices insist
on low latency. Keeping latency low for audio traffic flowing
over HCI (USB or UART) is hard. Most of our customers route
SCO traffic over the Bluetooth device's separate audio interface
(PCM port), bypassing the HCI transport.
As I noted above, the USB/SCO path is isochronous. This means
packets can be lost silently. If the path is carrying 16-bit
samples (the normal case), and if a USB packet can hold an
odd number of bytes, this can lead to a 1 byte offset in
the audio stream. This sounds ghastly. We fixed this in the
Bluetooth device's firmware ages ago - spotting the loss of
sync by looking for SCO packet headers. However, many host
USB device drivers can still suffer this problem.
Much of this is discussed in CSR's "HCI Implementation" document,
bcore-me-026, though this is normally only made available to
CSR's (direct) customers.
Regards,
Carl
Jonathan Paisley wrote:
> On Tue, 10 Aug 2004 1:53pm +0100, James Courtier-Dutton wrote:
>
>> 4) SCO then waits until SCO has finished (2), and only then takes X
>> samples from the ring buffer, creates a SCO packet, and sends it to
>> the hardware...then repeats.
>> 5) Add a SCO api call, so that the higher level module can find out
>> how much of the SCO packet has been output, and thus return accurate
>> hardware pointer values.
>
>
> Is this additional api call necessary? Suppose packets are about 24
> bytes (that's what I remember them to be). So the suggestion is to have
> two of these in flight at a time. Given 8000 Hz sampling rate (equating
> to 8000 or 16000 bytes per second if using 8bit or 16bit PCM,
> respectively), those 24 bytes correspond to between 1.5 and 3ms.
>
> In summary: isn't it sufficient to just keep track of what packets have
> been sent? This gives 3ms accuracy.
>
> Thanks.
**********************************************************************
The information transmitted is intended only for the person or
entity to which it is addressed and may contain confidential
and/or privileged material.
Any review, retransmission, dissemination or other use of, or
taking of any action in reliance upon, this information by
persons or entities other than the intended recipient is
prohibited.
If you received this in error, please contact the sender and
delete the material from any computer.
**********************************************************************
-------------------------------------------------------
SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media
100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33
Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift.
http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
next prev parent reply other threads:[~2004-08-10 14:26 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-09 16:51 [Bluez-devel] snd-bt-sco development teamup Lars Grunewaldt
2004-08-09 17:09 ` Marcel Holtmann
2004-08-09 17:12 ` Lars Grunewaldt
2004-08-09 17:39 ` Marcel Holtmann
2004-08-09 18:21 ` James Courtier-Dutton
2004-08-09 22:26 ` Marcel Holtmann
2004-08-09 23:53 ` Lars Grunewaldt
2004-08-10 12:14 ` Marcel Holtmann
2004-08-10 12:53 ` James Courtier-Dutton
2004-08-10 13:39 ` Jonathan Paisley
2004-08-10 14:26 ` Carl Orsborn [this message]
2004-08-10 14:48 ` Marcel Holtmann
2004-08-10 15:31 ` Jonathan Paisley
2004-08-11 8:58 ` Roderick Taylor
2004-08-11 6:40 ` Marcel Holtmann
2004-08-10 15:51 ` James Courtier-Dutton
2004-08-10 18:43 ` Jonathan Paisley
2004-08-10 19:22 ` Carl Orsborn
2004-08-10 12:56 ` [Bluez-devel] snd-bt-sco development teamup | ALSA connection Lars Grunewaldt
2004-08-10 13:45 ` Marcel Holtmann
2004-08-10 13:53 ` [snd-bt-sco] " Jonathan Paisley
2004-08-10 14:36 ` Marcel Holtmann
2004-08-10 14:39 ` Jonathan Paisley
2004-08-10 14:21 ` Lars Grunewaldt
2004-08-10 15:01 ` Marcel Holtmann
2004-08-10 16:02 ` Lars Grunewaldt
2004-08-10 14:53 ` James Courtier-Dutton
2004-08-10 13:03 ` [Bluez-devel] snd-bt-sco development teamup Jonathan Paisley
2004-08-10 13:11 ` Marcel Holtmann
2004-08-10 13:18 ` Lars Grunewaldt
2004-08-10 13:20 ` Jonathan Paisley
2004-08-10 13:22 ` Lars Grunewaldt
2004-08-10 13:54 ` James Courtier-Dutton
2004-08-10 13:28 ` Marcel Holtmann
2004-08-10 13:40 ` James Courtier-Dutton
2004-08-10 13:49 ` Marcel Holtmann
2004-08-10 14:07 ` James Courtier-Dutton
2004-08-10 14:34 ` Marcel Holtmann
2004-08-10 15:15 ` James Courtier-Dutton
2004-08-10 15:25 ` Marcel Holtmann
2004-08-10 16:46 ` James Courtier-Dutton
2004-08-10 22:58 ` Marcel Holtmann
2004-08-10 11:48 ` Lars Grunewaldt
2004-08-10 12:08 ` Marcel Holtmann
2004-08-10 12:40 ` Lars Grunewaldt
2004-08-10 13:03 ` Marcel Holtmann
2004-08-10 13:10 ` Lars Grunewaldt
2004-08-10 13:30 ` Marcel Holtmann
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=4118DAF9.2080204@csr.com \
--to=cjo@csr.com \
--cc=bluez-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.