]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - sound/drivers/aloop.c
ALSA: aloop: Mark paused device as inactive
[mirror_ubuntu-bionic-kernel.git] / sound / drivers / aloop.c
index 1063a4377502a8338bfa3237183068eefcf0da0a..58e349fc893f3815904aa0d85244bc4e4d6e9232 100644 (file)
@@ -296,6 +296,8 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
                cable->pause |= stream;
                loopback_timer_stop(dpcm);
                spin_unlock(&cable->lock);
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       loopback_active_notify(dpcm);
                break;
        case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
        case SNDRV_PCM_TRIGGER_RESUME:
@@ -304,6 +306,8 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
                cable->pause &= ~stream;
                loopback_timer_start(dpcm);
                spin_unlock(&cable->lock);
+               if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
+                       loopback_active_notify(dpcm);
                break;
        default:
                return -EINVAL;
@@ -892,9 +896,11 @@ static int loopback_active_get(struct snd_kcontrol *kcontrol,
                        [kcontrol->id.subdevice][kcontrol->id.device ^ 1];
        unsigned int val = 0;
 
-       if (cable != NULL)
-               val = (cable->running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ?
-                                                                       1 : 0;
+       if (cable != NULL) {
+               unsigned int running = cable->running ^ cable->pause;
+
+               val = (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) ? 1 : 0;
+       }
        ucontrol->value.integer.value[0] = val;
        return 0;
 }