Live data from Hacker News

PipeWire 0.3.62

gitlab.freedesktop.org

81–90 of 98 posts

Re: PipeWire 0.3.62

#81

Knowledgeable people, please explain. Wouldn't it be better if applications used ALSA for audio output? In this case they could work without Pulseaudio and with (because Pulseaudio adds a sink to ALSA). This way the application doesn't need to know which audio daemon it uses. What are the downsides of this approach?

People like to use the pulseaudio API because it has features people want, compares to ALSA or JACK: See here:

https://gitlab.freedesktop.org/pipewire/pipewire/-/wikis/FAQ...

Re: PipeWire 0.3.62

#82
post #57

Only slightly OT; does anyone have a solution for playing audio from ssh? The best I have so far is to pick a program that I know is under X (here xterm) and run something like: eval "env $(cat /proc/"$(pgrep -n xterm)"/environ |xargs -0 -n1 printf '%q ') bash" To get the environment setup right.

Man, how much are distros + bad user config hurting user "Linux" reports. Thank god for NixOS where (1) we do a decent job of base config and (2) user config errors are basically trivially identifiable. 1. Open `pulsemixer` to monitor pulse clients 2. `ssh localhost "pacat Observe that pacat is showing as a pulse client. This stuff is really easy and should absolutely just work.

I'm running nixos (22.05), and I can't run alsa clients to the pipewire alsa device on the remote machine over ssh without setting the "correct" environment variables (I have yet to identify them, so I use what I posted to clone the environment of an X program).

Re: PipeWire 0.3.62

#83
post #66
post #63

Earlier quoted context omitted.

You are misunderstanding; I want to play audio on the remote machine, not on the local machine. The remote machine is running pipewire-pulse.

Yes sorry, I figured it out before seeing your comment and edited my reply. PULSE_SERVER=localhost or export $(dbus-launch) could work.

Aha, I found more details, and also think I've solved it:

1. I misremembered it was an alsa-client that couldn't use the pipewire virtual device.

2. your mention of dbus did help though; setting DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus seems to do the trick.

Re: PipeWire 0.3.62

#84
post #14

I use PipeWire on my desktop and laptop, and its doing a better job than pulse ever did. That said, I've had daily issues with it, from it slowing video playback (weirdly, by about 10 seconds over 20 minutes or so, only noticable when watching something synchronized with someone else), over crackling noises with speakers when no audio is playing, to straight up lags and skips every few seconds with certain devices. A…

> That said, I've had daily issues with it, from it slowing video playback (weirdly, by about 10 seconds over 20 minutes or so, only noticable when watching something synchronized with someone else), over crackling noises with speakers when no audio is playing, to straight up lags and skips every few seconds with certain devices. How is that "better than pulse ever did"? The only issue I had with PulseAudio on severa…

> How is that "better than pulse ever did"? The only issue I had with PulseAudio on several machines in last decade or so

It's "better than Pulse ever did" because they do not have the same hardware as you, and because whatever they had before was worse.

Lesson 2 about discussing technical issues on the internet: other posters almost certainly do not have the same hardware as you.

(this is also relevant when it comes to discussing software performance - the fact that Slack loads in 5 seconds on your desktop does not make it "fast", because the entire internet does not have your desktop)

Re: PipeWire 0.3.62

#85
post #14

I use PipeWire on my desktop and laptop, and its doing a better job than pulse ever did. That said, I've had daily issues with it, from it slowing video playback (weirdly, by about 10 seconds over 20 minutes or so, only noticable when watching something synchronized with someone else), over crackling noises with speakers when no audio is playing, to straight up lags and skips every few seconds with certain devices. A…

Not to defend Pulse too hard but I use Linux every day and am specifically interested in audio and outside low latency work (where I use jack), Pulse has rarely been a problem since many many years. What exactly are the issues people experience?

I regularly hit a couple.

This one breaks audio and video in virtual machines:

https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/46...

The effects of this one vary:

https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_...

For me it breaks audio in Chrome and VLC:

https://github.com/wwmm/easyeffects/issues/1789

Re: PipeWire 0.3.62

#86

Earlier quoted context omitted.

Because ALSA doesn't allow two programs to use the same audio card simultaneously. ALSA is good for exclusive access, when you want to remove everything between an application and audio card. Also ALSA cannot do other nice things, like switching audio output when you plug an USB audio card.

It can and does as it was configured by most distributions.

The dmix plugin does, not ALSA.

Re: PipeWire 0.3.62

#87
post #14

I use PipeWire on my desktop and laptop, and its doing a better job than pulse ever did. That said, I've had daily issues with it, from it slowing video playback (weirdly, by about 10 seconds over 20 minutes or so, only noticable when watching something synchronized with someone else), over crackling noises with speakers when no audio is playing, to straight up lags and skips every few seconds with certain devices. A…

>> Audio on linux is a complete joke

Yes, for example, the zoom app is now one of the most widely relied on apps for connecting people over networks. To get its audio output to fairly represent the input (e.g. for musical content), the input client is supposed to use the 'original audio' setting. That setting is not yet available on the linux version of zoom. On the output end, the audio is a mess, sounding as if somewhere along the way a handshake has turned into a fistfight.

Audio is complicated. Another example: an ordinary amateur, part-time, casual guitarist might nowadays play with thousands of dollars of pedals and processors plugged into his signal path. He gets this to work by plugging and unplugging those devices and their cables in various configurations until everything sounds best. Try providing that level of flexibility in software with reasonable default settings for all of the myriad of applications and environments in which one might try to apply computer audio.

Re: PipeWire 0.3.62

#88
post #22
post #14

I use PipeWire on my desktop and laptop, and its doing a better job than pulse ever did. That said, I've had daily issues with it, from it slowing video playback (weirdly, by about 10 seconds over 20 minutes or so, only noticable when watching something synchronized with someone else), over crackling noises with speakers when no audio is playing, to straight up lags and skips every few seconds with certain devices. A…

Video playback timing is actually pretty difficult, with only trade-offs, no "right" solution. The easiest solution is to use your computer's accurate clock to time the frames. This means, if your video is at 30 FPS, you will have gone through exactly 3000 frames after 100 seconds. But your monitor might not be refreshing at exactly 60 FPS, it might be targetting the 59.94 standard, or it might be targetting 60 FPS b…

Usually playback will be locked to a hardware clock, typically the audio clock. This does mean that the audio clock and frame clock will drift over time, as they're not locked to each other; it doesn't matter how accurate the clocks are, they will drift. This is one source of dropped/doubled frames. It's possible to sync to the video framerate instead, of course, though audio desync artifacts tend to be more noticeable and objectionable than video ones. You can handle this by dynamically measuring the clock drift and variably resampling the audio, but this is relatively complicated and computationally expensive. Generally this type of drift isn't too noticeable, these clocks are usually well within 100ppm, which would result in 1 frame slip every few minutes.

The issue with framerate mismatch is a fundamentally different one, in that it's not a synchronization problem. It's the result of a non-integral ratio between display frames and playback frames, and exists regardless of clock source. So it's the harder of the two to deal with, and is worse in magnitude too at several slipped frames per minute with e.g. 29.976fps vs. 30fps. In the classical approach, this simply results in frames getting doubled or skipped, since it's not tracking the video rate at all, it just asks for the display to be updated at its frame-time, and the display system will either get a chance to show it or not. The slightly more refined approach is to play back at the closest integral ratio (e.g. play 29.976fps video at 30fps on a 60fps display), and resample the audio to match this new rate, but again this is computationally expensive and complicated.

mpv team has a good writeup: https://github.com/mpv-player/mpv/wiki/Display-synchronizati...

Re: PipeWire 0.3.62

#89

Earlier quoted context omitted.

Not to defend Pulse too hard but I use Linux every day and am specifically interested in audio and outside low latency work (where I use jack), Pulse has rarely been a problem since many many years. What exactly are the issues people experience?

I regularly hit a couple. This one breaks audio and video in virtual machines: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/46... The effects of this one vary: https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_... For me it breaks audio in Chrome and VLC: https://github.com/wwmm/easyeffects/issues/1789

I guess I wasn't very clear.

It was issues with Pulse I wanted to know more about. Low latency is obviously not it's forté, otherwise it just works, for me that is.

Re: PipeWire 0.3.62

#90

Earlier quoted context omitted.

I regularly hit a couple. This one breaks audio and video in virtual machines: https://gitlab.freedesktop.org/pipewire/pipewire/-/issues/46... The effects of this one vary: https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_... For me it breaks audio in Chrome and VLC: https://github.com/wwmm/easyeffects/issues/1789

I guess I wasn't very clear. It was issues with Pulse I wanted to know more about. Low latency is obviously not it's forté, otherwise it just works, for me that is.

You were pretty clear. I just completely misread. :)
Post reply on HN