Artix Linux Forum

Artix Linux => System => Topic started by: chimay on 10 July 2025, 12:14:25

Title: Pipewire needs turnstile to be enabled as a user service
Post by: chimay on 10 July 2025, 12:14:25
The wiki doesn't mention the need to install and enable turnstile(d) :

https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio

Without it, dinitctl refuses to enable pipewire* and wireplumber services a a user.

Btw, is there a way to register to the wiki, or is it closed ?
Title: Re: Pipewire needs turnstile to be enabled as a user service
Post by: Artist on 10 July 2025, 14:04:34
Turnstile should not be required. That it 'solves' your problem is probably because it sets the XDG env vars for you. There are other ways to do that.

artist
Title: Re: Pipewire needs turnstile to be enabled as a user service
Post by: calvinh on 10 July 2025, 14:42:46
Turnstile should not be required. That it 'solves' your problem is probably because it sets the XDG env vars for you. There are other ways to do that.

artist

Do you guys have a plan to make pipewire the default sound system in the near future?
Title: Re: Pipewire needs turnstile to be enabled as a user service
Post by: chimay on 10 July 2025, 21:47:59
Turnstile should not be required. That it 'solves' your problem is probably because it sets the XDG env vars for you. There are other ways to do that.

artist

Without it, dinitctl complains that the socket doesn't exist, do you have an idea of what could causes this issue ?

Code: [Select]
dinit-client: connecting to socket /run/user/1000/dinitctl: No such file or directory
Title: Re: Pipewire needs turnstile to be enabled as a user service
Post by: darcy on 10 July 2025, 22:20:51
It means that XDG_RUNTIME_DIR is not set.
turnstiled sets it for you as well as elogind (not sure about seatd - probably not).
Also you can do it manually.
Title: Re: Pipewire needs turnstile to be enabled as a user service
Post by: kixik on 11 July 2025, 01:21:06
Well, no need for turnstiled, neither loginctl for just that.  I don't have any, first on rc.local (given my boxes' settings /etc/local.d/rc.start):

Code: [Select]
# XDG_RUNTIME_DIR for each user
declare -A users=( [<user_0>]=<user_0_default_group> )

for _user in "${users[@]}" ; do
    if [ "$(id -u "$_user")" ] && [ "$(id -g "$_user")" ]; then
        XDG_RUNTIME_DIR="/run/user/$(id -u "$_user")"

        if [ -d "$XDG_RUNTIME_DIR" ]; then
            rm -rf "$XDG_RUNTIME_DIR"
        fi

        mkdir -p "$XDG_RUNTIME_DIR"
        chown ${_user}:${users["$_user"]} "${XDG_RUNTIME_DIR}"
        chmod 700 "$XDG_RUNTIME_DIR"
    fi
done

Where users is an associative list of users with username as key and default group as value.  So on boot all users directories are created.  Now that can move to you ~/.bash_profile or ~/.profile if you prefer.  And then I have in my ~/.bash_profile:

Code: [Select]
if [ -n "$PS1" ]; then
    XDG_RUNTIME_DIR="/run/user/$(id -u)"
    export XDG_RUNTIME_DIR
    ...
fi

So no need for any session helper stuff to get that.  Now my approach of having the directories ready right at boot, which is not necessary, comes from the idea of possible headless jobs running as users and not root, which might potentially depend on XDG_RUN_TIME being up and running.

That said, I no longer use pipewire (I was, as requirement for wayland screen sharing) neither wayland, plain alsa and x11 without dbus now, :)
Title: Re: Pipewire needs turnstile to be enabled as a user service
Post by: chimay on 11 July 2025, 08:49:38
Thanks for sharing , I'm new to Artix so it'll be useful!

That said, I no longer use pipewiere (I was, as requirement for wayland screen sharing) neither wayland, plain alsa and x11 without dbus now, :)

Without dbus ? I read people having their box freezed just for trying to do that. I'm curious,
any link on how to do it ?