[alsa-devel] Closing alsa devices after forking off children
Hello,
I'm currently trying to figure out why a close of the alsa device is not realized 'quickly'. That is it seems to take 2 to 3 seconds before I can reopen the device in anopther program. After observing this behavior somewhat I figured out that opening an alsa device and then forking off a process will keep the alsa device open until the child dies, even when the parent process closes the alsa device.
Is this behavior known and if so how can I work around this ?
I tried to use pthread_atfork to close the device in the forked off child, but that closes the device in the parent process as well, so I would rather want to unlink the device in such a way that the close call does not need to wait until all children have given up their handle.
With kind regards,
participants (1)
-
Werner Van Belle