Re: 2.6.36: Sound stop working

From: Takashi Iwai
Date: Thu Aug 12 2010 - 17:45:39 EST


At Thu, 12 Aug 2010 23:24:43 +0200,
Jiri Slaby wrote:
>
> On 08/12/2010 11:18 PM, Linus Torvalds wrote:
> > On Thu, Aug 12, 2010 at 2:01 PM, Jiri Slaby <jirislaby@xxxxxxxxx> wrote:
> >> Probably I got into this problem yesterday. Found out that PA fails to
> >> open /dev/snd/pcmC0D0p _second_ time. It opens it, then closes, then
> >> opens it again and gets EBUSY. aplay is OK.
>
> Perfectly reproducible in qemu-kvm with ac97 soundhw, i.e. intel8x0
> driver. Just in case you want to debug that easily.

And the below is a minimal test case to simulate the situation
PulseAudio does.


Takashi

===

#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <sys/inotify.h>
#include <unistd.h>

int main()
{
int fd;

inotify_add_watch(inotify_init(), "/dev/snd", IN_CLOSE_WRITE);

fd = open("/dev/snd/pcmC0D0p", O_RDWR | O_NONBLOCK);
if (fd < 0)
perror("open1");
else
close(fd);
fd = open("/dev/snd/pcmC0D0p", O_RDWR | O_NONBLOCK);
if (fd < 0)
perror("open2");
else
close(fd);
return 0;
}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/