Bug 1184852 - pipewire-media-session.service not enabled/started after updating pipewire-pulse
Summary: pipewire-media-session.service not enabled/started after updating pipewire-pulse
Status: NEW
Alias: None
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem (show other bugs)
Version: Current
Hardware: x86-64 openSUSE Tumbleweed
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Antonio Larrosa
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-04-16 08:33 UTC by Lukas Kucharczyk
Modified: 2021-07-11 17:04 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Lukas Kucharczyk 2021-04-16 08:33:19 UTC
I have installed pipewire-pulse, then I restarted the computer and no sound devices were detected. I checked the status of pipewire-media-session.service:

~ $ systemctl --user status pipewire-media-session.service 
● pipewire-media-session.service - Multimedia Service Session Manager
     Loaded: loaded (/usr/lib/systemd/user/pipewire-media-session.service; disabled; vendor preset: enabled)
     Active: inactive (dead)

Seems like the vendor preset is enabled but that does not enable it even after a restart.

For completeness, after enabling and starting the service manually, the sound works again.
Comment 1 Takashi Iwai 2021-04-16 08:37:20 UTC
We had a similar issue on pulseaudio (bug 1083473), and PA package still contain a workaround.
Maybe still some bits missing in systemd macro?
Comment 2 Antonio Larrosa 2021-04-16 11:27:31 UTC
I think this is probably a case of "package upgraded instead of installed".

The %systemd_user_post macro checks the vendor preset and enables user services only when a package is installed for the first time. Otherwise users that disable a vendor-enabled service would have them enabled again on every package update.

Actually, if a package update introduces a new service it would get enabled correctly. The problem with pipewire was that the service was introduced before the systemd macro in the package so if we want to get it automatically enabled with updates we need to either:

* Add a workaround like the one in pulseaudio that enables the services on every package update
* Add a similar workaround but store some lock file somewhere so it's only enabled once on the first update to a package including the workaround.
* Change the service name (which is, I think, standard across distributions so I don't think we should do that).

Just to check it, Lukas, can you test removing the pipewire package from your system and installing it again to see if the service is enabled automatically in that case or if there's something else wrong?
Comment 3 Lukas Kucharczyk 2021-04-16 15:18:15 UTC
(In reply to Antonio Larrosa from comment #2)
> Just to check it, Lukas, can you test removing the pipewire package from
> your system and installing it again to see if the service is enabled
> automatically in that case or if there's something else wrong?

Removing and installing does enable the service correctly.

A bit unrelated but uninstalling pipewire-pulse also removes all pulseaudio-related packages including plasma5-pa which means no sound setting in Plasma at all until you install it again. Installing pipewire-pulse should probably recommend plasma5-pa at least.
Comment 4 Franck Bui 2021-04-27 11:45:55 UTC
(In reply to Antonio Larrosa from comment #2)
> Actually, if a package update introduces a new service it would get enabled
> correctly. The problem with pipewire was that the service was introduced
> before the systemd macro in the package so if we want to get it
> automatically enabled with updates we need to either:

Hm can't you just rebuild the package since the macro is now supposed to handle the "service introduced via an update" case properly ?
Comment 5 Antonio Larrosa 2021-04-27 16:18:23 UTC
(In reply to Franck Bui from comment #4)
> (In reply to Antonio Larrosa from comment #2)
> > Actually, if a package update introduces a new service it would get enabled
> > correctly. The problem with pipewire was that the service was introduced
> > before the systemd macro in the package so if we want to get it
> > automatically enabled with updates we need to either:
> 
> Hm can't you just rebuild the package since the macro is now supposed to
> handle the "service introduced via an update" case properly ?

The macro now handles the "service introduced via an update" properly (as in "the service doesn't exist in the system and then an update installs it for the first time"), but the service was already introduced before the macro was updated (briefly, but I'm afraid there was a period of time when pipewire-pulse installed the service and didn't have the fixed macros), so now the %systemd_user_pre macro checks for the existence of the service and since it's there, it doesn't mark any work for %systemd_user_post to do.

I'll try to add tomorrow a workaround that forces the service preset to be set and then stores a lock file somewhere (something like /var/lib/systemd_preset_workaround/${service_name} but I'll try to find a better name/place) so the workaround is only executed once.
Comment 6 Franck Bui 2021-04-27 17:29:31 UTC
(In reply to Antonio Larrosa from comment #5)
> but the service was already introduced before the macro
> was updated (briefly, but I'm afraid there was a period of time when
> pipewire-pulse installed the service and didn't have the fixed macros)

For those who updated the package including the new service with the broken macros then I'm afraid there's not much we can do.

But since users were only briefly exposed to that broken case maybe a few of them were affected...

> I'll try to add tomorrow a workaround that forces the service preset to be
> set and then stores a lock file somewhere (something like
> /var/lib/systemd_preset_workaround/${service_name} but I'll try to find a
> better name/place) so the workaround is only executed once.

Well I'm sorry but I won't include such workaround in the systemd rpm macros if that's your idea. We had "fun" time to clean them up from all hacks that were accumulated over the past years and reintroducing a new one sounds the wrong thing to do, especially since it's going to break any setups where users explicitly disabled the service.
Comment 7 Antonio Larrosa 2021-04-28 08:22:39 UTC
(In reply to Franck Bui from comment #6)
> (In reply to Antonio Larrosa from comment #5)
> > but the service was already introduced before the macro
> > was updated (briefly, but I'm afraid there was a period of time when
> > pipewire-pulse installed the service and didn't have the fixed macros)
> 
> For those who updated the package including the new service with the broken
> macros then I'm afraid there's not much we can do.
> 
> But since users were only briefly exposed to that broken case maybe a few of
> them were affected...
> 

I've already seen a few bug reports about that, so I'm afraid they're a bit more than "a few".

> > I'll try to add tomorrow a workaround that forces the service preset to be
> > set and then stores a lock file somewhere (something like
> > /var/lib/systemd_preset_workaround/${service_name} but I'll try to find a
> > better name/place) so the workaround is only executed once.
> 
> Well I'm sorry but I won't include such workaround in the systemd rpm macros
> if that's your idea. We had "fun" time to clean them up from all hacks that
> were accumulated over the past years and reintroducing a new one sounds the
> wrong thing to do, especially since it's going to break any setups where
> users explicitly disabled the service.

Of course, that wasn't my idea. I was thinking on including the workaround in pipewire-pulse and pulseaudio (in fact, pulseaudio already includes a workaround but it enables the service on every update, so executing it only once more would be IMHO an improvement). I was just thinking on doing it in a generic way because it might be useful for other packages in the future too, so they could copy a few lines into their own %post section if needed.
Comment 8 Franck Bui 2021-04-28 08:35:40 UTC
(In reply to Antonio Larrosa from comment #7)
> I've already seen a few bug reports about that, so I'm afraid they're a bit
> more than "a few".

pipewire-pulse (during a short time frame), maybe pulseaudio, what else ?

> Of course, that wasn't my idea. I was thinking on including the workaround
> in pipewire-pulse and pulseaudio 

Ok, I misunderstood you then let me reassign this bug to you ;)

Thanks.
Comment 9 OBSbugzilla Bot 2021-06-01 10:20:05 UTC
This is an autogenerated message for OBS integration:
This bug (1184852) was mentioned in
https://build.opensuse.org/request/show/896634 Factory / pipewire
Comment 11 Swamp Workflow Management 2021-07-06 16:19:05 UTC
SUSE-RU-2021:2260-1: An update that has three recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1183012,1184852,1186561
CVE References: 
JIRA References: 
Sources used:
SUSE Linux Enterprise Module for Desktop Applications 15-SP3 (src):    pipewire-0.3.24-4.3.1

NOTE: This line indicates an update has been released for the listed product(s). At times this might be only a partial fix. If you have questions please reach out to maintenance coordination.
Comment 12 Swamp Workflow Management 2021-07-11 17:04:12 UTC
openSUSE-RU-2021:2260-1: An update that has three recommended fixes can now be installed.

Category: recommended (moderate)
Bug References: 1183012,1184852,1186561
CVE References: 
JIRA References: 
Sources used:
openSUSE Leap 15.3 (src):    pipewire-0.3.24-4.3.1