Bug 230250

Summary: [GLib] Media session manager unable to handle more than one session
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: PlatformAssignee: Philippe Normand <pnormand>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, benjamin, cdumez, cmarcelo, crzwdjk, eric.carlson, ews-watchlist, glenn, jer.noble, peng.liu6, philipj, sergio, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=231811
https://bugs.webkit.org/show_bug.cgi?id=247527
Attachments:
Description Flags
Patch none

Description Philippe Normand 2021-09-14 04:08:43 PDT
The dbus name it tries to acquire is unique to the app PID. We need some session id there, and the manager should handle more than one dbus object then, I think.
Comment 1 Philippe Normand 2021-09-19 03:21:42 PDT
Created attachment 438586 [details]
Patch
Comment 2 Peng Liu 2021-09-22 09:34:25 PDT
Comment on attachment 438586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438586&action=review

> Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp:50
> +        return { };

Do you mean `return std::nullopt;` here?

> Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp:117
> +        return { };

Ditto.

> Source/WebCore/platform/audio/glib/MediaSessionGLib.h:37
> +    explicit MediaSessionGLib(MediaSessionManagerGLib&, GRefPtr<GDBusConnection>&&, MediaSessionIdentifier);

Do we need explicit here?
Comment 3 Chris Dumez 2021-09-22 09:38:14 PDT
Comment on attachment 438586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438586&action=review

>> Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp:50
>> +        return { };
> 
> Do you mean `return std::nullopt;` here?

Why? What would be the difference?
Comment 4 Peng Liu 2021-09-22 09:49:53 PDT
Comment on attachment 438586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438586&action=review

>>> Source/WebCore/platform/audio/glib/MediaSessionGLib.cpp:50
>>> +        return { };
>> 
>> Do you mean `return std::nullopt;` here?
> 
> Why? What would be the difference?

Just a style thing. I have seen a lot of usages of `std::nullopt`.
Comment 5 Adrian Perez 2021-09-30 13:22:39 PDT
Comment on attachment 438586 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=438586&action=review

>> Source/WebCore/platform/audio/glib/MediaSessionGLib.h:37
>> +    explicit MediaSessionGLib(MediaSessionManagerGLib&, GRefPtr<GDBusConnection>&&, MediaSessionIdentifier);
> 
> Do we need explicit here?

Never hurts :)
Comment 6 EWS 2021-10-02 02:07:19 PDT
Committed r283437 (242424@main): <https://commits.webkit.org/242424@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 438586 [details].
Comment 7 Radar WebKit Bug Importer 2021-10-02 02:08:16 PDT
<rdar://problem/83795322>
Comment 8 Arcady Goldmints-Orlov 2021-10-08 12:20:07 PDT
This appears to have caused a number of regressions, (list filtered to what I think could be related to the change):

Regressions: Unexpected text-only failures

	media/audio-background-playback-playlist.html [ Failure ]
	media/media-session/actionHandlerInternalMappings.html [ Failure ]
	media/media-session/default-actionHandlers.html [ Failure ]
	media/video-background-playback.html [ Failure ]
	media/video-concurrent-playback.html [ Failure ]
	media/video-interruption-with-resume-not-allowing-play.html [ Failure ]
	media/video-multiple-concurrent-playback.html [ Failure ]
	media/webaudio-background-playback.html [ Failure ]
	webrtc/concurrentVideoPlayback2.html [ Failure ]

Regressions: Unexpected timeouts
	media/media-session/callActionHandler.html [ Timeout ]
	media/media-session/play-after-seek.html [ Timeout ]
	media/remote-control-command-is-user-gesture.html [ Timeout ]
	media/remote-control-command-scrubbing.html [ Timeout ]
	media/remote-control-command-seek.html [ Timeout ]
	media/video-inactive-playback.html [ Timeout ]
	media/video-interruption-with-resume-allowing-play.html [ Timeout ]
	media/video-isplayingtoautomotiveheadunit.html [ Timeout ]
	media/video-system-sleep.html [ Timeout ]
	webaudio/audiocontext-state-interrupted.html [ Timeout ]
	webaudio/suspend-context-while-interrupted.html [ Timeout ]
Comment 9 Philippe Normand 2021-10-09 02:07:11 PDT
I can't reproduce this on my desktop...
Comment 10 Arcady Goldmints-Orlov 2021-10-15 09:31:06 PDT
I can't reproduce it locally either but it seems to happen consistently on the bots, e.g. https://build.webkit.org/results/GTK-Linux-64-bit-Release-Skip-Failing-Tests/r284248%20(2041)/results.html