Commit 29998d24 authored by Clemens Ladisch's avatar Clemens Ladisch Committed by Jaroslav Kysela

[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: default avatarClemens Ladisch <clemens@ladisch.de>
Signed-off-by: default avatarJaroslav Kysela <perex@suse.cz>
parent 82467611
...@@ -853,6 +853,9 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream, ...@@ -853,6 +853,9 @@ static int snd_ca0106_pcm_trigger_playback(struct snd_pcm_substream *substream,
break; break;
} }
snd_pcm_group_for_each_entry(s, substream) { 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; runtime = s->runtime;
epcm = runtime->private_data; epcm = runtime->private_data;
channel = epcm->channel_id; channel = epcm->channel_id;
......
...@@ -448,6 +448,9 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream, ...@@ -448,6 +448,9 @@ static int snd_p16v_pcm_trigger_playback(struct snd_pcm_substream *substream,
break; break;
} }
snd_pcm_group_for_each_entry(s, substream) { 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; runtime = s->runtime;
epcm = runtime->private_data; epcm = runtime->private_data;
channel = substream->pcm->device-emu->p16v_device_offset; channel = substream->pcm->device-emu->p16v_device_offset;
......
...@@ -341,10 +341,12 @@ static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd) ...@@ -341,10 +341,12 @@ static int snd_vt1724_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
what = 0; what = 0;
snd_pcm_group_for_each_entry(s, substream) { snd_pcm_group_for_each_entry(s, substream) {
const struct vt1724_pcm_reg *reg; if (snd_pcm_substream_chip(s) == ice) {
reg = s->runtime->private_data; const struct vt1724_pcm_reg *reg;
what |= reg->start; reg = s->runtime->private_data;
snd_pcm_trigger_done(s, substream); what |= reg->start;
snd_pcm_trigger_done(s, substream);
}
} }
switch (cmd) { switch (cmd) {
......
...@@ -646,6 +646,8 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd) ...@@ -646,6 +646,8 @@ static int pcxhr_trigger(struct snd_pcm_substream *subs, int cmd)
if (snd_pcm_stream_linked(subs)) { if (snd_pcm_stream_linked(subs)) {
struct snd_pcxhr *chip = snd_pcm_substream_chip(subs); struct snd_pcxhr *chip = snd_pcm_substream_chip(subs);
snd_pcm_group_for_each_entry(s, subs) { snd_pcm_group_for_each_entry(s, subs) {
if (snd_pcm_substream_chip(s) != chip)
continue;
stream = s->runtime->private_data; stream = s->runtime->private_data;
stream->status = stream->status =
PCXHR_STREAM_STATUS_SCHEDULE_RUN; PCXHR_STREAM_STATUS_SCHEDULE_RUN;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment