[alsa-devel] Loopback interface: suspend/resume leads to a kernel crash

El boulangero elboulangero at gmail.com
Sat Feb 2 16:05:54 CET 2013


Hi Takashi, thanks for your quick reply.


> Which kernel are you using?  Some races in aloop driver have been
> fixed in 3.7 kernel.

I tried different kernel versions, including:
 + official debian kernel (3.2.0-4)
 + liquorix debian kernel (3.7.0-4)
 + upstream kernel from kernel.org (git repository, 3.8.0-rc6 at the moment)

The bug is present in every version.


> If the problem is still seen on 3.6 kernel, try the patch below.
> Let me know if it fixes the problem.

I applied this patch to the upstream kernel, and it fixes the problem.
Thanks a lot !

Regards,
Arnaud.


2013/2/1 Takashi Iwai <tiwai at suse.de>:
> At Fri, 01 Feb 2013 15:48:53 +0100,
> Takashi Iwai wrote:
>>
>> At Thu, 31 Jan 2013 21:09:13 +0100,
>> El boulangero wrote:
>> >
>> > Hi,
>> >
>> > I use the loopback device all the time. It works pretty good, except
>> > when I suspend my computer to RAM. On resume, I've got a kernel call
>> > trace.
>>
>> Which kernel are you using?  Some races in aloop driver have been
>> fixed in 3.7 kernel.
>
> If the problem is still seen on 3.6 kernel, try the patch below.
> Let me know if it fixes the problem.
>
>
> Takashi
>
> ---
> diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
> index 3d82232..64d5347 100644
> --- a/sound/drivers/aloop.c
> +++ b/sound/drivers/aloop.c
> @@ -286,12 +286,14 @@ static int loopback_trigger(struct snd_pcm_substream *substream, int cmd)
>                         loopback_active_notify(dpcm);
>                 break;
>         case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
> +       case SNDRV_PCM_TRIGGER_SUSPEND:
>                 spin_lock(&cable->lock);
>                 cable->pause |= stream;
>                 loopback_timer_stop(dpcm);
>                 spin_unlock(&cable->lock);
>                 break;
>         case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
> +       case SNDRV_PCM_TRIGGER_RESUME:
>                 spin_lock(&cable->lock);
>                 dpcm->last_jiffies = jiffies;
>                 cable->pause &= ~stream;
> @@ -563,7 +565,8 @@ static snd_pcm_uframes_t loopback_pointer(struct snd_pcm_substream *substream)
>  static struct snd_pcm_hardware loopback_pcm_hardware =
>  {
>         .info =         (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_MMAP |
> -                        SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE),
> +                        SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE |
> +                        SNDRV_PCM_INFO_RESUME),
>         .formats =      (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S16_BE |
>                          SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_S32_BE |
>                          SNDRV_PCM_FMTBIT_FLOAT_LE | SNDRV_PCM_FMTBIT_FLOAT_BE),


More information about the Alsa-devel mailing list