public inbox for alsa-devel@alsa-project.org
 help / color / mirror / Atom feed
From: Clemens Ladisch <clemens@ladisch.de>
To: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: 'Sarah Sharp' <sarah.a.sharp@linux.intel.com>,
	'ALSA Development Mailing List' <alsa-devel@alsa-project.org>
Subject: Re: USB Audio questions
Date: Tue, 16 Aug 2011 18:09:40 +0200	[thread overview]
Message-ID: <4E4A9644.3020507@ladisch.de> (raw)
In-Reply-To: <000601cc5c2a$87a26350$96e729f0$@bossart@linux.intel.com>

Pierre-Louis Bossart wrote:
> What is this USB frame counter and what would to enable its use, at
> least for playback where there is scope for lots of power
> optimizations.

USB timing is defined by frames, of which there are about 1000 per
second.  The audio driver schedules one packet to be sent/received for
each frame.  Multiple packets are grouped in a URB (USB request buffer);
the controller raises an interrupt when the last packet of the URB has
been completed.

By reading the current frame number, the driver could deduce how many
packets (and therefore, how many samples) have been processed by the
controller.

> > Why more efficient?  You cannot avoid double-buffering when a USB packet
> > wraps around the end of the ALSA ring buffer.
> 
> What I had in mind is a case where the ring buffer is divided in separate
> periods, which would each correspond to an integer number of URBs/packets.

This works only when the driver has control over how many samples
actually are transmitted in each USB frame.  The playback streams of
many USB audio devices work this way, but quite a few others, and
capture streams, don't.

> It's probably less generic than the current driver but a whole lot
> simpler/efficient.

The code wouldn't be simpler because we'd still need the other
algorithm.  This would be just an optimization.


Regards,
Clemens

  parent reply	other threads:[~2011-08-16 16:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15 18:15 [PATCH 1/4] ASoC: DAPM: Allow multiple mixer sources to be routed via the same switch Lars-Peter Clausen
2011-08-15 18:15 ` [PATCH 2/4] ASoC: Add ADAU1373 codec support Lars-Peter Clausen
2011-08-15 20:31   ` USB Audio questions Pierre-Louis Bossart
     [not found]   ` <4e498227.854fdf0a.0dd4.6281SMTPIN_ADDED@mx.google.com>
2011-08-15 20:55     ` Daniel Mack
2011-08-15 21:48       ` Pierre-Louis Bossart
     [not found]   ` <000001cc5b8a$4a6577c0$df306740$@bossart@linux.intel.com>
2011-08-16  5:30     ` David Henningsson
2011-08-16  6:47       ` Clemens Ladisch
2011-08-16  6:37     ` Clemens Ladisch
2011-08-16  7:30       ` Daniel Mack
2011-08-16 15:46         ` Clemens Ladisch
2011-08-16 15:38       ` Pierre-Louis Bossart
     [not found]       ` <20110816145353.GB5233@xanatos>
2011-08-16 15:44         ` Pierre-Louis Bossart
     [not found]       ` <000601cc5c2a$87a26350$96e729f0$@bossart@linux.intel.com>
2011-08-16 16:09         ` Clemens Ladisch [this message]
2011-08-16 17:19           ` Pierre-Louis Bossart
     [not found]           ` <000001cc5c38$b07abee0$11703ca0$@bossart@linux.intel.com>
2011-08-17  6:29             ` Clemens Ladisch
2011-08-17 15:21               ` Pierre-Louis Bossart
2011-08-19 22:02               ` Pierre-Louis Bossart
2011-08-16 20:41         ` Torsten Schenk
2011-08-16 22:11           ` Pavel Hofman
2011-08-17  6:36             ` Clemens Ladisch
     [not found]           ` <000001cc5c5a$e7d5c3e0$b7814ba0$@bossart@linux.intel.com>
2011-08-16 22:13             ` Torsten Schenk
2011-08-16 15:54   ` [PATCH 2/4] ASoC: Add ADAU1373 codec support Mark Brown
2011-08-15 18:15 ` [PATCH 3/4] ASoC: Blackfin: ADAU1373 eval board support Lars-Peter Clausen
2011-08-16 15:54   ` Mark Brown
2011-08-15 18:15 ` [PATCH 4/4] Blackfin: bf537: Stamp: Register ASoC EVAL-ADAU1373 board driver Lars-Peter Clausen
2011-08-16 15:56   ` Mark Brown
2011-08-18 13:52     ` Lars-Peter Clausen
2011-08-15 23:25 ` [PATCH 1/4] ASoC: DAPM: Allow multiple mixer sources to be routed via the same switch Mark Brown

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=4E4A9644.3020507@ladisch.de \
    --to=clemens@ladisch.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sarah.a.sharp@linux.intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox