Code: Select all
emerge -C media-sound/jack-audio-connection-kit
USE="extra jack-sdk pipewire-alsa" emerge media-video/pipewire # extra is not mandatory
emerge acct-group/pipewire acct-user/pipewireNew files
/etc/init.d/pipewire
Code: Select all
#!/sbin/openrc-run
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
PIPEWIRE_RUNTIME_DIR="/tmp/pipewire"
name="pipewire daemon"
description="Share sound and videos"
command=/usr/bin/pipewire
command_args="${pipewire_args}"
command_background=yes
command_user="pipewire:pipewire"
pidfile="${PIPEWIRE_RUNTIME_DIR}/pipewire.pid"
depend() {
use alsasound pulseaudio
}
start_pre() {
# The next 5 lines feels like it should be replaced by:
# checkpath -d -m 2775 -o "${command_user}" "${PIPEWIRE_RUNTIME_DIR}"
# Optionally replace -d with -D to clean out the directory (possible security thoughts)
if [[ ! -e ${PIPEWIRE_RUNTIME_DIR} ]]; then
mkdir ${PIPEWIRE_RUNTIME_DIR}
fi
chmod -R g+ws ${PIPEWIRE_RUNTIME_DIR}
chown -R pipewire:pipewire ${PIPEWIRE_RUNTIME_DIR}
export PIPEWIRE_RUNTIME_DIR
}
start_post() {
einfo "Wait for the pipewire socket to be ready"
sleep 3
find ${PIPEWIRE_RUNTIME_DIR} -type s -exec chmod g+w '{}' ';'
einfo "Socket file: $(find ${PIPEWIRE_RUNTIME_DIR} -type s)"
}/etc/X11/xinit/xinitrc.d/99-pipewire
Code: Select all
#!/bin/bash
if test -z "${XDG_RUNTIME_DIR}"; then
export XDG_RUNTIME_DIR="$(mktemp -d /tmp/$(id -u)-runtime-dir.XXX)"
else
export XDG_RUNTIME_DIR="${XDG_RUNTIME_DIR}"
fi
export PIPEWIRE_RUNTIME_DIR="/tmp/pipewire"Code: Select all
mkdir /etc/pipewire
cp /usr/share/pipewire/pipewire.conf /etc/pipewire/
sed -i '/path.*pipewire-media-session/{s/#//;s/pipewire-media-session/wireplumber/}'Code: Select all
sed -i '/with-logind/s/true/false/' /etc/wireplumber/bluetooth.lua.d/50-bluez-config.lua
sed -i '/alsa.reserve/s/true/false/' /etc/wireplumber/main.lua.d/50-alsa-config.lua
sed -i '/enable-flatpak-portal/s/true/false/' /etc/wireplumber/main.lua.d/50-default-access-config.luaStart pipewire at boot
Code: Select all
rc-update add pipewire defaultCode: Select all
usermod -a -G pipewire user1
usermod -a -G pipewire user2
usermod -a -G pipewire mpdYou may also need to add to your .bashrc
Code: Select all
export PIPEWIRE_RUNTIME_DIR="/tmp/pipewire"MPD
Set output as this in /etc/mpd.conf
Code: Select all
audio_output {
type "pipewire"
name "pipewire-0"
}Code: Select all
export PIPEWIRE_RUNTIME_DIR="/tmp/pipewire"




