[ALSA] check for linked substreams of different cards
authorClemens Ladisch <clemens@ladisch.de>
Mon, 30 Jul 2007 06:14:31 +0000 (08:14 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 16 Oct 2007 13:58:13 +0000 (15:58 +0200)
It is possible to have linked substreams that belong to different cards
and/or different drivers.  This patch changes some drivers to make sure
that they do not incorrectly try to handle substreams of a different
card.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/pci/ca0106/ca0106_main.c
sound/pci/emu10k1/p16v.c
sound/pci/ice1712/ice1724.c
sound/pci/pcxhr/pcxhr.c

index 611fc15a0545b22a33e714ed8b9e8a8d5ffb077a..c7f79be98d04c3feaedb21505137e86acb5f0391 100644 (file)
@@ -853,6 +853,9 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
                break;
        }
         snd_pcm_group_for_each_entry(s, substream) {
+               if (snd_pcm_substream_chip(s) != emu ||
+                   s->stream != SNDRV_PCM_STREAM_PLAYBACK)
+                       continue;
                runtime = s->runtime;
                epcm = runtime->private_data;
                channel = epcm->channel_id;
index 7ee19c63c2c8a2114f6d099bacd6051b3ce8482d..6ace1076c19b80438d97c0df1817a4a07cbeb051 100644 (file)
@@ -448,6 +448,9 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
                break;
        }
         snd_pcm_group_for_each_entry(s, substream) {
+               if (snd_pcm_substream_chip(s) != emu ||
+                   s->stream != SNDRV_PCM_STREAM_PLAYBACK)
+                       continue;
                runtime = s->runtime;
                epcm = runtime->private_data;
                channel = substream->pcm->device-emu->p16v_device_offset;
index 32560cfb6c3fcafdfe8bb210ea34d2b3c6d66008..23c9383e7ccef51de172d9404f3a8775126b1806 100644 (file)
@@ -341,10 +341,12 @@ static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
 
        what = 0;
        snd_pcm_group_for_each_entry(s, substream) {
-               const struct vt1724_pcm_reg *reg;
-               reg = s->runtime->private_data;
-               what |= reg->start;
-               snd_pcm_trigger_done(s, substream);
+               if (snd_pcm_substream_chip(s) == ice) {
+                       const struct vt1724_pcm_reg *reg;
+                       reg = s->runtime->private_data;
+                       what |= reg->start;
+                       snd_pcm_trigger_done(s, substream);
+               }
        }
 
        switch (cmd) {
index f7f6a687f033d16dab9b8d0b4534f79ba68e7832..1b787f45557674800d2100d16b6b3dc407894484 100644 (file)
@@ -646,6 +646,8 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
                if (snd_pcm_stream_linked(subs)) {
                        struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
                        snd_pcm_group_for_each_entry(s, subs) {
+                               if (snd_pcm_substream_chip(s) != chip)
+                                       continue;
                                stream = s->runtime->private_data;
                                stream->status =
                                        PCXHR_STREAM_STATUS_SCHEDULE_RUN;