m1k1o / neko

A self hosted virtual browser that runs in docker and uses WebRTC.
https://neko.m1k1o.net/
Apache License 2.0
5.94k stars 449 forks source link

Audio pipeline shutdown deadlocks if pulsesrc fails to open PA socket #380

Closed tt2468 closed 3 months ago

tt2468 commented 3 months ago

If Neko is run without a pulseaudio server or the server is misconfigured, the pipeline will fail. A side effect of this happening is that upon shutdown of the pipeline (last client exits), the pipeline will block upon sending the EOS event to the pipeline here: https://github.com/m1k1o/neko/blob/master/server/internal/capture/gst/gst.c#L131

This can be reproduced by:

If the deadlocked process is inspected with GDB, you will find the blocking c call.

I am not yet done debugging this, but I'm giving up for the night and do not know when I might be able to pick up further debugging, so I'm posting an issue in the case that maybe someone who is more familiar with gstreamer's inner workings can shed light on what the root issue is.

m1k1o commented 3 months ago

This has been discussed in https://github.com/m1k1o/neko/issues/284 gstreamer's freezing behaviour was indentified here.

But since it was closed and the original issue was not tracked down, we can leave this issue open to volunteers that would take a look at gstreamer codebase and would like to find the solutiion.