[opensuse-factory] [openSUSE:Leap:15.2, Build 617.1] pulseaudio and systemd vs. setup-pulseaudio
Hi there, this is on build ID 617.1. I use the script setup-pulseaudio sometimes to disable pulseaudio for a user session. This used to work without any trouble (on Leap 15.1 at least), but today I still found two processes running when logged in: "/usr/bin/pulseaudio --daemonize" and "/usr/lib/pulse/gconf-helper". And indeed, running "pavucontrol" doesn't hang/stop as it normally does when PA is disabled. As a consequence, Kodi refuses to switch to a non-PA audio setup, hence playing back some more enhanced video files and using audio passthrough is not possible. I don't want to discuss the issue with audio passthrough etc., but my main concern is "why does systemd always start up a pulseaudio daemon when logging in" - even when PA is disabled. To be honest, I don't know if this is a recent issue or if it existed in earlier builds, too, but I just realised it due to another issue with the 5.6 kernel not being able to do audio via HDMI anymore... Does anybody have an idea? Bugzilla? TIA, cheers. l8er manfred
01.04.2020 19:27, Manfred Hollstein пишет:
Hi there,
this is on build ID 617.1. I use the script setup-pulseaudio sometimes to disable pulseaudio for a user session. This used to work without any trouble (on Leap 15.1 at least), but today I still found two processes running when logged in: "/usr/bin/pulseaudio --daemonize" and "/usr/lib/pulse/gconf-helper". And indeed, running "pavucontrol" doesn't hang/stop as it normally does when PA is disabled.
pavucontrol socket activates PA ... %post /sbin/ldconfig %tmpfiles_create pulseaudio.conf %{fillup_only -an sound} if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then echo "Switching PulseAudio activation using systemd user socket." echo "Please log out from all sessions once to make it effective." fi %systemd_user_post pulseaudio.socket if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then # below should work once when preset is defined properly: # /usr/bin/systemctl --no-reload --global preset pulseaudio.socket mkdir -p /etc/systemd/user/sockets.target.wants ln -s %{_userunitdir}/%{name}.socket /etc/systemd/user/sockets.target.wants/%{name}.socket fi And if preset will ever support global user activation, it will be impossible to disable it. systemd does not offer any possibility to disable units enabled globally (in /usr/lib/systemd).
As a consequence, Kodi refuses to switch to a non-PA audio setup, hence playing back some more enhanced video files and using audio passthrough is not possible.
I don't want to discuss the issue with audio passthrough etc., but my main concern is "why does systemd always start up a pulseaudio daemon when logging in" - even when PA is disabled.
To be honest, I don't know if this is a recent issue or if it existed in earlier builds, too, but I just realised it due to another issue with the 5.6 kernel not being able to do audio via HDMI anymore...
Does anybody have an idea? Bugzilla?
TIA, cheers.
l8er manfred
On Wed, 01 Apr 2020 19:22:41 +0200, Andrei Borzenkov wrote:
01.04.2020 19:27, Manfred Hollstein пишет:
Hi there,
this is on build ID 617.1. I use the script setup-pulseaudio sometimes to disable pulseaudio for a user session. This used to work without any trouble (on Leap 15.1 at least), but today I still found two processes running when logged in: "/usr/bin/pulseaudio --daemonize" and "/usr/lib/pulse/gconf-helper". And indeed, running "pavucontrol" doesn't hang/stop as it normally does when PA is disabled.
pavucontrol socket activates PA ...
%post /sbin/ldconfig %tmpfiles_create pulseaudio.conf %{fillup_only -an sound} if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then echo "Switching PulseAudio activation using systemd user socket." echo "Please log out from all sessions once to make it effective." fi %systemd_user_post pulseaudio.socket if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then # below should work once when preset is defined properly: # /usr/bin/systemctl --no-reload --global preset pulseaudio.socket mkdir -p /etc/systemd/user/sockets.target.wants ln -s %{_userunitdir}/%{name}.socket /etc/systemd/user/sockets.target.wants/%{name}.socket fi
And if preset will ever support global user activation, it will be impossible to disable it. systemd does not offer any possibility to disable units enabled globally (in /usr/lib/systemd).
Yeah, actually it's a fallout at transition to the user socket from the old autospawn invocation. It's a bit ugly but changing /usr/lib/systemd/user/pulseaudio.service like below should honor /etc/sysconfig/sound setup. OTOH, you should be able to disable the systemd user setup easily, too, so I'm hesitated for taking that... Takashi
01.04.2020 20:45, Takashi Iwai пишет:
On Wed, 01 Apr 2020 19:22:41 +0200, Andrei Borzenkov wrote:
01.04.2020 19:27, Manfred Hollstein пишет:
Hi there,
this is on build ID 617.1. I use the script setup-pulseaudio sometimes to disable pulseaudio for a user session. This used to work without any trouble (on Leap 15.1 at least), but today I still found two processes running when logged in: "/usr/bin/pulseaudio --daemonize" and "/usr/lib/pulse/gconf-helper". And indeed, running "pavucontrol" doesn't hang/stop as it normally does when PA is disabled.
pavucontrol socket activates PA ...
%post /sbin/ldconfig %tmpfiles_create pulseaudio.conf %{fillup_only -an sound} if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then echo "Switching PulseAudio activation using systemd user socket." echo "Please log out from all sessions once to make it effective." fi %systemd_user_post pulseaudio.socket if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then # below should work once when preset is defined properly: # /usr/bin/systemctl --no-reload --global preset pulseaudio.socket mkdir -p /etc/systemd/user/sockets.target.wants ln -s %{_userunitdir}/%{name}.socket /etc/systemd/user/sockets.target.wants/%{name}.socket fi
And if preset will ever support global user activation, it will be impossible to disable it. systemd does not offer any possibility to disable units enabled globally (in /usr/lib/systemd).
Yeah, actually it's a fallout at transition to the user socket from the old autospawn invocation.
It's a bit ugly but changing /usr/lib/systemd/user/pulseaudio.service like below should honor /etc/sysconfig/sound setup. OTOH, you should be able to disable the systemd user setup easily, too, so I'm hesitated for taking that...
The obvious question - why enabling/disabling socket is not done by setup-pulseaudio? If someone wants to disable PA, it I expect it also means stop activating it by socket, right? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Hi there, On Wed, 01 Apr 2020, 19:51:48 +0200, Andrei Borzenkov wrote:
01.04.2020 20:45, Takashi Iwai пишет:
On Wed, 01 Apr 2020 19:22:41 +0200, Andrei Borzenkov wrote:
01.04.2020 19:27, Manfred Hollstein пишет:
Hi there,
this is on build ID 617.1. I use the script setup-pulseaudio sometimes to disable pulseaudio for a user session. This used to work without any trouble (on Leap 15.1 at least), but today I still found two processes running when logged in: "/usr/bin/pulseaudio --daemonize" and "/usr/lib/pulse/gconf-helper". And indeed, running "pavucontrol" doesn't hang/stop as it normally does when PA is disabled.
pavucontrol socket activates PA ...
%post /sbin/ldconfig %tmpfiles_create pulseaudio.conf %{fillup_only -an sound} if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then echo "Switching PulseAudio activation using systemd user socket." echo "Please log out from all sessions once to make it effective." fi %systemd_user_post pulseaudio.socket if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then # below should work once when preset is defined properly: # /usr/bin/systemctl --no-reload --global preset pulseaudio.socket mkdir -p /etc/systemd/user/sockets.target.wants ln -s %{_userunitdir}/%{name}.socket /etc/systemd/user/sockets.target.wants/%{name}.socket fi
And if preset will ever support global user activation, it will be impossible to disable it. systemd does not offer any possibility to disable units enabled globally (in /usr/lib/systemd).
Yeah, actually it's a fallout at transition to the user socket from the old autospawn invocation.
It's a bit ugly but changing /usr/lib/systemd/user/pulseaudio.service like below should honor /etc/sysconfig/sound setup. OTOH, you should be able to disable the systemd user setup easily, too, so I'm hesitated for taking that...
The obvious question - why enabling/disabling socket is not done by setup-pulseaudio? If someone wants to disable PA, it I expect it also means stop activating it by socket, right?
yes, that's what I have in mind, too. But anyway, thanks for the good hints to make it work again! Cheers. l8er manfred
On Mittwoch, 1. April 2020 19:45:06 CEST Takashi Iwai wrote:
On Wed, 01 Apr 2020 19:22:41 +0200,
Andrei Borzenkov wrote:
01.04.2020 19:27, Manfred Hollstein пишет:
Hi there,
this is on build ID 617.1. I use the script setup-pulseaudio sometimes to disable pulseaudio for a user session. This used to work without any trouble (on Leap 15.1 at least), but today I still found two processes running when logged in: "/usr/bin/pulseaudio --daemonize" and "/usr/lib/pulse/gconf-helper". And indeed, running "pavucontrol" doesn't hang/stop as it normally does when PA is disabled.
pavucontrol socket activates PA ...
%post /sbin/ldconfig %tmpfiles_create pulseaudio.conf %{fillup_only -an sound} if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then
echo "Switching PulseAudio activation using systemd user socket." echo "Please log out from all sessions once to make it effective."
fi %systemd_user_post pulseaudio.socket if [ ! -f /etc/systemd/user/sockets.target.wants/%{name}.socket ]; then
# below should work once when preset is defined properly: # /usr/bin/systemctl --no-reload --global preset pulseaudio.socket mkdir -p /etc/systemd/user/sockets.target.wants ln -s %{_userunitdir}/%{name}.socket
/etc/systemd/user/sockets.target.wants/%{name}.socket fi
And if preset will ever support global user activation, it will be impossible to disable it. systemd does not offer any possibility to disable units enabled globally (in /usr/lib/systemd).
Yeah, actually it's a fallout at transition to the user socket from the old autospawn invocation.
It's a bit ugly but changing /usr/lib/systemd/user/pulseaudio.service like below should honor /etc/sysconfig/sound setup. OTOH, you should be able to disable the systemd user setup easily, too, so I'm hesitated for taking that...
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service should be sufficient to disable it completely. Though the preferrable solution would be to fix up any issues with passtrough and pulseaudio, as in general that is supported, and would fix it for everyone else. Kind regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is ln -s /dev/null /etc/systemd/system/pulseaudio.service This is important for systemd-delta(1). -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 01 Apr 2020 21:10:35 +0200, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
It's very close to the goal, but the working version is: ln -s /dev/null /etc/systemd/user/pulseaudio.service I'll update setup-pulseaudio script with that. Manfred, care to open a bugzilla entry? thanks, Takashi -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
01.04.2020 22:28, Takashi Iwai пишет:
On Wed, 01 Apr 2020 21:10:35 +0200, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
It's very close to the goal, but the working version is:
ln -s /dev/null /etc/systemd/user/pulseaudio.service
I'll update setup-pulseaudio script with that.
Come on, really. If you want to go this route (which is wrong) - spare /etc link and install your socket link in /usr/lib/systemd/user. Because /etc is not for packager to mess with - it is for end user. But the right thing is to enable or disable it in setup-pulseaudio, just like it has been working before.
Manfred, care to open a bugzilla entry?
thanks,
Takashi
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 01 Apr 2020 22:36:52 +0200, Andrei Borzenkov wrote:
01.04.2020 22:28, Takashi Iwai пишет:
On Wed, 01 Apr 2020 21:10:35 +0200, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
It's very close to the goal, but the working version is:
ln -s /dev/null /etc/systemd/user/pulseaudio.service
I'll update setup-pulseaudio script with that.
Come on, really. If you want to go this route (which is wrong) - spare /etc link and install your socket link in /usr/lib/systemd/user. Because /etc is not for packager to mess with - it is for end user.
But the right thing is to enable or disable it in setup-pulseaudio, just like it has been working before.
That's the plan I mentioned... Takashi -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Good morning everybody, On Wed, 01 Apr 2020, 21:28:23 +0200, Takashi Iwai wrote:
On Wed, 01 Apr 2020 21:10:35 +0200, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
It's very close to the goal, but the working version is:
ln -s /dev/null /etc/systemd/user/pulseaudio.service
I'll update setup-pulseaudio script with that.
great, thanks!
Manfred, care to open a bugzilla entry?
<https://bugzilla.opensuse.org/show_bug.cgi?id=1168393>
thanks,
Takashi
Cheers. l8er manfred
On Apr 01 2020, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
The *official* way is systemctl mask pulseaudio.serivce. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Donnerstag, 2. April 2020 10:54:31 CEST Andreas Schwab wrote:
On Apr 01 2020, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
The *official* way is systemctl mask pulseaudio.serivce.
Andreas.
man systemctl: mask UNIT... Mask one or more units, as specified on the command line. This will link these unit files to /dev/null, making it impossible to start them. ... Kind regards, Stefan -- Stefan Brüns / Bergstraße 21 / 52062 Aachen home: +49 241 53809034 mobile: +49 151 50412019
02.04.2020 11:54, Andreas Schwab пишет:
On Apr 01 2020, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
The *official* way is systemctl mask pulseaudio.serivce.
"mask" is not intended as normal way to disable unit. "mask" is really last resort - if you need to use "mask", you likely have more general design issue. "mask" is really for units that cannot be enabled/diabled and are always active, and is more a debugging tool to troubleshoot or temporary work around a problem. It makes no sense to first unconditionally "enable" unit and then to conditionally "mask" it. Do not "enable" it in the first place, it is as simple as that. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Thu, 02 Apr 2020 12:08:53 +0200, Andrei Borzenkov wrote:
02.04.2020 11:54, Andreas Schwab пишет:
On Apr 01 2020, Jan Engelhardt wrote:
On Wednesday 2020-04-01 21:01, Stefan Brüns wrote:
[ -e /etc/systemd/system/pulseaudio.service ] && echo "already exists" || touch /etc/systemd/system/pulseaudio.service
The official way to mask the service is
ln -s /dev/null /etc/systemd/system/pulseaudio.service
The *official* way is systemctl mask pulseaudio.serivce.
"mask" is not intended as normal way to disable unit. "mask" is really last resort - if you need to use "mask", you likely have more general design issue. "mask" is really for units that cannot be enabled/diabled and are always active, and is more a debugging tool to troubleshoot or temporary work around a problem.
It makes no sense to first unconditionally "enable" unit and then to conditionally "mask" it. Do not "enable" it in the first place, it is as simple as that.
Well, but for a user socket, mask (with --global option) would be the straightforward way, no? Takashi -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (6)
-
Andreas Schwab
-
Andrei Borzenkov
-
Jan Engelhardt
-
Manfred Hollstein
-
Stefan Brüns
-
Takashi Iwai