Skip to contentSkip to conversation

asoc: restrict sample rate and size in Freescale MPC8610 sound drivers

PATCH Applied Timur Tabi 2 participants 4 messages Jul 28, 2008 – Jul 29, 2008

Subsystems (3)
lore
Share & tools
lore

Timur Tabi

author
#0 lore raw

PATCH v2 1/1 asoc: restrict sample rate and size in Freescale MPC8610 sound drivers

The Freescale MPC8610 SSI device has the option of using one clock for both transmit and receive (synchronous mode), or independent clocks (asynchronous). The SSI driver, however, programs the SSI into synchronous mode and then tries to program the clock registers independently. The result is that the wrong sample size is usually generated during recording.

This patch fixes the discrepancy by restricting the sample rate and sample size of the playback and capture streams. The SSI driver remembers which stream is opened first. When a second stream is opened, that stream is constrained to the same sample rate and size as the first stream.

A future version of this driver will lift the sample size restriction. Supporting independent sample rates is more difficult, because only certain codecs provide dual independent clocks.

---

Please apply this patch for 2.6.26.1 and for 2.6.27-rc1. Without this patch, recording on the MPC8610 is just plain broken, so it is a must-fix for 2.6.26.

 sound/soc/fsl/fsl_dma.c |    7 ++++-
 sound/soc/fsl/fsl_ssi.c |   74 ++++++++++++++++++++++++++++++++++++++++------
 2 files changed, 70 insertions(+), 11 deletions(-)
sound/soc/fsl/fsl_dma.c +6 -1
index da2bc59..7ceea2b 100644
@@ -132,12 +132,17 @@ struct fsl_dma_private {
  * Since each link descriptor has a 32-bit byte count field, we set
  * period_bytes_max to the largest 32-bit number.  We also have no maximum
  * number of periods.
+ *
+ * Note that we specify SNDRV_PCM_INFO_JOINT_DUPLEX here, but only because a
+ * limitation in the SSI driver requires the sample rates for playback and
+ * capture to be the same.
  */
 static const struct snd_pcm_hardware fsl_dma_hardware = {
 
 	.info   		= SNDRV_PCM_INFO_INTERLEAVED |
 				  SNDRV_PCM_INFO_MMAP |
-				  SNDRV_PCM_INFO_MMAP_VALID,
+				  SNDRV_PCM_INFO_MMAP_VALID |
+				  SNDRV_PCM_INFO_JOINT_DUPLEX,
 	.formats		= FSLDMA_PCM_FORMATS,
 	.rates  		= FSLDMA_PCM_RATES,
 	.rate_min       	= 5512,
sound/soc/fsl/fsl_ssi.c +64 -10

115 lines not on this page · raw message

Signature · 1 line
1.5.5
Applied
#1 lore raw

At Mon, 28 Jul 2008 17:04:39 -0500,

Quoted 12 lines · Timur Tabi

The Freescale MPC8610 SSI device has the option of using one clock for both transmit and receive (synchronous mode), or independent clocks (asynchronous). The SSI driver, however, programs the SSI into synchronous mode and then tries to program the clock registers independently. The result is that the wrong sample size is usually generated during recording.

This patch fixes the discrepancy by restricting the sample rate and sample size of the playback and capture streams. The SSI driver remembers which stream is opened first. When a second stream is opened, that stream is constrained to the same sample rate and size as the first stream.

Quoted 5 lines

A future version of this driver will lift the sample size restriction. Supporting independent sample rates is more difficult, because only certain codecs provide dual independent clocks.

Thanks, applied.

Takashi

author
#2 lore raw
Quoted 1 line · Takashi Iwai

Thanks, applied.

Will this patch make it up to 2.6.26.1? I couldn't find a branch you maintain for 2.6.26.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
#3 lore raw

At Tue, 29 Jul 2008 10:32:18 -0500,

Quoted 7 lines · Timur Tabi
Quoted 1 line · Takashi Iwai

Thanks, applied.

Will this patch make it up to 2.6.26.1? I couldn't find a branch you maintain for 2.6.26.

Will submit once after the patch is merged to 2.6.27-rc*.

thanks,

Takashi