Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Pipewire issue: sound randomly not working
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 34
Location: Columbus, OH

PostPosted: Sat Aug 24, 2024 8:48 pm    Post subject: Pipewire issue: sound randomly not working Reply with quote

About a month ago, after an update, pipewire started not working after a random amount of time. That is, it works after I log in, but at some point it stops working. At that point, video and audio files do not play - they just stay at 00:00 and do nothing. This is basically the same in browsers (youtube, netflix) and local files played with mpv. (Though, it doesn't ever happen while something is playing.)

Running gentoo-pipewire-launcher restart fixes the issue, but it reoccurs randomly later. I'm not sure if it some other program causing it to die or pipewire itself. Logs don't have anything from pipewire. When it is working, it works fine. Sometimes it goes a day or more, other times it can stop working in an hour.

System is fully up to date. I'm on Fluxbox, and start gentoo-pipewire-launcher from a bash script that I run right after login. I had it in .fluxbox/startup, but it didn't work. Fluxbox is started from SDDM.

Pipewire was working fine in this set up until about a month ago. The only major change was that I installed the full KDE Plasma suite and used it for a week or two. IIRC, it was when I rebooted and moved back to Fluxbox that this issue started.

[I] media-video/pipewire
Installed versions: 1.0.7-r1 (0/0.4)^t (07:46:55 AM 07/05/2024)
(X dbus echo-cancel extra ffmpeg readline sound-server ssl v4l -bluetooth -doc -flatpak -gsettings -gstreamer -ieee1394 -jack-client -jack-sdk -liblc3 -lv2 -man -modemmanager -pipewire-alsa -roc -selinux -system-service -systemd -test -zeroconf ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="32 64 -x32")

[I] media-sound/pulseaudio
Installed versions: 16.1 (11:11:54 PM 06/01/2024)
(glib -bluetooth -daemon -jack -ofono-headset ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="32 64 -x32")

Thanks for any help or suggestions.
_________________
I am not a number, I am a free man.
---- The Prisoner
Back to top
View user's profile Send private message
JarzaClay
n00b
n00b


Joined: 21 Aug 2024
Posts: 23

PostPosted: Thu Aug 29, 2024 4:01 pm    Post subject: Reply with quote

I suspect something in killing the pipewire instance, try to start pipewire manually in a terminal, and read the log when it breaks.
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 473
Location: Naarm/Melbourne, Australia

PostPosted: Fri Aug 30, 2024 12:00 am    Post subject: Re: Pipewire issue: sound randomly not working Reply with quote

osugi_sakae wrote:
Logs don't have anything from pipewire.

Could you clarify which logs you're referring to here? Do you mean the logs created by setting up logging as described in the gentoo-pipewire-launcher(1) man page?
Quote:
${XDG_CONFIG_HOME}/gentoo-pipewire-launcher.conf (or, if ${XDG_CONFIG_HOME} is not set, ${HOME}/.config/gentoo-pipewire-launcher.conf) can be used to specify absolute paths of files to which log output should be sent, by specifying values for one or more of the GENTOO_PIPEWIRE_LOG, GENTOO_PIPEWIRE_PULSE_LOG, and GENTOO_WIREPLUMBER_LOG variables, one per line.
Back to top
View user's profile Send private message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 34
Location: Columbus, OH

PostPosted: Fri Aug 30, 2024 9:10 pm    Post subject: Reply with quote

Well, didn't have any logging set up, so that was part of it. Set up all three of the logs and restarted pipewire. (I originally assumed messages would go to syslog or somewhere similar in /var/log/, so was looking there.)

So far, the GENTOO_PIPEWIRE_LOG and the GENTOO_PIPEWIRE_PULSE_LOG just have starting messages like "Starting Pipewire" or "Starting Pipewire-Pulse".

The GENTOO_WIREPLUMBER_LOG has entries about bluetooth, but I compiled without the bluetooth flag, and don't use bluetooth, so not worried about those.

It also has an entry "PipeWire's libcamera SPA plugin is missing or broken", which might explain why motion started having frame resolution issues with my webcam recently. I don't use the camera very often, so that probably isn't related to the sound issue.

A few updates:

* I noticed that wireplumber was last emerged a few days before pipewire. Re-emerged, but not sure yet if that made a difference.

* Pipewire's instance is not actually dying. It is still running (has 2 pids, as expected), just doesn't work.
_________________
I am not a number, I am a free man.
---- The Prisoner
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 473
Location: Naarm/Melbourne, Australia

PostPosted: Sat Aug 31, 2024 1:59 am    Post subject: Reply with quote

osugi_sakae wrote:
Pipewire's instance is not actually dying. It is still running (has 2 pids, as expected), just doesn't work.

Is there still a WirePlumber instance running as well, though? There needs to be; it's the thing that manages audio within the user session. If there's no WirePlumber instance, that might explain the issue; try running `wireplumber` from the command line.

As an aside:

osugi_sakae wrote:
I originally assumed messages would go to syslog or somewhere similar in /var/log/, so was looking there.

Fair. However, what `gentoo-pipewire-launcher` does is set up PipeWire-based audio within a specific user-session, rather than something system-wide. So i feel that logging to syslog isn't appropriate here, and i say this as the person who added the logging code to `gentoo-pipewire-launcher` (which was reviewed by a Gentoo dev before being committed).

There are two underlying issues here:

* PipeWire is oriented towards systemd-based systems. From the pipewire(1) man page:

Quote:
Logging options
JOURNAL_STREAM
Is used to parse the stream used for the journal. This is usually configured by systemd.

PIPEWIRE_LOG_LINE
Enables the logging of line numbers. Default true.

PIPEWIRE_LOG
Specifies a log file to use instead of the default logger.

PIPEWIRE_LOG_SYSTEMD
Enables the use of systemd for the logger, default true.

Those of us on non-systemd-based-systems have to find a way of handling logging which doesn't involve the systemd journal.

* systemd has 'user services' implemented; OpenRC doesn't yet (although this is being slowly worked on, and is a more complex problem than one might assume). `gentoo-pipewire-launcher` is basically a workaround.

(Eventually i'd prefer to move from OpenRC to s6 - i've used s6+66 before, when i was using Void - and set up user services via s6. i've been slowly working on this, but as it's not critical for my use-case, i've not been prioritising it.)
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3446
Location: Canada

PostPosted: Sat Aug 31, 2024 6:01 am    Post subject: Reply with quote

I don't think video is an issue here. Things like youtube just stop playing when sound disconnects.
Install and run media-sound/qpwgraph

It gives visual representation of where pipewire puts your sound
Back to top
View user's profile Send private message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 34
Location: Columbus, OH

PostPosted: Sat Aug 31, 2024 8:36 pm    Post subject: Reply with quote

Thanks. I was not familiar with qpwgraph. Four screenshots are at https://od.lk/fl/NjJfOTE0NTIxOV8.

Sound was not working - the first two show like 50 volume controls, one with nothing using sound; the other when I ran mpv (but still no sound).

The other two show what happened after I re-ran gentoo-pipewire-restart - again with nothing running and then with mpv running (this time sound works).

Aside from the large number of controls, I'm not sure if anything in these screenshots indicates the problem.

Thanks.
_________________
I am not a number, I am a free man.
---- The Prisoner
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 473
Location: Naarm/Melbourne, Australia

PostPosted: Sun Sep 01, 2024 1:05 am    Post subject: Reply with quote

In my previous comment, i asked:
flexibeast wrote:
osugi_sakae wrote:
Pipewire's instance is not actually dying. It is still running (has 2 pids, as expected), just doesn't work.

Is there still a WirePlumber instance running as well, though? There needs to be; it's the thing that manages audio within the user session. If there's no WirePlumber instance, that might explain the issue; try running `wireplumber` from the command line.

You've now run `gentoo-pipewire-launcher restart`, but that doesn't show us whether the necessary WirePlumber instance is crashing (including immediately crashing upon being started). Please check if an instance of WirePlumber is running via `pgrep -a wireplumber`, which should return a PID and a command line if WirePlumber is indeed running.
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3446
Location: Canada

PostPosted: Sun Sep 01, 2024 2:04 am    Post subject: Reply with quote

osugi_sakae wrote:
Thanks. I was not familiar with qpwgraph. Four screenshots are at https://od.lk/fl/NjJfOTE0NTIxOV8.

Sound was not working - the first two show like 50 volume controls, one with nothing using sound; the other when I ran mpv (but still no sound).

The other two show what happened after I re-ran gentoo-pipewire-restart - again with nothing running and then with mpv running (this time sound works).

Aside from the large number of controls, I'm not sure if anything in these screenshots indicates the problem.

Thanks.


Nottice that with qwpgraph you not only can see connections, but you can manipulate them, I.e grab a line and connect some source to some sink as you wish


So linking at your picture. Somehow indeed, every time one open pulseausio volume control and new instance is created. I don't know if it is a bug with pipewire or a feature.
You third case looks normal, mpv is playing, its output is connected to playback of HD audio, should be sound. Are you sure your speakers are not muted somehow ? Hardware button on laptop ?
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3477

PostPosted: Sun Sep 01, 2024 9:07 am    Post subject: Reply with quote

Quote:
So linking at your picture. Somehow indeed, every time one open pulseausio volume control and new instance is created. I don't know if it is a bug with pipewire or a feature.
Doesn't happen on my system (without pulseaudio).
Pipewire can already adjust volume for each input and output independently by itself, it doesn't need external filters for that, so it could be an issue with pulseaudio volume control.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 34
Location: Columbus, OH

PostPosted: Sun Sep 01, 2024 10:39 am    Post subject: Reply with quote

dmpogo wrote:
You third case looks normal, mpv is playing, its output is connected to playback of HD audio, should be sound. Are you sure your speakers are not muted somehow ? Hardware button on laptop ?


They are external speakers on a desktop computer; I change the volume through pavucontrol only. The only change is my running `gentoo-pipewire-launcher.sh --restart`.

To be clear, the third pic (2024-08-31-restarted-mpv-running.png) **does** give me sound.
_________________
I am not a number, I am a free man.
---- The Prisoner
Back to top
View user's profile Send private message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 34
Location: Columbus, OH

PostPosted: Sun Sep 01, 2024 10:49 am    Post subject: Reply with quote

flexibeast wrote:
You've now run `gentoo-pipewire-launcher restart`, but that doesn't show us whether the necessary WirePlumber instance is crashing (including immediately crashing upon being started). Please check if an instance of WirePlumber is running via `pgrep -a wireplumber`, which should return a PID and a command line if WirePlumber is indeed running.


Code:
$ pgrep -a pipewire
1350 /usr/bin/pipewire
1352 /usr/bin/pipewire -c pipewire-pulse.conf
$ pgrep -a wireplum
1342 /usr/bin/wireplumber


Seems to be running okay. When I checked this, the sound was NOT working.
_________________
I am not a number, I am a free man.
---- The Prisoner
Back to top
View user's profile Send private message
osugi_sakae
n00b
n00b


Joined: 24 Oct 2002
Posts: 34
Location: Columbus, OH

PostPosted: Sun Sep 01, 2024 10:57 am    Post subject: Reply with quote

[quote="szatox"]
Quote:
Pipewire can already adjust volume for each input and output independently by itself, it doesn't need external filters for that, so it could be an issue with pulseaudio volume control.


Interestingly, I opened qpwgraph (when I noticed sound was not working) to check if there were like 50 controls again. pavucontrol immediately gave a message about being unable to connect to pulseaudio. (pic at https://od.lk/f/NjJfNzU2MjMzMjRf). (There were about 20 or so controls, btw.)

I have these installed:

[I] media-sound/pavucontrol
Available versions: 5.0-r3 {X nls}
Installed versions: 5.0-r3(03:45:11 AM 06/02/2024)(X nls)
Homepage: https://freedesktop.org/software/pulseaudio/pavucontrol/
Description: Pulseaudio Volume Control, GTK based mixer for Pulseaudio

[I] media-sound/pavucontrol-qt
Available versions: 1.3.0-r1 ~1.4.0 ~2.0.0
Installed versions: 1.3.0-r1(01:39:46 AM 06/02/2024)
Homepage: https://lxqt-project.org/
Description: Qt GUI Pulseaudio Mixer

I'm happy to try removing pulseaudio - I mostly kept it because I use pavucontrol to manage volume. What would be a similar gui pipewire / wireplumber replacement?

Note that this combo was working fine for months - it only stopped working recently, after an update. Maybe a change or a bug has them no longer playing nice together.
_________________
I am not a number, I am a free man.
---- The Prisoner
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3477

PostPosted: Sun Sep 01, 2024 12:36 pm    Post subject: Reply with quote

Quote:
I'm happy to try removing pulseaudio - I mostly kept it because I use pavucontrol to manage volume. What would be a similar gui pipewire / wireplumber replacement?

I went in a different direction, I don't really mix audio form various sources save for notifications, so I don't have to match inputs' volumes. Instead, I plugged compressor before output (with easyeffects), which ensures that playback device will generate sound in an acceptable range regardless of how badly butchered the input stream was.
At this point alsamixer is all I need, usually via [Fn]+[Vol] buttons, and I only have to change volume by a few % for comfort.

Pipewire also remembers volume settings for different output devices, so plugging/unplugging headphones automagically sets playback volume to the level used previously with this device. Very handy.
I don't know gui tools for setting volume in pipewire, but it has some matching logic inside, so chances are you can just set input volumes once and then never touch it again, rendering your volume control GUI obsolete anyway. Perhaps wpctl status and wpctl set-volume would be good enough to set things up once even though it's a command line tool.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3446
Location: Canada

PostPosted: Sun Sep 01, 2024 6:24 pm    Post subject: Reply with quote

szatox wrote:
Quote:
So linking at your picture. Somehow indeed, every time one open pulseausio volume control and new instance is created. I don't know if it is a bug with pipewire or a feature.
Doesn't happen on my system (without pulseaudio).
Pipewire can already adjust volume for each input and output independently by itself, it doesn't need external filters for that, so it could be an issue with pulseaudio volume control.


One my system it was happening when I click on kde volume control ( kmix ) Each click created new instance for pipewire. I tried it again, and it seems not happening, once control window is closed, the object disappears .
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum