All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Courtier-Dutton <James@superbug.co.uk>
To: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Cc: Seth Forshee <seth.forshee@gmail.com>,
	alsa-devel <alsa-devel@lists.sourceforge.net>
Subject: Re: [RFC] Dual Interface Codecs
Date: Wed, 03 Jan 2007 20:09:36 +0000	[thread overview]
Message-ID: <459C0D80.9050807@superbug.co.uk> (raw)
In-Reply-To: <1167853658.26687.84.camel@localhost.localdomain>

Liam Girdwood wrote:
> I'd like to gather some opinion on the best way to expose dual interface
> codecs to alsa-lib and userspace in general.
> 
> Consider a codec with 2 digital audio interfaces :-
> 
>  1. I2S interface to host CPU
>  2. PCM interface to BT codec or GSM modem.
> 
> Interface 1 is used for traditional playback and record. Interface 2 is
> used to send and receive PCM audio to a BT codec (for Tx/Rx) from/to an
> onboard Mic/Speaker.  e.g.
> 
>                ____________       DAI 2        ______
> Mic --------> |   Codec    | <==============> |  BT  | --<
> Spk <---------|____________|                  |______|
>                     /\
>                     ||  DAI 1
>                     ||
>                 ____\/____
>                |   CPU    |
>                |__________|
> 
> 
> This allows BT/GSM audio to work without the CPU DMAing any pcm data as
> audio is now sent directly via the audio codec (the CPU can then sleep).
> 
> Currently, we have both interfaces exposed to userspace as PCM's. This
> allows for hw params to be configured for interface 2 (as they would for
> any other device). The only difference is that we never start the PCM
> and always keep it in the prepared state.
> 
> There is the obvious problem that applications may try and start this
> pcm, so I'm wondering if we need a new class of pcm device that doesn't
> support a host buffer (e.g. bufferless) and cant be started ? or
> alternatively some other approach may be better.
> 
> Cheers
> 
> Liam 
> 

A PCM interface is purely for sending PCM audio from the CPU to an 
external device. I.e. For DAI 1
If you don't have any PCM audio to send, do not implement a PCM 
interface for it. Just implement a control interface for them, so that 
an application can control the sample rate etc. of interface 2 with a 
mixer application. You can also arrange for the mixer to not appear in 
alsamixer that uses the simple mixer interface, but can still be 
controlled by specific application or via amixer.

James

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

  reply	other threads:[~2007-01-03 20:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-03 19:47 [RFC] Dual Interface Codecs Liam Girdwood
2007-01-03 20:09 ` James Courtier-Dutton [this message]
2007-01-03 20:31   ` Liam Girdwood
2007-01-04 17:50     ` Liam Girdwood

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=459C0D80.9050807@superbug.co.uk \
    --to=james@superbug.co.uk \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=lg@opensource.wolfsonmicro.com \
    --cc=seth.forshee@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.