diff options
author | Clemens Ladisch <clemens@ladisch.de> | 2007-07-30 02:14:31 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2007-10-16 09:58:13 -0400 |
commit | 29998d24ab5ec488cd127488246cc749b0ac52d6 (patch) | |
tree | bef33b79ed8c45f88c73871694418f563deaa10b /sound | |
parent | 82467611ffc41fba534c95f8b4ae3887a90f5a66 (diff) |
[ALSA] check for linked substreams of different cards
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/ca0106/ca0106_main.c | 3 | ||||
-rw-r--r-- | sound/pci/emu10k1/p16v.c | 3 | ||||
-rw-r--r-- | sound/pci/ice1712/ice1724.c | 10 | ||||
-rw-r--r-- | sound/pci/pcxhr/pcxhr.c | 2 |
4 files changed, 14 insertions, 4 deletions
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 611fc15a0545..c7f79be98d04 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -853,6 +853,9 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, | |||
853 | break; | 853 | break; |
854 | } | 854 | } |
855 | snd_pcm_group_for_each_entry(s, substream) { | 855 | snd_pcm_group_for_each_entry(s, substream) { |
856 | if (snd_pcm_substream_chip(s) != emu || | ||
857 | s->stream != SNDRV_PCM_STREAM_PLAYBACK) | ||
858 | continue; | ||
856 | runtime = s->runtime; | 859 | runtime = s->runtime; |
857 | epcm = runtime->private_data; | 860 | epcm = runtime->private_data; |
858 | channel = epcm->channel_id; | 861 | channel = epcm->channel_id; |
diff --git a/sound/pci/emu10k1/p16v.c b/sound/pci/emu10k1/p16v.c index 7ee19c63c2c8..6ace1076c19b 100644 --- a/sound/pci/emu10k1/p16v.c +++ b/sound/pci/emu10k1/p16v.c | |||
@@ -448,6 +448,9 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream, | |||
448 | break; | 448 | break; |
449 | } | 449 | } |
450 | snd_pcm_group_for_each_entry(s, substream) { | 450 | snd_pcm_group_for_each_entry(s, substream) { |
451 | if (snd_pcm_substream_chip(s) != emu || | ||
452 | s->stream != SNDRV_PCM_STREAM_PLAYBACK) | ||
453 | continue; | ||
451 | runtime = s->runtime; | 454 | runtime = s->runtime; |
452 | epcm = runtime->private_data; | 455 | epcm = runtime->private_data; |
453 | channel = substream->pcm->device-emu->p16v_device_offset; | 456 | channel = substream->pcm->device-emu->p16v_device_offset; |
diff --git a/sound/pci/ice1712/ice1724.c b/sound/pci/ice1712/ice1724.c index 32560cfb6c3f..23c9383e7cce 100644 --- a/sound/pci/ice1712/ice1724.c +++ b/sound/pci/ice1712/ice1724.c | |||
@@ -341,10 +341,12 @@ static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd) | |||
341 | 341 | ||
342 | what = 0; | 342 | what = 0; |
343 | snd_pcm_group_for_each_entry(s, substream) { | 343 | snd_pcm_group_for_each_entry(s, substream) { |
344 | const struct vt1724_pcm_reg *reg; | 344 | if (snd_pcm_substream_chip(s) == ice) { |
345 | reg = s->runtime->private_data; | 345 | const struct vt1724_pcm_reg *reg; |
346 | what |= reg->start; | 346 | reg = s->runtime->private_data; |
347 | snd_pcm_trigger_done(s, substream); | 347 | what |= reg->start; |
348 | snd_pcm_trigger_done(s, substream); | ||
349 | } | ||
348 | } | 350 | } |
349 | 351 | ||
350 | switch (cmd) { | 352 | switch (cmd) { |
diff --git a/sound/pci/pcxhr/pcxhr.c b/sound/pci/pcxhr/pcxhr.c index f7f6a687f033..1b787f455576 100644 --- a/sound/pci/pcxhr/pcxhr.c +++ b/sound/pci/pcxhr/pcxhr.c | |||
@@ -646,6 +646,8 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) | |||
646 | if (snd_pcm_stream_linked(subs)) { | 646 | if (snd_pcm_stream_linked(subs)) { |
647 | struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); | 647 | struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); |
648 | snd_pcm_group_for_each_entry(s, subs) { | 648 | snd_pcm_group_for_each_entry(s, subs) { |
649 | if (snd_pcm_substream_chip(s) != chip) | ||
650 | continue; | ||
649 | stream = s->runtime->private_data; | 651 | stream = s->runtime->private_data; |
650 | stream->status = | 652 | stream->status = |
651 | PCXHR_STREAM_STATUS_SCHEDULE_RUN; | 653 | PCXHR_STREAM_STATUS_SCHEDULE_RUN; |