diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-09-23 00:08:25 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-09-24 06:00:13 -0400 |
commit | 64d2307c3b7daa03dbc0c3a6b514709dd7b6eaee (patch) | |
tree | 1098c9add72e0dde2720620e217e4ab455a3d083 /sound/soc/fsl | |
parent | feb8f1147618ebf20ab3e5efc143ceb621063f81 (diff) |
ASoC: fsl: fsl_ssi: Fix simultaneous capture and playback
When doing simultaneous capture and playback on a mx6 board we get the following
error:
$ arecord -f cd | aplay -f cd
imx-sgtl5000 sound.13: set sample size in capture stream first
fsl-ssi-dai 2028000.ssi: ASoC: can't open interface 2028000.ssi: -11
ALSA lib pcm_dmix.c:1018:(snd_pcm_dmix_
open) unable to open slave
aplay: main:660: audio open error: Device or resource busy
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
The 'arecord -f cd | aplay -f cd' always trigger cause the
'if (!first_runtime->sample_bits)' block to be true which returns an error.
Adjust the logic inside fsl_ssi_startup(), so that we do not always hit the
error when playing 'arecord | aplay' line for the first time.
Reported-by: Chris Clepper <cgclepper@gmail.com>
Suggested-by: Nicolin Chen <b42378@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/fsl')
-rw-r--r-- | sound/soc/fsl/fsl_ssi.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 6ac87300d45d..cdbb641ef518 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c | |||
@@ -469,19 +469,12 @@ static int fsl_ssi_startup(struct snd_pcm_substream *substream, | |||
469 | * parameters, then the second stream may be | 469 | * parameters, then the second stream may be |
470 | * constrained to the wrong sample rate or size. | 470 | * constrained to the wrong sample rate or size. |
471 | */ | 471 | */ |
472 | if (!first_runtime->sample_bits) { | 472 | if (first_runtime->sample_bits) { |
473 | dev_err(substream->pcm->card->dev, | 473 | snd_pcm_hw_constraint_minmax(substream->runtime, |
474 | "set sample size in %s stream first\n", | 474 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, |
475 | substream->stream == | ||
476 | SNDRV_PCM_STREAM_PLAYBACK | ||
477 | ? "capture" : "playback"); | ||
478 | return -EAGAIN; | ||
479 | } | ||
480 | |||
481 | snd_pcm_hw_constraint_minmax(substream->runtime, | ||
482 | SNDRV_PCM_HW_PARAM_SAMPLE_BITS, | ||
483 | first_runtime->sample_bits, | 475 | first_runtime->sample_bits, |
484 | first_runtime->sample_bits); | 476 | first_runtime->sample_bits); |
477 | } | ||
485 | } | 478 | } |
486 | 479 | ||
487 | ssi_private->second_stream = substream; | 480 | ssi_private->second_stream = substream; |