Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Riddling over systemctl, pulseaudio, firefox-esr, and salsa.debian.org

5 views
Skip to first unread message

Thomas Schmitt

unread,
Apr 10, 2023, 11:50:07 AM4/10/23
to
Hi,

i experience a strange behavior of my Debian 11 with firefox-esr and
pulseaudio.
After visiting
https://salsa.debian.org/groups/optical-media-team/-/activity
the most busy process on my Debian 11 is the one that was started at boot
(or user login) automatically by
/usr/bin/pulseaudio --daemonize=no --log-target=journal
It uses tenfold more CPU time than the idle firefox-esr (says top(1)).
I cannot tell whether it really tries to make noise, because no
loudspeakers are attached.
Before the visit to salsa.debian.org pulseaudio is not shown by top(1)
among the busiest processes. Afterwards it steadily uses 10 percent of
a 4 GHz Xeon core.
Leaving the web site and even removing the browser tab does not reduce
this activity.

So what is salsa.debian.org doing with firefox-esr to get pulseaudio so
excited ?


Next riddle is how i could keep pulseaudio from being started automatically
for my desktop user. I understand from web and man page of systemctl that
systemctl --user disable pulseaudio.service pulseaudio.socket
should do the trick.
But on next boot and login (even via ssh) there is again a pulseaudio
instance running with my desktop user id.
The superuser can prevent the starting of pulseaudio for my user and for
user "lightdm" by
systemctl --global disable pulseaudio.service pulseaudio.socket

So do i get the man page wrong and systemctl has no means to prevent
services for particular users ?


Have a nice day :)

Thomas

David Wright

unread,
Apr 11, 2023, 11:10:05 AM4/11/23
to
On Mon 10 Apr 2023 at 17:42:04 (+0200), Thomas Schmitt wrote:

> i experience a strange behavior of my Debian 11 with firefox-esr and
> pulseaudio.
> After visiting
> https://salsa.debian.org/groups/optical-media-team/-/activity
> the most busy process on my Debian 11 is the one that was started at boot
> (or user login) automatically by
> /usr/bin/pulseaudio --daemonize=no --log-target=journal
> It uses tenfold more CPU time than the idle firefox-esr (says top(1)).
> I cannot tell whether it really tries to make noise, because no
> loudspeakers are attached.
> Before the visit to salsa.debian.org pulseaudio is not shown by top(1)
> among the busiest processes. Afterwards it steadily uses 10 percent of
> a 4 GHz Xeon core.
> Leaving the web site and even removing the browser tab does not reduce
> this activity.
>
> So what is salsa.debian.org doing with firefox-esr to get pulseaudio so
> excited ?

I don't use pulseaudio (I'm currently browsing the pipewire docs to
see whether it can do anything for me), but googling pulseaudio cpu usage
produces a lot of hits.

> Next riddle is how i could keep pulseaudio from being started automatically
> for my desktop user. I understand from web and man page of systemctl that
> systemctl --user disable pulseaudio.service pulseaudio.socket
> should do the trick.
> But on next boot and login (even via ssh) there is again a pulseaudio
> instance running with my desktop user id.

AFAICT that command touches files under /run, which would explain why
rebooting resets it. I just tried disabling obex.service because this
machine has no wireless. Each time I ran it, the result was:

$ strace -f systemctl --user disable obex.service |& cat > /tmp/sysudiso

As root if you want to check those inaccessible directories:

[ … ]

/run/user/1000/systemd/generator.late:
total 4
-rw-r--r-- 1 454 Apr 11 09:55 app-geoclue\x2ddemo\x2dagent-autostart.service
drwxr-xr-x 2 60 Apr 11 09:55 xdg-desktop-autostart.target.wants/

/run/user/1000/systemd/generator.late/xdg-desktop-autostart.target.wants:
total 0
lrwxrwxrwx 1 49 Apr 11 09:55 app-geoclue\x2ddemo\x2dagent-autostart.service -> ../app-geoclue\x2ddemo\x2dagent-autostart.service

[ … ]

I couldn't make anything out from the trace: it didn't contain the
word geoclue. It's probably all implemented by dbus messages.

> The superuser can prevent the starting of pulseaudio for my user and for
> user "lightdm" by
> systemctl --global disable pulseaudio.service pulseaudio.socket
>
> So do i get the man page wrong and systemctl has no means to prevent
> services for particular users ?

I'm guessing from what Michel Verdier wrote elsewhere that you
have to create a symlink, pointing at /dev/null, somewhere in
~/.config/systemd/user/. Take a look at what the global command
wrote, and copy it from /etc/systemd/user/, before removing the
global one.

Cheers,
David.

Thomas Schmitt

unread,
Apr 12, 2023, 6:40:08 AM4/12/23
to
Hi,

David Wright wrote:
> googling pulseaudio cpu usage produces a lot of hits.

Yes. But why does it stay modest until i go to
https://salsa.debian.org/groups/optical-media-team/-/activity
and why does it stay busy after i left that page ?


I wrote:
> > Next riddle is how i could keep pulseaudio from being started automatically
> > for my desktop user. I understand from web and man page of systemctl that
> > systemctl --user disable pulseaudio.service pulseaudio.socket
> > should do the trick.
> > But on next boot and login (even via ssh) there is again a pulseaudio
> > instance running with my desktop user id.

David Wright wrote:
> I'm guessing from what Michel Verdier wrote elsewhere that you
> have to create a symlink, pointing at /dev/null, somewhere in
> ~/.config/systemd/user/.

I would have expected that systemctl knows how do do it.

Maybe a master in dialectics can decode this statement from
man systemctl:

"Depending on whether --system, --user, --runtime, or --global is
specified, this enables the unit for the system, for the calling
user only, for only this boot of the system, or for all future
logins of all users."

This is with "enable" but later the section for "disable" states.

"This command honors --system, --user, --runtime and --global in a
similar way as enable."

I would conclude from "--runtime [...] for only this boot of the system"
that the others have a lasting effect. But on the other hand, only
"--global" mentions "for all future logins".
So the description seems to give the implementation much room for
interpretation.

Henning Follmann

unread,
Apr 12, 2023, 7:00:06 AM4/12/23
to
On Wed, Apr 12, 2023 at 12:34:55PM +0200, Thomas Schmitt wrote:
> Hi,
>
> David Wright wrote:
> > googling pulseaudio cpu usage produces a lot of hits.
>
> Yes. But why does it stay modest until i go to
> https://salsa.debian.org/groups/optical-media-team/-/activity
> and why does it stay busy after i left that page ?
>
>

I am pretty sure this is just coincidence.
That page does not have any media content so firefox does not try
to play anythink there.

I did the exact thing you descibed, nothing happened, before or after
pening the page.

-H



--
Henning Follmann | hfol...@itcfollmann.com

to...@tuxteam.de

unread,
Apr 12, 2023, 8:20:05 AM4/12/23
to
On Wed, Apr 12, 2023 at 06:49:52AM -0400, Henning Follmann wrote:
> On Wed, Apr 12, 2023 at 12:34:55PM +0200, Thomas Schmitt wrote:
> > Hi,
> >
> > David Wright wrote:
> > > googling pulseaudio cpu usage produces a lot of hits.
> >
> > Yes. But why does it stay modest until i go to
> > https://salsa.debian.org/groups/optical-media-team/-/activity
> > and why does it stay busy after i left that page ?
> >
> >
>
> I am pretty sure this is just coincidence.

Knowing Thomas, I'd venture the guess that the coincidence is
repeatable (on his system, at least).

> I did the exact thing you descibed, nothing happened, before or after
> pening the page.

This is probably a welcome data point (I have no pulseaudio
running, so I can't check myself).

Cheers
--
t
signature.asc

Thomas Schmitt

unread,
Apr 12, 2023, 12:40:06 PM4/12/23
to
Hi,

i wrote:
> > But why does it [pulseaudio] stay modest until i go to
> > https://salsa.debian.org/groups/optical-media-team/-/activity
> > and why does it stay busy after i left that page ?

Henning Follmann wrote:
> I am pretty sure this is just coincidence.

I tried at least three times while watching activity by top(1). The browser
has a dozen tabs. First i visited others, then the tab with above URL. Each
time the activity increase happened exactly when i went to that tab.

But now i repeated the experiments and found that the effect is not so
clearly to reproduce. There seems to be a significant preference for
Gitlab sites to trigger pulseaudio's activity, but i also had system
sessions where i could not reproduce it at all.

Even worse, i had one occasion where
https://www.gnu.org/software/xorriso/
triggered the activity after i had hopped over several other URLS,
including
https://gitlab.gnome.org/GNOME/brasero/-/issues/357
https://salsa.debian.org/groups/optical-media-team/-/activity
Of course i waited the due time after each hop so that changes of activity
would become visible in top.

The cherry on the cake was firefox-esr starting up with the tab that
shows
https://askubuntu.com/questions/1436035/xorriso-image-remaster-unable-to-find-a-medium-containing-a-live-filesystem-ub/1436235#1436235
and immediately triggering the activity of pulseaudio.

At that point i concluded that the only way to permanently control this
madness is
systemctl --global disable pulseaudio.service pulseaudio.socket


to...@tuxteam.de

unread,
Apr 12, 2023, 1:50:07 PM4/12/23
to
On Wed, Apr 12, 2023 at 06:33:49PM +0200, Thomas Schmitt wrote:
> Hi,
>
> i wrote:
> > > But why does it [pulseaudio] stay modest until i go to
> > > https://salsa.debian.org/groups/optical-media-team/-/activity
> > > and why does it stay busy after i left that page ?
>
> Henning Follmann wrote:
> > I am pretty sure this is just coincidence.
>
> I tried at least three times while watching activity by top(1). The browser
> has a dozen tabs. First i visited others, then the tab with above URL. Each
> time the activity increase happened exactly when i went to that tab.
>
> But now i repeated the experiments and found that the effect is not so
> clearly to reproduce. There seems to be a significant preference for
> Gitlab sites to trigger pulseaudio's activity, but i also had system
> sessions where i could not reproduce it at all.

Perhaps the browser is trying to do some kind of notification via
audio?

I have one instance of a browser which shouldn't be able to talk
(since @#%&* firefox insisted on talking only to Pulseaudio, I
have to enable an instance explicitly with apulse, so I know that
one should be mute) but still it manages to make some noises for
"desktop notifications". In a nutshell, audio without audio is
still possible :)

There are some "notification" entries in about:config worth
investigating.

And indeed, the one browser instance (I keep most of them to
separate profiles, this one is dedicated to one of those jarring
corporate chat apps) making the noises does show having received
notification requests from the web site I expected (this is
somewhere in about:preferences#privacy, under "Permissions").

Perhaps it's that.

Good luck
--
tomás
signature.asc

Thomas Schmitt

unread,
Apr 13, 2023, 4:20:06 AM4/13/23
to
Hi,

to...@tuxteam.de wrote:
> Perhaps the browser is trying to do some kind of notification via
> audio?
> There are some "notification" entries in about:config worth
> investigating.

None of them looks to me like being related to audio.
There would be many combinations of on-off. So i did not play with them
but rather went on to notifications and loudspeaker test.


> And indeed, the one browser instance (I keep most of them to
> separate profiles, this one is dedicated to one of those jarring
> corporate chat apps) making the noises does show having received
> notification requests from the web site I expected (this is
> somewhere in about:preferences#privacy, under "Permissions").

There are three web sites listed in "settings - Notification Permissions"
Two are "Allow" one is "Block". None of them was involved in my
experiments. I removed them all.
But the page
https://support.mozilla.org/en-US/kb/push-notifications-firefox?as=u&utm_source=inproduct
(linked by "learn more" in the setings page) says
While Firefox is open, websites which have been granted permission can
send notifications to your browser, which displays them on the screen.
Sound is not mentioned.

I dug out a pair of loudspeakers and attached it to the "Line Out" socket
at the mainboard backplane (lime color, matches color of plug and
description of the mainboard).
Then i hopped around between the browser tabs until pulseaudio showed
activity in top(1) (again on a Gitlab site).
Nothing is to hear.

Google found me a hopefully harmless site to test the speakers
https://www.onlinemictest.com/de/lautsprecher-test/
Clicking on its "<" and ">" buttons indeed plays a beep-bup-boop sound.

When rebooting after this adventure i saw a delay of 1:30 minutes at
"A stop job is running Make remote CUPS printer available locally"
(Copied to paper and toggled into this mail. Possibly not 100% exact.)
This happened only once. Further reboots went swiftly.

Frustrated i disabled pulseaudio globally again und put the speakers back
into their dungeon.

Thomas Schmitt

unread,
Apr 13, 2023, 4:30:05 AM4/13/23
to
Hi,

i wrote:
> So i did not play with them
> but rather went on to notifications and loudspeaker test.

I meant "Notification Permissions" instead of "notifications".

to...@tuxteam.de

unread,
Apr 13, 2023, 4:50:06 AM4/13/23
to
On Thu, Apr 13, 2023 at 10:18:12AM +0200, Thomas Schmitt wrote:
> Hi,
>
> to...@tuxteam.de wrote:
> > Perhaps the browser is trying to do some kind of notification via
> > audio?
> > There are some "notification" entries in about:config worth
> > investigating.
>
> None of them looks to me like being related to audio.

Well, only indirectly: this was what I was trying to illustrate.
The browser tells your DE/X session/whatever "go annoy the user",
and the latter decides to yell at her.

That's why my audio-incapacitated browser instance is able to
make noises anyway.

> There would be many combinations of on-off. So i did not play with them
> but rather went on to notifications and loudspeaker test.

Browsers are exponential hells, yes.

> There are three web sites listed in "settings - Notification Permissions"
> Two are "Allow" one is "Block". None of them was involved in my
> experiments. I removed them all.
> But the page
> https://support.mozilla.org/en-US/kb/push-notifications-firefox?as=u&utm_source=inproduct
> (linked by "learn more" in the setings page) says
> While Firefox is open, websites which have been granted permission can
> send notifications to your browser, which displays them on the screen.
> Sound is not mentioned.

This may or may not be the source. I was talking about "desktop
notifications", which the browser might/would trigger. Of course,
I may be totally wrong.

> I dug out a pair of loudspeakers and attached it to the "Line Out" socket
> at the mainboard backplane (lime color, matches color of plug and
> description of the mainboard).
> Then i hopped around between the browser tabs until pulseaudio showed
> activity in top(1) (again on a Gitlab site).
> Nothing is to hear.
>
> Google found me a hopefully harmless site to test the speakers
> https://www.onlinemictest.com/de/lautsprecher-test/
> Clicking on its "<" and ">" buttons indeed plays a beep-bup-boop sound.
>
> When rebooting after this adventure i saw a delay of 1:30 minutes at
> "A stop job is running Make remote CUPS printer available locally"
> (Copied to paper and toggled into this mail. Possibly not 100% exact.)
> This happened only once. Further reboots went swiftly.
>
> Frustrated i disabled pulseaudio globally again und put the speakers back
> into their dungeon.

If you don't need it, this seems like the wise thing to do. And
if you want to give your browser sound, there's thankfully apulse,
which fakes a Pulseaudio interface via LD_PRELOAD tricks.

Cheers
--
t
signature.asc
0 new messages