All of lore.kernel.org
 help / color / mirror / Atom feed
* WM9712 - Big and little endian format conversion.
@ 2009-05-13 17:55 Jon Smirl
  2009-05-13 17:59 ` Mark Brown
  0 siblings, 1 reply; 8+ messages in thread
From: Jon Smirl @ 2009-05-13 17:55 UTC (permalink / raw)
  To: alsa-devel mailing list, Mark Brown

I have three areas specifying audio formats. The WM9712 AC97 codec is
S16_LE. My DMA hardware is S32_BE. All samples need to be in 32b words
even if they are 8,16,24b.  The cpu's AC97 system sends the first 20
big endian bits down the AC97 link in the proper order.

How can I force the DMA engine setting to override what the codec is
saying? Or should the codec be changed to specify all bit lengths and
both endians?

My DMA platform:

static const struct snd_pcm_hardware psc_dma_hardware = {
	.info = SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
		SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
		SNDRV_PCM_INFO_BATCH,
	.formats = SNDRV_PCM_FMTBIT_S32_BE,
	.rate_min = 8000,
	.rate_max = 48000,
	.channels_min = 1,
	.channels_max = 2,
	.period_bytes_max	= 1024 * 1024,
	.period_bytes_min	= 32,
	.periods_min		= 2,
	.periods_max		= 256,
	.buffer_bytes_max	= 2 * 1024 * 1024,
	.fifo_size		= 512,
};


CPU DAI:
static struct snd_soc_dai psc_ac97_dai_template[] = {
{
	.name   = "%s analog",
	.suspend = psc_ac97_suspend,
	.resume = psc_ac97_resume,
	.playback = {
		.channels_min   = 1,
		.channels_max   = 6,
		.rates          = SNDRV_PCM_RATE_8000_48000,
		.formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |
			   SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE,
	},
	.capture = {
		.channels_min   = 1,
		.channels_max   = 2,
		.rates          = SNDRV_PCM_RATE_8000_48000,
		.formats = SNDRV_PCM_FMTBIT_S8 | SNDRV_PCM_FMTBIT_S16_BE |
			   SNDRV_PCM_FMTBIT_S24_BE | SNDRV_PCM_FMTBIT_S32_BE,
	},
	.ops = &psc_ac97_analog_ops,
},

Codec:

struct snd_soc_dai wm9712_dai[] = {
{
	.name = "AC97 HiFi",
	.ac97_control = 1,
	.playback = {
		.stream_name = "HiFi Playback",
		.channels_min = 1,
		.channels_max = 2,
		.rates = WM9712_AC97_RATES,
		.formats = SNDRV_PCM_FMTBIT_S16_LE,
	},
	.capture = {
		.stream_name = "HiFi Capture",
		.channels_min = 1,
		.channels_max = 2,
		.rates = WM9712_AC97_RATES,
		.formats = SNDRV_PCM_FMTBIT_S16_LE,
	},
	.ops = &wm9712_dai_ops_hifi,
},
{



-- 
Jon Smirl
jonsmirl@gmail.com

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-05-13 21:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-13 17:55 WM9712 - Big and little endian format conversion Jon Smirl
2009-05-13 17:59 ` Mark Brown
2009-05-13 18:08   ` Jon Smirl
2009-05-13 18:14     ` Jon Smirl
2009-05-13 18:14     ` Mark Brown
2009-05-13 18:18       ` Jon Smirl
2009-05-13 18:20         ` Jon Smirl
2009-05-13 21:44           ` 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.