MRST firmware returns error on 2-channel capture requests,
leading to "arecord -Dplughw -c2 test.wav" failure.

Fix it by lowering channels_max from 2 to 1.

Signed-off-by: Wu Fengguang <[email protected]>
---
 drivers/staging/intel_sst/intelmid.c |    7 +++++++
 1 file changed, 7 insertions(+)

--- linux-2.6-mrst.orig/drivers/staging/intel_sst/intelmid.c    2011-03-16 
01:59:25.000000000 +0800
+++ linux-2.6-mrst/drivers/staging/intel_sst/intelmid.c 2011-03-16 
02:08:03.000000000 +0800
@@ -322,20 +322,27 @@ static int snd_intelmad_open(struct snd_
        struct mad_stream_pvt *stream;
 
        WARN_ON(!substream);
 
        pr_debug("sst: snd_intelmad_open called\n");
 
        intelmaddata = snd_pcm_substream_chip(substream);
        runtime = substream->runtime;
        /* set the runtime hw parameter with local snd_pcm_hardware struct */
        runtime->hw = snd_intelmad_stream;
+       if (intelmaddata->cpu_id == CPU_CHIP_LINCROFT) {
+               /*
+                * MRST firmware currently denies stereo recording requests.
+                */
+               if (substream->stream == SNDRV_PCM_STREAM_CAPTURE)
+                       runtime->hw.channels_max = 1;
+       }
        if (intelmaddata->cpu_id == CPU_CHIP_PENWELL) {
                runtime->hw = snd_intelmad_stream;
                runtime->hw.rates = SNDRV_PCM_RATE_48000;
                runtime->hw.rate_min = MAX_RATE;
                runtime->hw.formats = (SNDRV_PCM_FMTBIT_S24 |
                                                SNDRV_PCM_FMTBIT_U24);
                if (intelmaddata->sstdrv_ops->scard_ops->input_dev_id == AMIC)
                        runtime->hw.channels_max = MAX_CHANNEL_AMIC;
                else
                        runtime->hw.channels_max = MAX_CHANNEL_DMIC;
_______________________________________________
MeeGo-kernel mailing list
[email protected]
http://lists.meego.com/listinfo/meego-kernel

Reply via email to