[alsa-devel] ASOC PCM formats
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 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
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.
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
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.
participants (3)
-
Clemens Ladisch
-
Jon Smirl
-
Mark Brown