Artix Linux Forum

Artix Linux => Applications & Software => Topic started by: xqtha2276 on 01 November 2021, 01:03:47

Title: Making pipewire run at startup
Post by: xqtha2276 on 01 November 2021, 01:03:47
Alright, I've put off getting this settled long enough. After digging, a few months ago, I figured out how to get pipewire to function properly. However, it's tedious. Upon every login, I have to run "pipewire" "pipewire-pulse" "pipewire-media-session" and "sudo modprobe snd-hda-intel" in separate terminal tabs and just leave the pipewire commands running.

How can I just make this just werk on startup? I've tried various scripts to no avail.
Title: Re: Making pipewire run at startup
Post by: ndowens on 01 November 2021, 03:23:08
I have plasma starting mine in settings, some possibly add it to their .zshrc or .bashrc but ofc if you add it to your shell settings, you'd need to do something like pipewire && pipewire-pulse && pipewire-media-session && or so..
Title: Re: Making pipewire run at startup
Post by: VictorBrand on 01 November 2021, 03:50:52
The script you need is pretty simple:
Code: [Select]
pipewire &
pipewire-pulse &
pipewire-media-session &
I've just added these lines to my openbox starting script, but you can make a separate script and start it via xdg-init, xinitrc or whatever.

Moreover, some Artix init systems provide you with an option of making user services, namely s6 (https://forum.artixlinux.org/index.php/topic,3067.0.html) and runit (https://docs.voidlinux.org/config/services/user-services.html), you can use this feature to start pipewire.
Title: Re: Making pipewire run at startup
Post by: xqtha2276 on 01 November 2021, 06:48:16
So that script worked fine, gets pipewire up and running no problem. However, I can't get a script to work with "sudo modprobe snd-hda-intel", likely because of something to do with root permissions. I can add the command separately as a startup application in Plasma settings, but then I have to enter my password in a terminal after every login. I'm sure there's a way to get root commands to run on login without user input, I'm just a total noob with scripts.
I use s6, so yeah there's gotta be something handy there.
Title: Re: Making pipewire run at startup
Post by: strajder on 01 November 2021, 07:03:23
So that script worked fine, gets pipewire up and running no problem. However, I can't get a script to work with "sudo modprobe snd-hda-intel", likely because of something to do with root permissions.

You don't have to resort to calling sudo.

https://wiki.archlinux.org/title/Kernel_module

Add a .conf file like
Code: [Select]
snd-hda-intel
to /etc/modules-load.d and the corresponding module should be loaded on startup.

By the way, https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio
Title: Re: Making pipewire run at startup
Post by: xqtha2276 on 01 November 2021, 09:30:17
You don't have to resort to calling sudo.

https://wiki.archlinux.org/title/Kernel_module

Add a .conf file like
Code: [Select]
snd-hda-intel
to /etc/modules-load.d and the corresponding module should be loaded on startup.

By the way, https://wiki.artixlinux.org/Site/PipewireInsteadPulseaudio
I've tried
Code: [Select]
sudo nano /etc/modules-load.d/intel.conf
and putting
Code: [Select]
snd-hda-intel
in the conf file. I've tried renaming intel.conf to just .conf. Didn't work either way. Am I missing something? It should be noted that I didn't have to manually modprobe snd-hda-intel until around mid summer, before pipewire. Maybe something obscure is still too broken to allow snd-hda-intel to be loaded on startup.
Title: Re: Making pipewire run at startup
Post by: strajder on 01 November 2021, 12:05:16
I've tried
Code: [Select]
sudo nano /etc/modules-load.d/intel.conf
and putting
Code: [Select]
snd-hda-intel
in the conf file. I've tried renaming intel.conf to just .conf. Didn't work either way.
You should just end the name of your file with .conf, not name it .conf.

What init system are you using? Have you migrated from another system?