aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core/pcm.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2006-08-04 06:57:19 -0400
committerJaroslav Kysela <perex@suse.cz>2006-09-23 04:39:59 -0400
commit2529bba7606b23c1b7161d3c2ad486162e8650f9 (patch)
treefc19403b51f9a8c3d080fac7acd50c3a95cb652c /sound/core/pcm.c
parentf03d68fe343d70bb06ecdb3d70dcf0e678ed99f9 (diff)
[ALSA] Fix substream selection in PCM and rawmidi
The PCM and rawmidi substreams can be selected explicitly by opening control handle and set via *_PREFER_SUBDEVICE ioctl. But, when multiple controls are opened, the driver gets confused. The patch fixes the initialization of prefer_*_subdevice and the check of multiple controls. The first set subdevice is picked up as the valid one. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
Diffstat (limited to 'sound/core/pcm.c')
-rw-r--r--sound/core/pcm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index f52178abf12..ed3b0946956 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -792,7 +792,8 @@ int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream,
792 kctl = snd_ctl_file(list); 792 kctl = snd_ctl_file(list);
793 if (kctl->pid == current->pid) { 793 if (kctl->pid == current->pid) {
794 prefer_subdevice = kctl->prefer_pcm_subdevice; 794 prefer_subdevice = kctl->prefer_pcm_subdevice;
795 break; 795 if (prefer_subdevice != -1)
796 break;
796 } 797 }
797 } 798 }
798 up_read(&card->controls_rwsem); 799 up_read(&card->controls_rwsem);