All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.demon.co.uk>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Lars Grunewaldt <lgw@dark-reality.de>,
	BlueZ Mailing List <bluez-devel@lists.sourceforge.net>
Subject: Re: [Bluez-devel] snd-bt-sco development teamup...
Date: Tue, 10 Aug 2004 13:53:54 +0100	[thread overview]
Message-ID: <4118C562.1050300@superbug.demon.co.uk> (raw)
In-Reply-To: <1092140041.4564.96.camel@pegasus>

I don't know if this will help, but I will itemise the requirements that 
and alsa driver will need:

1) A ring buffer, that is then broken up into 2 or more chunks called 
periods. The userland application will set the buffer_size and period_size.
2) An interrupt or callback routine is called as each period reaches the 
headset speakers, same for capture from headset mic.
3) A hardware pointer value, that can be read at any time, and returns 
the current sample being played by the speakers, or as close as possible 
to it.
4) Latency between samples leaving the ring buffer and being played to 
the speakers should be as small as possible. This should be less than 
10ms. Optimum low latency is achieved using 2 periods per buffer.
5) The rate at which samples leave the ring buffer should be constant, 
and ideally under hardware control.

My suggestion for the SCO channel, is to use a fixed number, normally 2, 
of SCO packets in a loop.
1) User app fills buffer.
2) SCO takes X samples from ring buffer, creates a SCO packet, and sends 
it to the hardware.
3) SCO takes X more samples from the ring buffer, creates another SCO 
packet, and sends it to the hardware.
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.

In this way there are only ever 2 SCO packets in the pipeline.
It fixes the latency, and we always have an accurate idea of which 
sample is currently being played.

Summary: Limit the size of the SCO packet buffer to 2 packets, or some 
fixed even value.

Cheers
James

  reply	other threads:[~2004-08-10 12:53 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 [this message]
2004-08-10 13:39                 ` Jonathan Paisley
2004-08-10 14:26                   ` Carl Orsborn
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=4118C562.1050300@superbug.demon.co.uk \
    --to=james@superbug.demon.co.uk \
    --cc=bluez-devel@lists.sourceforge.net \
    --cc=lgw@dark-reality.de \
    --cc=marcel@holtmann.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.