ALSA: snd-usb-caiaq: Lock on stream start/unpause
authorMark Hills <mark@pogo.org.uk>
Sat, 24 Oct 2009 11:59:36 +0000 (12:59 +0100)
committerTakashi Iwai <tiwai@suse.de>
Fri, 30 Oct 2009 11:29:42 +0000 (12:29 +0100)
Fix a bug which can result in white noise from the driver after stream
start or unpause.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/caiaq/audio.c

index e76017cd5acf1bee8f5d1195864df68a1144e15b..86b2c3b92df53abafa8188560c4e034ce987ea97 100644 (file)
@@ -62,10 +62,14 @@ static void
 activate_substream(struct snd_usb_caiaqdev *dev,
                   struct snd_pcm_substream *sub)
 {
+       spin_lock(&dev->spinlock);
+
        if (sub->stream == SNDRV_PCM_STREAM_PLAYBACK)
                dev->sub_playback[sub->number] = sub;
        else
                dev->sub_capture[sub->number] = sub;
+
+       spin_unlock(&dev->spinlock);
 }
 
 static void