linux_rocksmith icon indicating copy to clipboard operation
linux_rocksmith copied to clipboard

Multi-user Pipewire Setup Guide && couple of improvements

Open otuva opened this issue 10 months ago • 2 comments

Hi, I was able to get rs running on linux multi-user setup after many trials and errors thanks to your repo and wanted to contribute. In case anyone wants to do the same or in a similar situation

By multi-user setup I mean a main user and an app user (for steam or any app for that matter)

Why you might ask. Well all of my applications are sandboxed via flatpak but in case of rocksmith, flatpak adds too much complexity with runtimes and sandbox and shit. But I don't want steam or rando game devs or anything proprietary to access my things. And this setup allows that. using fedora but this is distro-agnostic

we start off by creating user

sudo useradd -m steam
sudo passwd steam
sudo usermod -aG steam $USER

we add our user to the steam group so we can access directories and files from our current user

optionally we can change uid for this user so it doesn't show up on gnome login screen

sudo usermod -u 888 steam

if it doesn't work try to set user as systemaccount

/var/lib/AccountsService/users/steam

[User]
Session=
Icon=/home/steam/.face
SystemAccount=true

we can switch to steam user

su - steam

my exports were

export STEAMLIBRARY="$HOME/.steam/steam"
export PROTON="$STEAMLIBRARY/steamapps/common/Proton 9.0 (Beta)/files"

after this, use a guide from README

but instead of adding the current user I add steam user to the groups

sudo usermod -aG audio steam
sudo usermod -aG realtime steam

we can fix any permission issues for the main user by

sudo chmod -R g+wrx /home/steam
sudo chown -R steam:steam /home/steam

now before running steam

we have to authorize sandbox user on main user x display (you really should be running wayland on your system to avoid sandbox user to access all application windows)

xhost +SI:localuser:steam

using below jack.conf (copied from /usr/share/pipewire/jack.conf) for all users. I found that forcing or setting quantum fixes the audio crackling in the game (stems from jack)

cp /usr/share/pipewire/jack.conf ~/.config/pipewire/

~/.config/pipewire/jack.conf

...
# global properties for all jack clients
jack.properties = {
     node.latency = 128/48000
     node.rate = 1/48000
     node.quantum = 128/48000
...

for the main user using below pipewire.conf (copied from /usr/share/pipewire/pipewire.conf). we are creating a socket which the sandbox user will connect to, so we can have audio.

cp /usr/share/pipewire/pipewire.conf ~/.config/pipewire/

~/.config/pipewire/pipewire.conf

...
    # The native communication protocol.
    { name = libpipewire-module-protocol-native
        args = {
            # List of server Unix sockets, and optionally permissions
            #sockets = [ { name = "pipewire-0" }, { name = "pipewire-0-manager" } ]
            sockets = [ { name = "pipewire-0" }, { name = "pipewire-0-manager" }, { name = "/tmp/pipewire-shared", group = "steam", mode = "0770" } ] 
        }
    }
...

after that we can use below exports to have display and audio

export DISPLAY=:0.0
export PIPEWIRE_REMOTE=/tmp/pipewire-shared

start pavucontrol from main user

and finally

steam &

or add alias to run with nvidia

alias steam='__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia steam &'

to add script as nonsteam game, you might need to login from gdm, because of file portals.


my RS_ASIO.ini (using realtone cable mode with M-Audio M-Track Solo)

[Asio.Output]
Driver=wineasio-rsasio
BaseChannel=0
AltBaseChannel=
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.0]
Driver=
Channel=0
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.1]
Driver=wineasio-rsasio
Channel=1
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

[Asio.Input.Mic]
Driver=
Channel=1
EnableSoftwareEndpointVolumeControl=1
EnableSoftwareMasterVolumeControl=1
SoftwareMasterVolumePercent=100
EnableRefCountHack=

otuva avatar Mar 07 '25 17:03 otuva

Wow, thank you for your work.

Hmm, this could be listed as a seperate guide to be used in combination with the main guides.

I'm only bothered a bit by this:

we can fix any permission issues for the main user by

Is there a specific list of files you have to fix, or do you think it's different from system to system?

theNizo avatar Mar 09 '25 09:03 theNizo

Nothing specific, It's just to make sure owner is correct if you copy some cdlcs or files from your main user to the game folder. and giving 'steam' group full access to files in case you need to modify configuration files such as rs_asio ini

by 'any permission issues' I meant in case they arise, not that they will arise definitely

otuva avatar Mar 09 '25 11:03 otuva