
{"id":39106,"date":"2022-04-24T16:30:08","date_gmt":"2022-04-24T16:30:08","guid":{"rendered":"https:\/\/ubuntuhandbook.org\/?p=39106"},"modified":"2024-02-04T01:22:06","modified_gmt":"2024-02-04T01:22:06","slug":"pipewire-replace-pulseaudio-ubuntu-2204","status":"publish","type":"post","link":"https:\/\/ubuntuhandbook.org\/index.php\/2022\/04\/pipewire-replace-pulseaudio-ubuntu-2204\/","title":{"rendered":"How to Use PipeWire to replace PulseAudio in Ubuntu 22.04"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-thumbnail wp-image-35380\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/pipewire-icon-250x250.png\" alt=\"\" width=\"250\" height=\"250\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/pipewire-icon-250x250.png 250w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/pipewire-icon-300x300.png 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/pipewire-icon-600x600.png 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/pipewire-icon-768x768.png 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2021\/05\/pipewire-icon.png 1200w\" sizes=\"auto, (max-width: 250px) 100vw, 250px\" \/><\/p>\n<p>Ubuntu 22.04 has better support for the low latency PipeWire multimedia framework. Here&#8217;s how to setup it for PulseAudio, ALSA, JACK and Bluetooth output.<\/p>\n<p>Firstly, Pipewire is pre-installed out-of-the-box, and runs as background service automatically. You may check it out by running command below in terminal:<\/p>\n<pre>systemctl --user status pipewire pipewire-session-manager<\/pre>\n<div id=\"attachment_39107\" style=\"width: 610px\" class=\"wp-caption alignnone\"><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/pipe-service-jammy.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-39107\" class=\"size-large wp-image-39107\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/pipe-service-jammy-600x434.webp\" alt=\"\" width=\"600\" height=\"434\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/pipe-service-jammy-600x434.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/pipe-service-jammy-300x217.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/pipe-service-jammy-768x556.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/pipe-service-jammy.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-39107\" class=\"wp-caption-text\">PipeWire installed out-of-the-box<\/p><\/div>\n<p><b>IMPORTANT: This is NOT officially supported by Ubuntu so far. It still may not work on some devices. Don&#8217;t do it on production machine!<\/b><\/p>\n<h3>Step 1: install client libraries<\/h3>\n<p>Though available out-of-the-box, it&#8217;s not in use by default for audio output. To get start, first press <b>Ctrl+Alt+T<\/b> on keyboard to open terminal, and run command to install client libraries:<\/p>\n<pre>sudo apt install pipewire-audio-client-libraries libspa-0.2-bluetooth libspa-0.2-jack<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-39108\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-client-libraries-600x276.webp\" alt=\"\" width=\"600\" height=\"276\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-client-libraries-600x276.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-client-libraries-300x138.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-client-libraries-768x354.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-client-libraries.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>Step 2: install wireplumber to replace pipewire-media-session<\/h3>\n<p><b>The project maintainer now recommends more advanced &#8220;<a href=\"https:\/\/pipewire.pages.freedesktop.org\/wireplumber\/\" target=\"_blank\" rel=\"noopener\">wireplumber<\/a>&#8221; session manager when to use Pipewire as system sound server.<\/b><\/p>\n<p>To install the package and remove &#8220;pipewire-media-session&#8221;, run the command below in terminal:<\/p>\n<pre>sudo apt install wireplumber pipewire-media-session-<\/pre>\n<p><i>NOTE: there&#8217;s a &#8216;-&#8216; in the end of the command indicates to remove the package. The command will also install the required pipewire-pulse automatically.<\/i><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-39109\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-wireplumber-600x266.webp\" alt=\"\" width=\"600\" height=\"266\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-wireplumber-600x266.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-wireplumber-300x133.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-wireplumber-768x341.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/apt-wireplumber.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<h3>Step 3: Copy configuration files:<\/h3>\n<p>wireplumber makes things quite easy! If you just want to replace PulseAudio with Pipewire, enable the media session service and restart and that&#8217;s all!!<\/p>\n<p>For ALSA clients to be configured to output via PipeWire, run command to copy the configure file:<\/p>\n<pre>sudo cp \/usr\/share\/doc\/pipewire\/examples\/alsa.conf.d\/99-pipewire-default.conf \/etc\/alsa\/conf.d\/<\/pre>\n<p>For JACK client, run command:<\/p>\n<pre>sudo cp \/usr\/share\/doc\/pipewire\/examples\/ld.so.conf.d\/pipewire-jack-*.conf \/etc\/ld.so.conf.d\/<\/pre>\n<p>And then <code>sudo ldconfig<\/code>.<\/p>\n<p>For Bluetooth, just remove the pulseaudio-module-bluetooth package via command:<\/p>\n<pre>sudo apt remove pulseaudio-module-bluetooth<\/pre>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/move-pipewire-config.webp\" target=\"_blank\" rel=\"noopener\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-39110\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/move-pipewire-config-600x245.webp\" alt=\"\" width=\"600\" height=\"245\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/move-pipewire-config-600x245.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/move-pipewire-config-300x123.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/move-pipewire-config-768x314.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/move-pipewire-config.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>And, finally enable the media session by running command:<\/p>\n<pre>systemctl --user --now enable wireplumber.service<\/pre>\n<h3>Step 4: Verify<\/h3>\n<p><b>After restarted Ubuntu 22.04<\/b>, run the command below in terminal.<\/p>\n<pre>pactl info<\/pre>\n<p>It should output Sound server: PulseAudio (on PipeWire x.x.x) indicates Pipewire is in use as sound output.<\/p>\n<p><a href=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/verify-pipewire.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-large wp-image-39111\" src=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/verify-pipewire-600x309.webp\" alt=\"\" width=\"600\" height=\"309\" srcset=\"https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/verify-pipewire-600x309.webp 600w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/verify-pipewire-300x155.webp 300w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/verify-pipewire-768x396.webp 768w, https:\/\/ubuntuhandbook.org\/wp-content\/uploads\/2022\/04\/verify-pipewire.webp 786w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<h3>How to Restore:<\/h3>\n<p>To undo the changes, firstly remove the client libraries via command:<\/p>\n<pre>sudo apt remove pipewire-audio-client-libraries libspa-0.2-bluetooth libspa-0.2-jack<\/pre>\n<p>Remove wireplumber and install back the previous media session package (there&#8217;s also &#8216;-&#8216; in the end):<\/p>\n<pre>sudo apt install pipewire-media-session wireplumber-<\/pre>\n<p>Finally, re-enable pipewire-media-session service by running commands:<\/p>\n<pre>rm -f ~\/.config\/systemd\/user\/pipewire-session-manager.service<\/pre>\n<pre>systemctl --user --now enable pipewire-media-session<\/pre>\n<p>Thanks to @lestcape, if sound&#8217;s still not working, try to disable pipewire-pulse services via command:<\/p>\n<pre>systemctl --user --now disable pipewire-pulse.service pipewire-pulse.socket<\/pre>\n<p>If you tried to enabled it globally, also disable it via command:<\/p>\n<pre>sudo systemctl --global --now disable pipewire-pulse.service pipewire-pulse.socket<\/pre>\n<p>And re-enable the original pulseaudio service via command:<\/p>\n<pre>systemctl --user --now reenable pulseaudio.service pulseaudio.socket<\/pre>\n<pre>sudo systemctl --global --now reenable pulseaudio.service pulseaudio.socket<\/pre>","protected":false},"excerpt":{"rendered":"<p>Ubuntu 22.04 has better support for the low latency PipeWire multimedia framework. Here&#8217;s how to setup it for PulseAudio, ALSA, JACK and Bluetooth output. Firstly, Pipewire is pre-installed out-of-the-box, and runs as background service automatically. You may check it out by running command below in terminal: systemctl &#8211;user status pipewire pipewire-session-manager IMPORTANT: This is NOT [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":35380,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[2031],"class_list":["post-39106","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","tag-pipewire"],"_links":{"self":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/39106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/comments?post=39106"}],"version-history":[{"count":0,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/posts\/39106\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media\/35380"}],"wp:attachment":[{"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/media?parent=39106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/categories?post=39106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubuntuhandbook.org\/index.php\/wp-json\/wp\/v2\/tags?post=39106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}