summaryrefslogtreecommitdiff
blob: 511dc6df377e9fe050cf39864570593f7d0a0291 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
From efd24584182903bf5ee4660a3b3360cc47ad895b Mon Sep 17 00:00:00 2001
From: Wim Taymans <wtaymans@redhat.com>
Date: Tue, 23 Nov 2021 13:17:29 +0100
Subject: [PATCH] alsa: handle the release-requested signal

Handle the release-requested signal by destroying the device and
then calling release.

Fixes pipewire/pipewire#1846
---
 src/scripts/monitors/alsa.lua | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/scripts/monitors/alsa.lua b/src/scripts/monitors/alsa.lua
index 68c39d8..be4648e 100644
--- a/src/scripts/monitors/alsa.lua
+++ b/src/scripts/monitors/alsa.lua
@@ -287,6 +287,12 @@ function prepareDevice(parent, id, type, factory, properties)
       end
     end)
 
+    rd:connect("release-requested", function (rd)
+        Log.info("release requested")
+        parent:store_managed_object(id, nil)
+        rd:call("release")
+    end)
+
     if jack_device then
       rd:connect("notify::owner-name-changed", function (rd, pspec)
         if rd["state"] == "busy" and
-- 
2.34.1