* ALSA supported PCM formats
@ 2006-10-19 7:44 Assaf Hoffman
2006-10-19 9:23 ` Clemens Ladisch
0 siblings, 1 reply; 3+ messages in thread
From: Assaf Hoffman @ 2006-10-19 7:44 UTC (permalink / raw)
To: alsa-devel; +Cc: Rita Shtern
HI,
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?
Thanks.
-------------------------------------------------------------------------
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ALSA supported PCM formats
2006-10-19 7:44 ALSA supported PCM formats Assaf Hoffman
@ 2006-10-19 9:23 ` Clemens Ladisch
0 siblings, 0 replies; 3+ messages in thread
From: Clemens Ladisch @ 2006-10-19 9:23 UTC (permalink / raw)
To: Assaf Hoffman, alsa-devel; +Cc: Rita Shtern
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ALSA supported PCM formats
@ 2006-10-19 9:45 Assaf Hoffman
0 siblings, 0 replies; 3+ messages in thread
From: Assaf Hoffman @ 2006-10-19 9:45 UTC (permalink / raw)
To: Clemens Ladisch, alsa-devel; +Cc: Rita Shtern
Hi,
Thank you for your quick respond.
Regarding 2 and 3 below, aren't those different names for the same
thing?
If not, can you give me an example of a case where they are different?
Thanks.
-----Original Message-----
From: Clemens Ladisch [mailto:cladisch@fastmail.net]
Sent: Thursday, October 19, 2006 11:23 AM
To: Assaf Hoffman; alsa-devel@lists.sourceforge.net
Cc: Rita Shtern
Subject: Re: [Alsa-devel] ALSA supported PCM formats
Importance: Low
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
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-10-19 9:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-10-19 7:44 ALSA supported PCM formats Assaf Hoffman
2006-10-19 9:23 ` Clemens Ladisch
-- strict thread matches above, loose matches on Subject: below --
2006-10-19 9:45 Assaf Hoffman
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.