Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] Add wireplumber runit service
@ 2022-03-30 10:42 Animeshz
  2022-03-30 10:43 ` [PR PATCH] [Updated] " Animeshz
                   ` (29 more replies)
  0 siblings, 30 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 10:42 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 390 bytes --]

There is a new pull request by Animeshz against master on the void-packages repository

https://github.com/Animeshz/void-packages wireplumber
https://github.com/void-linux/void-packages/pull/36416

Add wireplumber runit service
#### Testing the changes
- I tested the changes in this PR: **YES**


A patch file from https://github.com/void-linux/void-packages/pull/36416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-wireplumber-36416.patch --]
[-- Type: text/x-diff, Size: 2018 bytes --]

From 36f7e3ee1b8ad5e9a61ef111c54eea8f0db577d5 Mon Sep 17 00:00:00 2001
From: Animesh Sahu <animeshsahu19@yahoo.com>
Date: Tue, 29 Mar 2022 23:59:51 +0530
Subject: [PATCH] Add wireplumber script

---
 srcpkgs/wireplumber/files/wireplumber/control/t | 3 +++
 srcpkgs/wireplumber/files/wireplumber/run       | 5 +++++
 srcpkgs/wireplumber/template                    | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100755 srcpkgs/wireplumber/files/wireplumber/control/t
 create mode 100644 srcpkgs/wireplumber/files/wireplumber/run

diff --git a/srcpkgs/wireplumber/files/wireplumber/control/t b/srcpkgs/wireplumber/files/wireplumber/control/t
new file mode 100755
index 000000000000..29317922c4bb
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/control/t
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/bin/kill -TERM $(pgrep -P $(cat /run/runit/supervise.wireplumber/pid) | tail -1)
diff --git a/srcpkgs/wireplumber/files/wireplumber/run b/srcpkgs/wireplumber/files/wireplumber/run
new file mode 100644
index 000000000000..2049d18b4d2b
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# this service is experimental and most setups should start pipewire and wireplumber as a user,
+# for further information, please refer to the handbook
+sv check pipewire > /dev/null || exit 1
+exec env HOME=/var/run/pipewire chpst -u _pipewire:_pipewire:audio:video dbus-run-session wireplumber
diff --git a/srcpkgs/wireplumber/template b/srcpkgs/wireplumber/template
index e94c35b3eea5..dadbf62647fb 100644
--- a/srcpkgs/wireplumber/template
+++ b/srcpkgs/wireplumber/template
@@ -1,7 +1,7 @@
 # Template file for 'wireplumber'
 pkgname=wireplumber
 version=0.4.8
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 configure_args="-Dintrospection=enabled -Dsystem-lua=true"
@@ -18,6 +18,7 @@ checksum=a7a84c21230c339a905704a9495dda10a4dec41a96bc115a9b33d24310a3f605
 
 post_install() {
 	vlicense LICENSE
+	vsv wireplumber
 }
 
 wireplumber-devel_package() {

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] Add wireplumber runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
@ 2022-03-30 10:43 ` Animeshz
  2022-03-30 11:26 ` [PR REVIEW] wireplumber: Add " ahesford
                   ` (28 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 10:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

There is an updated pull request by Animeshz against master on the void-packages repository

https://github.com/Animeshz/void-packages wireplumber
https://github.com/void-linux/void-packages/pull/36416

Add wireplumber runit service
#### Testing the changes
- I tested the changes in this PR: **YES**

Also, closes #36393

A patch file from https://github.com/void-linux/void-packages/pull/36416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-wireplumber-36416.patch --]
[-- Type: text/x-diff, Size: 2026 bytes --]

From 7882d2f8a5c93e33b904f9c4603c179b41fdfe91 Mon Sep 17 00:00:00 2001
From: Animesh Sahu <animeshsahu19@yahoo.com>
Date: Tue, 29 Mar 2022 23:59:51 +0530
Subject: [PATCH] wireplumber: Add runit service

---
 srcpkgs/wireplumber/files/wireplumber/control/t | 3 +++
 srcpkgs/wireplumber/files/wireplumber/run       | 5 +++++
 srcpkgs/wireplumber/template                    | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100755 srcpkgs/wireplumber/files/wireplumber/control/t
 create mode 100644 srcpkgs/wireplumber/files/wireplumber/run

diff --git a/srcpkgs/wireplumber/files/wireplumber/control/t b/srcpkgs/wireplumber/files/wireplumber/control/t
new file mode 100755
index 000000000000..29317922c4bb
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/control/t
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/bin/kill -TERM $(pgrep -P $(cat /run/runit/supervise.wireplumber/pid) | tail -1)
diff --git a/srcpkgs/wireplumber/files/wireplumber/run b/srcpkgs/wireplumber/files/wireplumber/run
new file mode 100644
index 000000000000..2049d18b4d2b
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# this service is experimental and most setups should start pipewire and wireplumber as a user,
+# for further information, please refer to the handbook
+sv check pipewire > /dev/null || exit 1
+exec env HOME=/var/run/pipewire chpst -u _pipewire:_pipewire:audio:video dbus-run-session wireplumber
diff --git a/srcpkgs/wireplumber/template b/srcpkgs/wireplumber/template
index e94c35b3eea5..dadbf62647fb 100644
--- a/srcpkgs/wireplumber/template
+++ b/srcpkgs/wireplumber/template
@@ -1,7 +1,7 @@
 # Template file for 'wireplumber'
 pkgname=wireplumber
 version=0.4.8
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 configure_args="-Dintrospection=enabled -Dsystem-lua=true"
@@ -18,6 +18,7 @@ checksum=a7a84c21230c339a905704a9495dda10a4dec41a96bc115a9b33d24310a3f605
 
 post_install() {
 	vlicense LICENSE
+	vsv wireplumber
 }
 
 wireplumber-devel_package() {

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (2 preceding siblings ...)
  2022-03-30 11:26 ` ahesford
@ 2022-03-30 11:26 ` ahesford
  2022-03-30 11:50 ` Animeshz
                   ` (25 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 11:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 371 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838430463

Comment:
This probably doesn't do what you think it does. It certainly won't tell you if pipewire is running. I suspect order matters here, and pipewire needs to be running before wireplumber. If so, you'll need a more robust check.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
  2022-03-30 10:43 ` [PR PATCH] [Updated] " Animeshz
  2022-03-30 11:26 ` [PR REVIEW] wireplumber: Add " ahesford
@ 2022-03-30 11:26 ` ahesford
  2022-03-30 11:26 ` ahesford
                   ` (26 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 11:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 458 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838428919

Comment:
What does wireplumber do with a dbus user session? Using `dbus-run-session` makes a new, isolated bus that will be useless for external processes. Also, does a dbus user session require the existence of a system bus? You may need to `sv check dbus` to make sure the system bus is up. (I'm not sure about this.)

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
  2022-03-30 10:43 ` [PR PATCH] [Updated] " Animeshz
@ 2022-03-30 11:26 ` ahesford
  2022-03-30 11:26 ` ahesford
                   ` (27 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 11:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838423861

Comment:
What are you trying to accomplish here? This seems likely to be indeterminate, sending the term to some arbitrary child of wireplumber.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (3 preceding siblings ...)
  2022-03-30 11:26 ` ahesford
@ 2022-03-30 11:50 ` Animeshz
  2022-03-30 11:52 ` Animeshz
                   ` (24 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 11:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 537 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838449934

Comment:
dbus-run-session, for some reason [doesn't kill its child](https://gitlab.freedesktop.org/dbus/dbus/-/issues/389) `dbus-daemon` and the command invoked atm, might be a bug, as the parent who is expected to monitor the daemon should kill the child before it exits, `dbus-launch` does this, but the daemon doesn't exits if underlying command exits.

This kills the wireplumber (last fork).

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (4 preceding siblings ...)
  2022-03-30 11:50 ` Animeshz
@ 2022-03-30 11:52 ` Animeshz
  2022-03-30 11:52 ` Animeshz
                   ` (23 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 11:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838451098

Comment:
Yep, under the virtual `_pipewire` user for global access, like pipewire global service does.

> You may need to `sv check dbus` to make sure the system bus is up.
Yup, I forgot about that, sorry.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (5 preceding siblings ...)
  2022-03-30 11:52 ` Animeshz
@ 2022-03-30 11:52 ` Animeshz
  2022-03-30 11:55 ` Animeshz
                   ` (22 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 11:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 349 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838451098

Comment:
Yep, under the virtual `_pipewire` user for global access, like pipewire global service does.

> You may need to `sv check dbus` to make sure the system bus is up.

Yup, I forgot about that, sorry.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (6 preceding siblings ...)
  2022-03-30 11:52 ` Animeshz
@ 2022-03-30 11:55 ` Animeshz
  2022-03-30 11:55 ` Animeshz
                   ` (21 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 11:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 406 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838453833

Comment:
Not sure what robust check here is, because this global wireplumber is intended to run as long as global pipewire service is running. Do we need something like `sv check pipewire > /dev/null && (make sure pipewire has really been started before we proceed)`?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (7 preceding siblings ...)
  2022-03-30 11:55 ` Animeshz
@ 2022-03-30 11:55 ` Animeshz
  2022-03-30 12:03 ` Animeshz
                   ` (20 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 11:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 408 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838453833

Comment:
Not sure what robust check here is, because this global wireplumber is intended to run as long as "global pipewire" service is running. Do we need something like `sv check pipewire > /dev/null && (make sure pipewire has really been started before we proceed)`?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (8 preceding siblings ...)
  2022-03-30 11:55 ` Animeshz
@ 2022-03-30 12:03 ` Animeshz
  2022-03-30 12:03 ` Animeshz
                   ` (19 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 376 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838460865

Comment:
The dbus system bus is not exactly needed by the wireplumber actually, only some stuffs like bluetooth receiver (e.g. from mobile) I see is not working, which works after enabling dbus. Should it be mandatory to have it checked?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (9 preceding siblings ...)
  2022-03-30 12:03 ` Animeshz
@ 2022-03-30 12:03 ` Animeshz
  2022-03-30 12:04 ` Animeshz
                   ` (18 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 392 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838460865

Comment:
The dbus system bus is not exactly needed by the wireplumber actually, only some stuffs like using laptop as bluetooth receiver (e.g. from mobile) I see is not working, which works after enabling dbus. Should it be mandatory to have it checked?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (10 preceding siblings ...)
  2022-03-30 12:03 ` Animeshz
@ 2022-03-30 12:04 ` Animeshz
  2022-03-30 12:05 ` Animeshz
                   ` (17 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838453833

Comment:
Not sure what robust check here is, because this global wireplumber is intended to run as long as "global pipewire" service is running. Do we need something like `sv check pipewire > /dev/null && (make sure pipewire daemon has really been started and succeed before we proceed)`?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (11 preceding siblings ...)
  2022-03-30 12:04 ` Animeshz
@ 2022-03-30 12:05 ` Animeshz
  2022-03-30 12:10 ` Animeshz
                   ` (16 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 366 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838451098

Comment:
Yep, isolated session under the virtual `_pipewire` user for global access, like pipewire global service does.

> You may need to `sv check dbus` to make sure the system bus is up.

Yup, I forgot about that, sorry.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (12 preceding siblings ...)
  2022-03-30 12:05 ` Animeshz
@ 2022-03-30 12:10 ` Animeshz
  2022-03-30 12:30 ` ahesford
                   ` (15 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838449934

Comment:
dbus-run-session, for some reason [doesn't kill its child](https://gitlab.freedesktop.org/dbus/dbus/-/issues/389) `dbus-daemon` and the command invoked atm, might be a bug, as the parent who is expected to monitor the daemon should kill the child before it exits, `dbus-launch` does this, but the daemon doesn't exits if underlying command exits.

This kills the wireplumber (last fork), which by definition of `dbus-run-session` exits on process exit.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (13 preceding siblings ...)
  2022-03-30 12:10 ` Animeshz
@ 2022-03-30 12:30 ` ahesford
  2022-03-30 12:33 ` ahesford
                   ` (14 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 12:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 597 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838484710

Comment:
In that case, try adding `-P` to `chpst` to start the session in its own process group, then you should be able to replace this line with
```sh
[ -r supervise/pid ] && kill -TERM -$(cat supervise/pid)
```
Adding a `-` before the PID will signal the entire process group created by `chpst`. Use the relative path `supervise/pid` because the script shouldn't directly know about anything outside of its directory, and drop the full path to `kill`.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (14 preceding siblings ...)
  2022-03-30 12:30 ` ahesford
@ 2022-03-30 12:33 ` ahesford
  2022-03-30 12:37 ` ahesford
                   ` (13 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 12:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 603 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838487022

Comment:
I think a mandatory `dbus` service check is reasonable; any time somebody wishes to use dbus it is probably desirable and maybe necessary to have a system bus available for full functionality.

Also, I wouldn't rely on `env` to set `$HOME`. Instead,
```suggestion
export HOME=/var/run/pipewire
exec chpst -u _pipewire:_pipewire:audio:video -P dbus-run-session wireplumber
```
(with the `-P` added as suggested above to simplify process management).

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (15 preceding siblings ...)
  2022-03-30 12:33 ` ahesford
@ 2022-03-30 12:37 ` ahesford
  2022-03-30 12:40 ` ahesford
                   ` (12 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 12:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1367 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838491204

Comment:
`sv check pipewire` can't tell you if pipewire is running. It will only tell you if the service is linked in the service directory. For example, I believe `sv down pipewire` will still cause `sv check pipewire` to return success.

This works as most people expect for `sv check dbus` because `/etc/sv/dbus/check` exists and actually requires that the system bus be reachable before returning success. However, the pipewire service defines no `check` script so the check doesn't provide any real information.

If wireplumber *can* start before pipewire and will still do the right thing once the pipewire process is running, I would just drop the check altogether. If wireplumber dies when it starts before pipewire is running, dropping the check is OK too, because the service will just be retried until pipewire is up. However, if wireplumber starts but gets itself into an unrecoverable state (*e.g.*, starts its own pipewire process or simply hangs forever because it didn't find pipewire at startup) then something needs to be figured out to determine that pipewire is actually functional. This could be done here, or it could be done in an `/etc/sv/pipewire/check` script to make it available to all consumers.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (16 preceding siblings ...)
  2022-03-30 12:37 ` ahesford
@ 2022-03-30 12:40 ` ahesford
  2022-03-30 12:53 ` Animeshz
                   ` (11 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-30 12:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 792 bytes --]

New review comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838494141

Comment:
Note that the issue with `dbus-run-session` isn't that it makes a bus specific to `_pipewire`, but that it creates a *random* bus that *no other process*---including pipewire---will know about. Using `dbus-run-session` in, say, your xinitrc works as expected because a random bus is created and then all processes inherit an environment variable telling them where to find the bus.

If any process needs to communicate with wireplumber via this dbus session, dbus will have to be configured (as will all who wish to talk to it) to use a well-known socket. If nothing actually talks to wireplumber on this bus, why does wireplumber require it?

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (17 preceding siblings ...)
  2022-03-30 12:40 ` ahesford
@ 2022-03-30 12:53 ` Animeshz
  2022-03-30 12:53 ` Animeshz
                   ` (10 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838507207

Comment:
It actually exits if pipewire isn't running actually.

![a30-03-22-18h22m03s](https://user-images.githubusercontent.com/26714676/160838751-f28d30b9-78be-4f9c-9d14-de5b08f3d30e.jpg)


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (18 preceding siblings ...)
  2022-03-30 12:53 ` Animeshz
@ 2022-03-30 12:53 ` Animeshz
  2022-03-30 13:09 ` [PR PATCH] [Updated] " Animeshz
                   ` (9 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 12:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 323 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838507207

Comment:
It actually exits if pipewire isn't running.

![a30-03-22-18h22m03s](https://user-images.githubusercontent.com/26714676/160838751-f28d30b9-78be-4f9c-9d14-de5b08f3d30e.jpg)


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (19 preceding siblings ...)
  2022-03-30 12:53 ` Animeshz
@ 2022-03-30 13:09 ` Animeshz
  2022-03-30 14:29 ` [PR REVIEW] " Animeshz
                   ` (8 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 13:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

There is an updated pull request by Animeshz against master on the void-packages repository

https://github.com/Animeshz/void-packages wireplumber
https://github.com/void-linux/void-packages/pull/36416

wireplumber: Add runit service
#### Testing the changes
- I tested the changes in this PR: **YES**

Also, closes #36393

A patch file from https://github.com/void-linux/void-packages/pull/36416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-wireplumber-36416.patch --]
[-- Type: text/x-diff, Size: 3514 bytes --]

From 7882d2f8a5c93e33b904f9c4603c179b41fdfe91 Mon Sep 17 00:00:00 2001
From: Animesh Sahu <animeshsahu19@yahoo.com>
Date: Tue, 29 Mar 2022 23:59:51 +0530
Subject: [PATCH 1/2] wireplumber: Add runit service

---
 srcpkgs/wireplumber/files/wireplumber/control/t | 3 +++
 srcpkgs/wireplumber/files/wireplumber/run       | 5 +++++
 srcpkgs/wireplumber/template                    | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100755 srcpkgs/wireplumber/files/wireplumber/control/t
 create mode 100644 srcpkgs/wireplumber/files/wireplumber/run

diff --git a/srcpkgs/wireplumber/files/wireplumber/control/t b/srcpkgs/wireplumber/files/wireplumber/control/t
new file mode 100755
index 000000000000..29317922c4bb
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/control/t
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+/usr/bin/kill -TERM $(pgrep -P $(cat /run/runit/supervise.wireplumber/pid) | tail -1)
diff --git a/srcpkgs/wireplumber/files/wireplumber/run b/srcpkgs/wireplumber/files/wireplumber/run
new file mode 100644
index 000000000000..2049d18b4d2b
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/run
@@ -0,0 +1,5 @@
+#!/bin/sh
+# this service is experimental and most setups should start pipewire and wireplumber as a user,
+# for further information, please refer to the handbook
+sv check pipewire > /dev/null || exit 1
+exec env HOME=/var/run/pipewire chpst -u _pipewire:_pipewire:audio:video dbus-run-session wireplumber
diff --git a/srcpkgs/wireplumber/template b/srcpkgs/wireplumber/template
index e94c35b3eea5..dadbf62647fb 100644
--- a/srcpkgs/wireplumber/template
+++ b/srcpkgs/wireplumber/template
@@ -1,7 +1,7 @@
 # Template file for 'wireplumber'
 pkgname=wireplumber
 version=0.4.8
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 configure_args="-Dintrospection=enabled -Dsystem-lua=true"
@@ -18,6 +18,7 @@ checksum=a7a84c21230c339a905704a9495dda10a4dec41a96bc115a9b33d24310a3f605
 
 post_install() {
 	vlicense LICENSE
+	vsv wireplumber
 }
 
 wireplumber-devel_package() {

From 34ee19cf6d43209394543b29783a10d22d3f8028 Mon Sep 17 00:00:00 2001
From: Animesh Sahu <animeshsahu19@yahoo.com>
Date: Wed, 30 Mar 2022 18:39:09 +0530
Subject: [PATCH 2/2] wireplumber: apply pr suggestions

---
 srcpkgs/wireplumber/files/wireplumber/control/t | 3 +--
 srcpkgs/wireplumber/files/wireplumber/run       | 4 ++--
 2 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/wireplumber/files/wireplumber/control/t b/srcpkgs/wireplumber/files/wireplumber/control/t
index 29317922c4bb..a095b7bc777a 100755
--- a/srcpkgs/wireplumber/files/wireplumber/control/t
+++ b/srcpkgs/wireplumber/files/wireplumber/control/t
@@ -1,3 +1,2 @@
 #!/bin/sh
-
-/usr/bin/kill -TERM $(pgrep -P $(cat /run/runit/supervise.wireplumber/pid) | tail -1)
+[ -r supervise/pid ] && kill -TERM -$(cat supervise/pid)
diff --git a/srcpkgs/wireplumber/files/wireplumber/run b/srcpkgs/wireplumber/files/wireplumber/run
index 2049d18b4d2b..649882664c30 100644
--- a/srcpkgs/wireplumber/files/wireplumber/run
+++ b/srcpkgs/wireplumber/files/wireplumber/run
@@ -1,5 +1,5 @@
 #!/bin/sh
 # this service is experimental and most setups should start pipewire and wireplumber as a user,
 # for further information, please refer to the handbook
-sv check pipewire > /dev/null || exit 1
-exec env HOME=/var/run/pipewire chpst -u _pipewire:_pipewire:audio:video dbus-run-session wireplumber
+export HOME=/var/run/pipewire
+exec chpst -u _pipewire:_pipewire:audio:video -P dbus-run-session wireplumber

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (20 preceding siblings ...)
  2022-03-30 13:09 ` [PR PATCH] [Updated] " Animeshz
@ 2022-03-30 14:29 ` Animeshz
  2022-03-30 14:31 ` [PR PATCH] [Updated] " Animeshz
                   ` (7 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 14:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838614429

Comment:
I'm not too sure why its necessary, I just created an upstream issue [wireplumber#237](https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/237) for the enquiry.

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Updated] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (21 preceding siblings ...)
  2022-03-30 14:29 ` [PR REVIEW] " Animeshz
@ 2022-03-30 14:31 ` Animeshz
  2022-03-30 17:36 ` [PR REVIEW] " subnut
                   ` (6 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 14:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 417 bytes --]

There is an updated pull request by Animeshz against master on the void-packages repository

https://github.com/Animeshz/void-packages wireplumber
https://github.com/void-linux/void-packages/pull/36416

wireplumber: Add runit service
#### Testing the changes
- I tested the changes in this PR: **YES**

Also, closes #36393

A patch file from https://github.com/void-linux/void-packages/pull/36416.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-wireplumber-36416.patch --]
[-- Type: text/x-diff, Size: 1998 bytes --]

From 5e4c248e52d95fd74d61bfa93a9372682631ef08 Mon Sep 17 00:00:00 2001
From: Animesh Sahu <animeshsahu19@yahoo.com>
Date: Tue, 29 Mar 2022 23:59:51 +0530
Subject: [PATCH] wireplumber: Add runit service

---
 srcpkgs/wireplumber/files/wireplumber/control/t | 2 ++
 srcpkgs/wireplumber/files/wireplumber/run       | 6 ++++++
 srcpkgs/wireplumber/template                    | 3 ++-
 3 files changed, 10 insertions(+), 1 deletion(-)
 create mode 100755 srcpkgs/wireplumber/files/wireplumber/control/t
 create mode 100644 srcpkgs/wireplumber/files/wireplumber/run

diff --git a/srcpkgs/wireplumber/files/wireplumber/control/t b/srcpkgs/wireplumber/files/wireplumber/control/t
new file mode 100755
index 000000000000..a095b7bc777a
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/control/t
@@ -0,0 +1,2 @@
+#!/bin/sh
+[ -r supervise/pid ] && kill -TERM -$(cat supervise/pid)
diff --git a/srcpkgs/wireplumber/files/wireplumber/run b/srcpkgs/wireplumber/files/wireplumber/run
new file mode 100644
index 000000000000..07f78f10c7f7
--- /dev/null
+++ b/srcpkgs/wireplumber/files/wireplumber/run
@@ -0,0 +1,6 @@
+#!/bin/sh
+# this service is experimental and most setups should start pipewire and wireplumber as a user,
+# for further information, please refer to the handbook
+sv check dbus > /dev/null || exit 1
+export HOME=/var/run/pipewire
+exec chpst -u _pipewire:_pipewire:audio:video -P dbus-run-session wireplumber
diff --git a/srcpkgs/wireplumber/template b/srcpkgs/wireplumber/template
index e94c35b3eea5..dadbf62647fb 100644
--- a/srcpkgs/wireplumber/template
+++ b/srcpkgs/wireplumber/template
@@ -1,7 +1,7 @@
 # Template file for 'wireplumber'
 pkgname=wireplumber
 version=0.4.8
-revision=1
+revision=2
 build_style=meson
 build_helper=gir
 configure_args="-Dintrospection=enabled -Dsystem-lua=true"
@@ -18,6 +18,7 @@ checksum=a7a84c21230c339a905704a9495dda10a4dec41a96bc115a9b33d24310a3f605
 
 post_install() {
 	vlicense LICENSE
+	vsv wireplumber
 }
 
 wireplumber-devel_package() {

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (22 preceding siblings ...)
  2022-03-30 14:31 ` [PR PATCH] [Updated] " Animeshz
@ 2022-03-30 17:36 ` subnut
  2022-03-30 17:40 ` subnut
                   ` (5 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: subnut @ 2022-03-30 17:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838803073

Comment:
@Animeshz Wireplumber uses the dbus bus to connect to pipewire, IIRC

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (23 preceding siblings ...)
  2022-03-30 17:36 ` [PR REVIEW] " subnut
@ 2022-03-30 17:40 ` subnut
  2022-03-30 18:13 ` Animeshz
                   ` (4 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: subnut @ 2022-03-30 17:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 194 bytes --]

New review comment by subnut on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838805774

Comment:
https://wiki.alpinelinux.org/wiki/PipeWire#D-Bus

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (24 preceding siblings ...)
  2022-03-30 17:40 ` subnut
@ 2022-03-30 18:13 ` Animeshz
  2022-03-30 18:18 ` Animeshz
                   ` (3 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 18:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 473 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838832766

Comment:
Oh yes, seems reasonable, I can play songs using `pw-play` without system bus (dbus service). The session started using `dbus-run-session` seems to be utilized to connect to pipewire (I guess?).

![a30-03-22-23h42m02s](https://user-images.githubusercontent.com/26714676/160903184-bbefe93b-e1af-4fe8-8c10-40e6af1c3153.jpg)


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (25 preceding siblings ...)
  2022-03-30 18:13 ` Animeshz
@ 2022-03-30 18:18 ` Animeshz
  2022-03-30 18:25 ` Animeshz
                   ` (2 subsequent siblings)
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 18:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 602 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838832766

Comment:
Oh yes, seems reasonable, I can play songs using `pw-play` without system bus (dbus service). The session started using `dbus-run-session` seems to be utilized to connect to pipewire (I guess?).

![a30-03-22-23h42m02s](https://user-images.githubusercontent.com/26714676/160903184-bbefe93b-e1af-4fe8-8c10-40e6af1c3153.jpg)

(Also confirmed by restarting wireplumber and pipewire when dbus was down, to make sure sink/source nodes aren't just cached)


^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (26 preceding siblings ...)
  2022-03-30 18:18 ` Animeshz
@ 2022-03-30 18:25 ` Animeshz
  2022-03-30 18:28 ` Animeshz
  2022-03-31  2:13 ` [PR PATCH] [Closed]: " ahesford
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 18:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 777 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838832766

Comment:
~~Oh yes, seems reasonable, I can play songs using `pw-play` without system bus (dbus service). The session started using `dbus-run-session` seems to be utilized to connect to pipewire (I guess?).~~

![a30-03-22-23h42m02s](https://user-images.githubusercontent.com/26714676/160903184-bbefe93b-e1af-4fe8-8c10-40e6af1c3153.jpg)

~~(Also confirmed by restarting wireplumber and pipewire when dbus was down, to make sure sink/source nodes aren't just cached)~~

No, it seems like it connects to pipewire by dynamically linking with shared libpipewire library, and exposed headers only. I still don't get the use of dbus here...

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR REVIEW] wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (27 preceding siblings ...)
  2022-03-30 18:25 ` Animeshz
@ 2022-03-30 18:28 ` Animeshz
  2022-03-31  2:13 ` [PR PATCH] [Closed]: " ahesford
  29 siblings, 0 replies; 31+ messages in thread
From: Animeshz @ 2022-03-30 18:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 796 bytes --]

New review comment by Animeshz on void-packages repository

https://github.com/void-linux/void-packages/pull/36416#discussion_r838832766

Comment:
~~Oh yes, seems reasonable, I can play songs using `pw-play` without system bus (dbus service). The session started using `dbus-run-session` seems to be utilized to connect to pipewire (I guess?).~~

<img src="https://user-images.githubusercontent.com/26714676/160903184-bbefe93b-e1af-4fe8-8c10-40e6af1c3153.jpg" width="200px" height="200px" />

~~(Also confirmed by restarting wireplumber and pipewire when dbus was down, to make sure sink/source nodes aren't just cached)~~

No, it seems like it connects to pipewire by dynamically linking with shared libpipewire library, and exposed headers only. I still don't get the use of dbus here...

^ permalink raw reply	[flat|nested] 31+ messages in thread

* Re: [PR PATCH] [Closed]: wireplumber: Add runit service
  2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
                   ` (28 preceding siblings ...)
  2022-03-30 18:28 ` Animeshz
@ 2022-03-31  2:13 ` ahesford
  29 siblings, 0 replies; 31+ messages in thread
From: ahesford @ 2022-03-31  2:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 255 bytes --]

There's a closed pull request on the void-packages repository

wireplumber: Add runit service
https://github.com/void-linux/void-packages/pull/36416

Description:
#### Testing the changes
- I tested the changes in this PR: **YES**

Also, closes #36393

^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2022-03-31  2:13 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-30 10:42 [PR PATCH] Add wireplumber runit service Animeshz
2022-03-30 10:43 ` [PR PATCH] [Updated] " Animeshz
2022-03-30 11:26 ` [PR REVIEW] wireplumber: Add " ahesford
2022-03-30 11:26 ` ahesford
2022-03-30 11:26 ` ahesford
2022-03-30 11:50 ` Animeshz
2022-03-30 11:52 ` Animeshz
2022-03-30 11:52 ` Animeshz
2022-03-30 11:55 ` Animeshz
2022-03-30 11:55 ` Animeshz
2022-03-30 12:03 ` Animeshz
2022-03-30 12:03 ` Animeshz
2022-03-30 12:04 ` Animeshz
2022-03-30 12:05 ` Animeshz
2022-03-30 12:10 ` Animeshz
2022-03-30 12:30 ` ahesford
2022-03-30 12:33 ` ahesford
2022-03-30 12:37 ` ahesford
2022-03-30 12:40 ` ahesford
2022-03-30 12:53 ` Animeshz
2022-03-30 12:53 ` Animeshz
2022-03-30 13:09 ` [PR PATCH] [Updated] " Animeshz
2022-03-30 14:29 ` [PR REVIEW] " Animeshz
2022-03-30 14:31 ` [PR PATCH] [Updated] " Animeshz
2022-03-30 17:36 ` [PR REVIEW] " subnut
2022-03-30 17:40 ` subnut
2022-03-30 18:13 ` Animeshz
2022-03-30 18:18 ` Animeshz
2022-03-30 18:25 ` Animeshz
2022-03-30 18:28 ` Animeshz
2022-03-31  2:13 ` [PR PATCH] [Closed]: " ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).