aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-12-03 10:28:52 +0100
committerTakashi Iwai <tiwai@suse.de>2012-12-03 10:30:45 +0100
commit2683fa197c831ad34b23263dcb091b9524856578 (patch)
treeed7d0ba291b1d2ba260bbaa435cad5944e3f3397
parent2029b29a99be38da1a8e3c2b289510ddce7c37d2 (diff)
downloadhda-emu-2683fa197c831ad34b23263dcb091b9524856578.tar.gz
Abort when PCM channel count doesn't match
When PCM stream operation is performed in PCM command and the given channel count isn't supported, currently hda-emu shows an error but continues the operation. It's often bad as it's easily overseen. If this error is detected, abort the operation to make it clear. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--hda-emu.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/hda-emu.c b/hda-emu.c
index c4e1a96..df175ec 100644
--- a/hda-emu.c
+++ b/hda-emu.c
@@ -679,9 +679,12 @@ void hda_test_pcm(int id, int op, int subid,
}
hda_log(HDA_LOG_INFO, "\n");
if (channels < runtime->hw.channels_min ||
- channels > runtime->hw.channels_max)
+ channels > runtime->hw.channels_max) {
hda_log(HDA_LOG_ERR, "Channels count (%d) not available for %s\n",
- channels, (dir ? "capture" : "playback"));
+ channels, (dir ? "capture" : "playback"));
+ snd_hda_power_down(_codec);
+ return;
+ }
hda_log(HDA_LOG_INFO, "Prepare PCM, rate=%d, channels=%d, "
"format=%d bits\n",
rate, channels, format);