From: Wu Fengguang Date: Tue, 3 May 2011 16:35:19 +0000 (+0100) Subject: intel_sst: MRST can only do mono recording X-Git-Tag: firefly_0821_release~7613^2~1326^2~441 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3ca13bdb3c79e8a5e79ddeddacdae3bd4611ab5d;p=firefly-linux-kernel-4.4.55.git intel_sst: MRST can only do mono recording Fix bug $ arecord -Dplughw -c2 Recording WAVE 'stdin' : Unsigned 8 bit, Rate 8000 Hz, Stereo arecord: set_params:1116: Unable to install hw params: ACCESS: RW_INTERLEAVED FORMAT: U8 SUBFORMAT: STD SAMPLE_BITS: 8 FRAME_BITS: 16 CHANNELS: 2 [...] Root cause is, the driver is reporting 2-channel capture capability that is not supported by the MRST hardware. So the plughw plugin end up requesting 2-channel capture which fails. Signed-off-by: Wu Fengguang Signed-off-by: Alan Cox Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/intel_sst/intelmid.c b/drivers/staging/intel_sst/intelmid.c index 61ef4a69216f..0b9b1b64c9c4 100644 --- a/drivers/staging/intel_sst/intelmid.c +++ b/drivers/staging/intel_sst/intelmid.c @@ -335,6 +335,13 @@ static int snd_intelmad_open(struct snd_pcm_substream *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;