r/voidlinux • u/ajshell1 • Feb 21 '21
solved How I got Pipewire working on Void as a Pulse Audio replacement.
I'm planning on doing a reinstall of Void Linux soon, so I'm going to use this as documentation. This is because sound configuration on Linux is my nemesis. I can eventually get it working, but I can never remember how I did it.
Sources:
https://wiki.archlinux.org/index.php/Pipewire
https://gist.github.com/st3r4g/6c681a28b0403b3b02636f510ff68039
https://www.reddit.com/r/voidlinux/comments/k4obom/how_to_setup_pipewire/
https://www.reddit.com/r/voidlinux/comments/kdqvky/pipewire_autostart_trick/
https://www.reddit.com/r/voidlinux/comments/k6ivr7/pulseaudio_alternatives_on_void/
https://www.reddit.com/r/linux/comments/ln02y6/how_to_switch_to_pipewire_while_using_sway/
Install pipewire:
xbps-install pipewire alsa-pipewire (libpulseaudio-pipewire is NOT needed. In fact, it appears to have been removed from the repos.)
Uncomment the following line in /etc/pipewire/pipewire.conf:
#"/usr/bin/pipewire" = { args = "-c pipewire-pulse.conf" }
Run these commands:
mkdir -p /etc/alsa/conf.d
ln -s /usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.d
ln -s /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.dEdit /etc/pulse/client.conf and replace the following line:
; autospawn = yes
With:
autospawn = no
Finally, set Pipewire to start when you start a user session/log in. Since I'm using sway, I did this by adding the following line to ~/.config/sway/config:
exec pipewire
Reboot.
I'll try my best to keep this guide up to date. I'm sure I did a few things wrong here.
Note: It may be possible to remove the pulseaudio package after doing this. I'll have to test. Removing libpulseaudio is completely out of the question though: dependencies of libpulseaudio include chromium, mpv, vlc, qemu, SDL, and chromium.
EDIT 2: Run "pactl info" after rebooting. If Pipewire is working, it should return something like "Server Name: PulseAudio (on PipeWire 0.3.21)"
EDIT 1: I've removed the "pulseaudio" package, and that hasn't broken my sound. Yet. So, assuming you don't have any packages that depend on it, you can remove it. For now.
EDIT 3: I've tested running more than one sound-producing program at once (I think a limitation of just ALSA by itself is that it only can play one sound-producing program at once), and that works. However, I'll need to edit my Sway config, since I use pactl to adjust my volume with hotkeys. This can be fixed by reinstalling the pulseaudio package, but I want to try and find a way around that.
EDIT 4: It should be noted that I don't use bluetooth with this machine. Keep that in mind when I say I have no problems.
EDIT 5: I no longer recommend removing the pulseaudio package, because I couldn't find a way to adjust volume from hotkeys without pactl.
EDIT 6: I stand corrected. pamixer works fine.. Thanks /u/crdpa!
Edit 7: --no-startup-id does nothing in Sway. So I removed it.
5
u/BigThiccBoi27 Feb 22 '21
I literally just installed pipewire, uninstalled pulseaudio, uncommented the line in the config file, and made sure it autostart through sway. Everything else just worked. Also,
--no-startup-iddoes nothing and isn't needed in sway.4
u/st3r4g Feb 24 '21
since the config has to be modified to start pipewire-pulse, be careful to refresh the config on pipewire updates (they are still heavily changing the format) otherwise it might not start correctly. This is also explained in the install message
1
u/[deleted] Feb 22 '21
Can I do a timeshift, try this and go back if it doesn't work, right?
1
u/agbail Jul 22 '21 edited Jul 22 '21
This was working for me, but for some reason after the latest update, it no longer works.
When I try and start pipewire, I get the following errors:
[W][00041.853082][ module-rtkit.c: 200 translate_error()] RTKit error: org.freedesktop.DBus.Error.Failed
[W][00041.853112][ module-rtkit.c: 460 set_nice()] could not set nice-level to -11: I/O error
[W][00041.874612][ module-rtkit.c: 200 translate_error()] RTKit error: org.freedesktop.DBus.Error.Failed
[W][00041.874638][ module-rtkit.c: 633 impl_acquire_rt()] could not make thread realtime: I/O error
[W][00041.879781][ module-rtkit.c: 200 translate_error()] RTKit error: org.freedesktop.DBus.Error.Failed
[W][00041.879797][ module-rtkit.c: 460 set_nice()] could not set nice-level to -11: I/O error
[W][00041.884801][ module-rtkit.c: 200 translate_error()] RTKit error: org.freedesktop.DBus.Error.Failed
[W][00041.884814][ module-rtkit.c: 633 impl_acquire_rt()] could not make thread realtime: I/O error
and nothing happens.
3
u/Potatoalienof13 Feb 21 '21
Omg nice. I was gonna do this but wasn't looking forward to getting it working, thank you so much.
2
u/SunkenStone Feb 24 '21
Followed these steps and it worked perfectly. Thank you so much!
1
u/upofadown Feb 22 '21
This might be good to put up at the unofficial Wiki:
1
u/DNiceM Feb 21 '21
Ty for this. I've been considering similar, and this will be very useful!
1
u/[deleted] May 15 '21
i keep getting error even after uninstalling pulseaudio, pactl list would display Failure: Connection refused $ pactl listbash: pactl: command not found $ pactl infobash: pactl: command not found $ pamixerAllowed options: -h [ --help ] help message --sink arg choose a different sink than the default --source arg choose a different source than the default --default-source select the default source --get-volume get the current volume --get-volume-human get the current volume percentage or the string "muted" --set-volume arg set the volume -i [ --increase ] arg increase the volume -d [ --decrease ] arg decrease the volume -t [ --toggle-mute ] switch between mute and unmute -m [ --mute ] set mute --allow-boost allow volume to go above 100% --gamma arg (=1) increase/decrease using gamma correction e.g. 2.2 -u [ --unmute ] unset mute --get-mute display true if the volume is mute, false otherwise --list-sinks list the sinks --list-sources list the sources $ pamixer --list-sinksConnection error $ pamixer --list-sinksConnection error $ (reddit sucks and wont even copy and paste shit properly sorry about the shitty formatting that i cant really do anything about)
1
u/yashank09 Jun 24 '21
Hate to ask but, any luck with Bluetooth? Struggling since 2 days now - can pair but not connect to any Bluetooth device.
1
u/red38dit Aug 10 '22
I had to NOT do the following step to get the sound cards to show up in pavucontrol:
mkdir -p /etc/alsa/conf.dln -s /usr/share/alsa/alsa.conf.d/50-pipewire.conf /etc/alsa/conf.dln -s /usr/share/alsa/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d0
u/[deleted] Feb 21 '21
[deleted] — view deleted comment
0
u/[deleted] Mar 02 '21
[deleted] — view deleted comment
3
u/[deleted] Feb 22 '21 edited Aug 01 '21
[removed] — view removed comment