* ASOC PCM formats
@ 2008-06-07 0:00 Jon Smirl
2008-06-09 7:20 ` Clemens Ladisch
2008-06-09 9:17 ` Mark Brown
0 siblings, 2 replies; 5+ messages in thread
From: Jon Smirl @ 2008-06-07 0:00 UTC (permalink / raw)
To: ALSA-devel
Why is the AC97 format set to S16 in all of the drivers? The link is
20b and my codec takes 20b, how do I get 20b data to the device? I
tried using SNDRV_PCM_FORMAT_S20_3BE but all I get is static.
If I use S24 for the format it works but volume is divided by 16. I
think the bits have been right justified into the 24 bits so the
bottom four bits are lost.
AC97 link is Efika, MPC5200
Codec is STAC9766.
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ASOC PCM formats
2008-06-07 0:00 ASOC PCM formats Jon Smirl
@ 2008-06-09 7:20 ` Clemens Ladisch
2008-06-09 9:17 ` Mark Brown
1 sibling, 0 replies; 5+ messages in thread
From: Clemens Ladisch @ 2008-06-09 7:20 UTC (permalink / raw)
To: Jon Smirl; +Cc: ALSA-devel
Jon Smirl wrote:
> Why is the AC97 format set to S16 in all of the drivers? The link is
> 20b and my codec takes 20b, how do I get 20b data to the device?
You can only use sample formats that are supported by the AC97
controller.
> I tried using SNDRV_PCM_FORMAT_S20_3BE but all I get is static.
S20_3LE could in theory be used by USB devices. There is no hardware
that supports S20_3BE.
How did you use this format? Which driver is this?
> If I use S24 for the format it works but volume is divided by 16.
S24 means that the 24 sample bits are in the least significant bits of
a 32-bit memory word. 24 sample bits in the most significant bits of
a 32-bit memory word would be S32. (It might be possible that your
driver gets this wrong.)
Regards,
Clemens
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ASOC PCM formats
2008-06-07 0:00 ASOC PCM formats Jon Smirl
2008-06-09 7:20 ` Clemens Ladisch
@ 2008-06-09 9:17 ` Mark Brown
2008-06-09 13:08 ` Jon Smirl
1 sibling, 1 reply; 5+ messages in thread
From: Mark Brown @ 2008-06-09 9:17 UTC (permalink / raw)
To: Jon Smirl; +Cc: ALSA-devel
On Fri, Jun 06, 2008 at 08:00:04PM -0400, Jon Smirl wrote:
> Why is the AC97 format set to S16 in all of the drivers? The link is
> 20b and my codec takes 20b, how do I get 20b data to the device? I
> tried using SNDRV_PCM_FORMAT_S20_3BE but all I get is static.
The format that is set needs to correspond to what your AC97 controller
needs as input. The setting for the codec just needs to match one of
the supported ones for the controller - the specific memory layout of
the data should not be important, the controller ought to reformat the
data into whatever is appropriate for the bus.
This isn't entirely ideal but in practice works well since most
controllers need samples in pretty much the form they're outputing and
so the sample size in RAM usually needs to correspond to the sample size
that appears on the bus.
As Clemens said, try S32.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ASOC PCM formats
2008-06-09 9:17 ` Mark Brown
@ 2008-06-09 13:08 ` Jon Smirl
2008-06-09 16:42 ` Mark Brown
0 siblings, 1 reply; 5+ messages in thread
From: Jon Smirl @ 2008-06-09 13:08 UTC (permalink / raw)
To: Jon Smirl, ALSA-devel
On 6/9/08, Mark Brown <broonie@opensource.wolfsonmicro.com> wrote:
> On Fri, Jun 06, 2008 at 08:00:04PM -0400, Jon Smirl wrote:
>
> > Why is the AC97 format set to S16 in all of the drivers? The link is
> > 20b and my codec takes 20b, how do I get 20b data to the device? I
> > tried using SNDRV_PCM_FORMAT_S20_3BE but all I get is static.
>
>
> The format that is set needs to correspond to what your AC97 controller
> needs as input. The setting for the codec just needs to match one of
> the supported ones for the controller - the specific memory layout of
> the data should not be important, the controller ought to reformat the
> data into whatever is appropriate for the bus.
>
> This isn't entirely ideal but in practice works well since most
> controllers need samples in pretty much the form they're outputing and
> so the sample size in RAM usually needs to correspond to the sample size
> that appears on the bus.
>
> As Clemens said, try S32.
>
The format is in three places:
codec dai
platform dai
dma driver
Isn't the wm9712 an AC97 controller? on pxa..
codec dai = SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S24
platform_dai = SNDRV_PCM_FMTBIT_S16_LE
dma driver = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |
SNDRV_PCM_FMTBIT_S32_LE,
I tried copying this. It sends 16 bit sound through the system.
I'll try this next..
codec dai = SNDRV_PCM_FMTBIT_S32
platform_dai = SNDRV_PCM_FMTBIT_S32_BE
dma driver = SNDRV_PCM_FMTBIT_S32_BE
--
Jon Smirl
jonsmirl@gmail.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: ASOC PCM formats
2008-06-09 13:08 ` Jon Smirl
@ 2008-06-09 16:42 ` Mark Brown
0 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2008-06-09 16:42 UTC (permalink / raw)
To: Jon Smirl; +Cc: ALSA-devel
On Mon, Jun 09, 2008 at 09:08:18AM -0400, Jon Smirl wrote:
> Isn't the wm9712 an AC97 controller? on pxa..
It's an AC97 codec.
> codec dai = SNDRV_PCM_FMTBIT_S16 | SNDRV_PCM_FMTBIT_S24
> platform_dai = SNDRV_PCM_FMTBIT_S16_LE
I assume you mean the AC97 controller driver here?
> dma driver = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE |
> SNDRV_PCM_FMTBIT_S32_LE,
> I tried copying this. It sends 16 bit sound through the system.
Right; since the AC97 controller driver only offers 16 bit it constrains
the other two.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2008-06-09 16:42 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-07 0:00 ASOC PCM formats Jon Smirl
2008-06-09 7:20 ` Clemens Ladisch
2008-06-09 9:17 ` Mark Brown
2008-06-09 13:08 ` Jon Smirl
2008-06-09 16:42 ` Mark Brown
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.