[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multiple pulseaudio process after re-loging
From: |
Pierre Neidhardt |
Subject: |
Re: Multiple pulseaudio process after re-loging |
Date: |
Sun, 20 May 2018 15:43:54 +0200 |
User-agent: |
mu4e 1.0; emacs 26.1 |
OK, I've nailed it!
I was mistaken about the "3 pulseaudio processes" I mentioned before,
those actually were
├─pulseaudio(500,499,ambrevar)─┬─{alsa-sink-ALC25}(509,499)
│ └─{alsa-source-ALC}(510,499)
But htop did not display them that explicitly. So nothing odd there.
Following Chris suggestion, I used `pstree -ugh` which revealed that the
additional processes were started by my `conky` config. I have no clue
why this only happens on the first relogging.
Here is the conky config excerpt that I use to query the state/volume:
--8<---------------cut here---------------start------------->8---
${if_match "${exec pactl list sinks | awk '/^\tMute:/ {print $2;exit}'}" ==
"no"}\
^fg(grey)♪^fg(DeepSkyBlue)\
${exec pactl list sinks | awk '/^\tVolume:/ {print $5;exit}'}\
${endif}\
--8<---------------cut here---------------end--------------->8---
The `pactl` calls triggers pulseaudio. There is obviously a race
condition when I relog too fast. Probably a Pulseaudio bug, don't know.
I tried to to add a check whether pulseaudio is running or not:
--8<---------------cut here---------------start------------->8---
${if_match "${exec if pgrep pulseaudio; then pactl list sinks | awk '/^\tMute:/
{print $2;exit}'; fi}" == "no"}\
^fg(grey)♪^fg(DeepSkyBlue)\
${exec if pgrep pulseaudio; then pactl list sinks | awk '/^\tVolume:/ {print
$5;exit}'; fi}\
${endif}\
--8<---------------cut here---------------end--------------->8---
It does not seem to work.
Anyways, it's brittle to parse pactl and using conky makes it even
worse.
Would you know any alternative to pactl and/or conky?
i3status does not seem to cut it either.
--
Pierre Neidhardt
signature.asc
Description: PGP signature