Messages in this thread | | | Date | Thu, 12 Aug 2010 23:45:33 +0200 | From | Takashi Iwai <> | Subject | Re: 2.6.36: Sound stop working |
| |
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@gmail.com> 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; }
| |