All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Clemens Ladisch" <cladisch@fastmail.net>
To: Assaf Hoffman <hoffman@marvell.com>, alsa-devel@lists.sourceforge.net
Cc: Rita Shtern <rita@marvell.com>
Subject: Re: ALSA supported PCM formats
Date: Thu, 19 Oct 2006 11:23:24 +0200	[thread overview]
Message-ID: <1161249804.17687.273709040@webmail.messagingengine.com> (raw)
In-Reply-To: <B9FFC3F97441D04093A504CEA31B7C41E91DB2@msilexch01.marvell.com>

Assaf Hoffman wrote:
> I'm new to ALSA and I'm trying to understand the PCM formats and the way
> ALSA stack place/pick them from the DMA buffer.
> 
> My understanding concerns PCM formats that their physical representation
> bit size is bigger than the actual sound sample bit size.
> For example, defined in pcm_misc.c file under pcm_formats[]:
> 	[SNDRV_PCM_FORMAT_x24_xE]  = {.width = 24, .phys = 32, ...}
> 	[SNDRV_PCM_FORMAT_x20_3xE] = {.width = 20, .phys = 24, ...}
> 	[SNDRV_PCM_FORMAT_x18_3xE] = {.width = 18, .phys = 24, ...}
> How the ALSA stack (kernel 2.6.12.6) knows the offset of the sound
> sample bits inside the format physical size? For example, when the sound
> sample size is 24 (.width = 24) and the format physical size is 32
> (.phys = 32) the sound sample offset inside the physical frame can
> anywhere beteen 0-7 bit. How the ALSA stack can know where to look for
> the sound sample?

There are three sizes that describe a sample:
1) physical size: how many bits are occupied in memory, i.e., how many
   data is read from/written to the DMA buffer for each sample;
2) sample width: the number of bits, starting at the _least_ significant
   bit inside (1), used for sample data;
3) significant bits: the number of bits, starting at the _most_
   significant bit inside (2), actually used for sample data.

Which bit is least/most significant depends on whether the sample format
is little or big endian.


HTH
Clemens

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642

  reply	other threads:[~2006-10-19  9:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-19  7:44 ALSA supported PCM formats Assaf Hoffman
2006-10-19  9:23 ` Clemens Ladisch [this message]
  -- strict thread matches above, loose matches on Subject: below --
2006-10-19  9:45 Assaf Hoffman

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=1161249804.17687.273709040@webmail.messagingengine.com \
    --to=cladisch@fastmail.net \
    --cc=alsa-devel@lists.sourceforge.net \
    --cc=hoffman@marvell.com \
    --cc=rita@marvell.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.