All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gabriel M. Beddingfield" <gabrbedd@gmail.com>
To: Clemens Ladisch <clemens@ladisch.de>
Cc: alsa-devel@alsa-project.org, Zhang wei <zhangwei@vimicro.com>
Subject: Re: what is the difference between SNDRV_PCM_FMTBIT_S24_LE and SNDRV_PCM_FMTBIT_S24_3LE
Date: Thu, 11 Apr 2013 08:27:21 -0700	[thread overview]
Message-ID: <5166D659.90505@gmail.com> (raw)
In-Reply-To: <516683FD.4000804@ladisch.de>

On 04/11/2013 02:35 AM, Clemens Ladisch wrote:
> (please do not drop the mailing list from replies.)
>
> Zhang wei wrote:
>> I do not really understand. For example,an codec is wm8985 ...
>
> The SNDRV_PCM_* symbols specify the format in which samples are
> stored in memory.
>
> I do not know how ASoC maps these symbols to on-the-wire formats.

The SNDRV_PCM_* symbol specifies the format of the audio in RAM, and 
transfers that audio to the digital audio interface (DAI) on the CPU 
side.  (E.g. the OMAP McBSP.)

The on-the-wire format is set up by the ASoC machine driver (i.e. "sound 
card.")  It will configure the CPU DAI (e.g. the OMAP McBSP) and the 
codec (e.g. wm8985) to expect the same "on-the-wire" format.  For 
example, in sound/soc/omap/omap-twl4030.c (beagleboard's machine driver) 
the on-the-wire format is done in omap_twl4030_hw_params() like this 
(edited for brevity):

         fmt =   SND_SOC_DAIFMT_I2S |
                 SND_SOC_DAIFMT_NB_NF |
                 SND_SOC_DAIFMT_CBM_CFM;

         /* Set codec DAI configuration */
         ret = snd_soc_dai_set_fmt(codec_dai, fmt);

         /* Set cpu DAI configuration */
         ret = snd_soc_dai_set_fmt(cpu_dai, fmt);

The CPU DAI is responsible for converting the SNDRV_PCM_* format into 
the serial format.  Therefore, the conversions that it supports is 
totally hardware-dependent.

-gabriel

  reply	other threads:[~2013-04-11 15:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11  8:55 what is the difference between SNDRV_PCM_FMTBIT_S24_LE and SNDRV_PCM_FMTBIT_S24_3LE Zhang wei
2013-04-11  9:00 ` Clemens Ladisch
     [not found]   ` <6B947C8AC4195040A8C6876A496C644A082F1EEE@BJ-MAIL-04.vimicro.com>
2013-04-11  9:35     ` Clemens Ladisch
2013-04-11 15:27       ` Gabriel M. Beddingfield [this message]
2013-04-30 13:24         ` 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=5166D659.90505@gmail.com \
    --to=gabrbedd@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=zhangwei@vimicro.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.