Pipewire to manage audio in antiX 21

Forum Forums General Software Pipewire to manage audio in antiX 21

  • This topic has 6 replies, 5 voices, and was last updated Jun 24-1:05 pm by Jing-Jo.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #59060
    Member
    Xecure

    I have been experimenting a bit with pipewire, and I can say it is the perfect replacement for pulseaudio. I have no experience with JACK, so I will only explain how it works managing my audio on my system.

    PipeWire is a server and user space API to deal with multimedia pipelines. It will be very important for Wayland server (streaming audio/video between applications and screen sharing), but it is still very useful for us xorg users.

    Currently in antiX-bullseye-a2 (testing, future antiX 21), it is good enough to manage input/output audio for all my devices on my laptop. I have it set up mainly to replace pulseaudio (not installed on my system). It doesn’t require systemd and, though a service could be created for it, it is NOT needed. I have it installed with a bluetooth module, and I am able to stream audio to my bluetooth headphones (a bit jumpy, but good enough for me), use pavucontrol to manage the volume and switch between audio input/output, play audio in firefox (without apulse!!) and all this using less CPU % compared to pulseaudio (still uses more than just pure ALSA, but negligible in my experience). It also has a good audio level compared to when I am using pulseaudio and similar to pure ALSA (but this may depend on the device, and may only be my experience).

    Official Debian Instructions here: https://wiki.debian.org/PipeWire

    Summary of what I have done on my system:

    1. Install pipewire with audio client libraries (optional, for replacing pulseaudio, jack and handling alsa requests) and bluetooth modules (optional, for bluetooth audio streaming).
    sudo apt install pipewire pipewire-audio-client-libraries libspa-0.2-bluetooth
    1.2 (Optional) I installed pavucontrol (without pulseaudio) to manage volume control and device switching. I prefer this to alsamixer and Sound Card Chooser. For what I use it, it is good enough.

    2. I add pipewire to the startup commands so it launches with the system. I edit ~/.desktop-session/startup and add it close to the beginning:

    # Startup pipewire to manage my audio
    pipewire &

    3.(Optional) Prepare it to replace pulseaudio. I follow the Debian wiki instructions and create a file for pipewire:
    sudo touch /etc/pipewire/media-session.d/with-pulseaudio
    and also add another startup command to ~/.desktop-session/startup

    # Replace pulseaudio functionality with pipewire
    pipewire-pulse &

    4. (Optional) Also pipe all programs that would use alsa to use pipewire instead (makes it consistent with pulseaudio volume and lets me control all system audio with pavucontrol interface and same audio commands). I follow the Debian instructions and create the files:

    sudo touch /etc/pipewire/media-session.d/with-alsa
    sudo cp /usr/share/doc/pipewire/examples/alsa.conf.d/99-pipewire-default.conf /etc/alsa/conf.d/

    5. (Optional) Let pipewire manage JACK. I have followed the Debian wiki instructions but I have never used JACK for anything before. I discovered qjackctl recently in a forum post and just wanted to see what it was. Maybe I will use this in the future, so I set it up anyway.

    sudo touch /etc/pipewire/media-session.d/with-jack
    sudo cp /usr/share/doc/pipewire/examples/ld.so.conf.d/pipewire-jack-*.conf /etc/ld.so.conf.d/
    sudo ldconfig

    Here is a screenshot of qjackctl of how the audio is set up right now on my system (using bluetooth headset that includes microphone to listen to youtube on firefox, with pavucontrol open to manage volume and input/output devices):
    qjackctl-graph

    PROBLEMS:
    Not everything is sunshine. There are shadows (at least for me).
    A. Volumeicon is useless after setting all this up. The volume slider barely moves sometimes (it seems blocked by something), and others slightly moving it increases the volume to almost 100% (almost making me deaf). I have disabled it from startup, but I could use it for launching pavucontrol by changing the mixer command.
    B. Default hotkeys/key-bindings for increasing/decreasing audio (using amixer command) doesn’t work properly. Sometimes it just blocks the audio in one channel and others volume goes too loud or too low, or gets stuck in mute. I have replaced them to use pulseaudio commands instead:

    pactl set-sink-volume @DEFAULT_SINK@ -5%
    pactl set-sink-volume @DEFAULT_SINK@ +5%

    C. It doesn’t remember volume levels at all from one session to the next (not a real problem compared to normal ALSA behavior, but it is worse compared to normal pulseaudio).
    D. Related to B. Alsamixer doesn’t seem to match volume values with pulseaudio. They seem to work in different scales and show 0 when the other shows >0%, and jumps of 10% in one may be a 30% volume jump in the other.
    E. Though long use of Bluetooth headphones has improved (no sudden disconnects after 5 minutes without audio output), I get more stuttering and distortions (sometimes), but it could be related to my bluetooth card or headset (always had some problems, so I am OK with current experience).

    So, this is my experience so far. Have you tested this out yourself? What was your experience?

    antiX Live system enthusiast.
    General Live Boot Parameters for antiX.

    #59068
    Member
    skidoo
    Helpful
    Up
    0

    no firsthand experience, I’ve occasionally clicked reddit topics to read “from-the-trenches” reports by users:

    debian subreddit
    https://old.reddit.com/r/debian/search/?q=pipewire&sort=new&restrict_sr=on

    linux subbreddit
    https://old.reddit.com/r/linux/search/?q=pipewire&sort=new&restrict_sr=on

    HackerNews search, sorted by date:
    https://hn.algolia.com/?dateRange=all&page=0&prefix=false&query=pipewire&sort=byDate&type=story

    ___________________________________

    pipewire debian package bugtracker: https://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=pipewire;dist=unstable

    pipewire project bugtracker: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues

    #59085
    Member
    Xecure
    Helpful
    Up
    0

    Hopefully we can get more people to test this on their machines (with HDMI output and even older machines), and may be able to recommend using pipewire instead of apulse (or set it as the default on a respin).
    The big problem with pipewire is that it gets outdated pretty quickly. It seems the developers release a new version every 15 days, so on a stable environment it might get old (we all know how Debian prioritizes stability above everything else). I hope that before bullseye gets released they can squeeze in a newer version from experimental. Worse case scenario is building my own .deb from experimental if needed, as I have done for connman.

    Anyway, I am interested in seeing how it goes for other antiX users.

    • This reply was modified 4 months, 2 weeks ago by Xecure.

    antiX Live system enthusiast.
    General Live Boot Parameters for antiX.

    #62187
    Member
    calciumsodium
    Helpful
    Up
    0

    Hi @Xecure,

    I was able to test pipewire using antiX-bullseye-b1-sysvinit on an HP Compaq 6200 microtower using a displayport-to-hdmi connection to our family TV.

    Before this test, I was able to get great sound using pulseaudio and pavucontrol. Pavucontrol was used to initially set the configuration for the HDMI/displayport output. This will be used for comparison with pipewire.

    I repeated all 5 steps that you listed that you did in setting up pipewire. I was able to successfully install pipewire, and I was able to get good video and sound through the displayport-to-hdmi connection.

    How is the sound quality of pulseaudio vs pipewire?

    There is a slight variation/difference in sound quality between the two systems. I have to say that the sound quality with pulseaudio is better than with pipewire.

    I wanted to get a second opinion about this, so I did the following test. I played the same youtube video to my wife and asked her which sounded better. I told her I was trying out two different sound systems, didn’t tell her which was which, and asked her to pick which sound system produced a better sound and why. She also picked the pulseaudio sound system. In her evaluation, at low sound volume, both sounded the same. But when the volume was turned up, the sound from pulseaudio was more crisp. Whereas, with pipewire, the sound was more muffled and less crisp at high volumes.

    So, these are the opinions of two people.
    I wanted to report this test.
    Thanks.

    #62192
    Moderator
    ModdIt
    Helpful
    Up
    0

    xcecure wrote: The big problem with pipewire is that it gets outdated pretty quickly.

    See that as not the important point, sound quality is audibly degraded against pulse/apulse
    on same system, well tried and tested Gigabyte board i5, Intel HD Audio to Teufel active stereo.

    Using pulse/ apulse has never given me much bother (years of usage) so will stay with it.

    #62243
    Member
    Xecure
    Helpful
    Up
    0

    So, these are the opinions of two people.
    I wanted to report this test.

    Thanks, calciumsodium. This is what I wanted to hear. Real life experience. For now, pulseaudio still seems to have better quality, even if it uses a bit more resources and lags a bit.
    For bluetooth headphones the quality of sound is better with pipewire, but probably for speakers it will still need to improve a lot.
    Thanks for testing. Maybe in antiX 23 we can recommend people to install pipewire instead of pulseaudio when experiencing audio problems that cannot be solved with ALSA.

    Using pulse/ apulse has never given me much bother (years of usage) so will stay with it.

    I am not suggesting for everyone to replace it, but asking for other people’s experience.

    ALSA is still the best option (but to get best results, depending on your device, you will need to configure it further, which is not that easy). Pulseaudio brings a lot of latency (for professionals, JACK is the better option). pipewire aims to replace all of them (thou still speaking to the ALSA server, as that is what talks directly with kernel and hardware), being able to interface as pulseaudio with a similar latency to JACK.
    You can read a bit about each of them here and why they exist: https://www.reddit.com/r/linux/comments/coi4dt/a_complete_guide_of_and_debunking_of_audio_on/

    antiX Live system enthusiast.
    General Live Boot Parameters for antiX.

    #62246
    Member
    Jing-Jo
    Helpful
    Up
    0

    I would like to thank everyone participating on this topic.
    It’s going to be extremely useful to me in the near future.
    Thanks

Viewing 7 posts - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.