[DONOTMERGE] pipewire: Check for an audio session before initializing #5346
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The is the preliminary, experimental code to detect whether or not Pipewire is managing the audio session during initialization. This is very WIP, should not be merged, and currently only works with Peter Hutterer's experimental Wireplumber branch at https://gitlab.freedesktop.org/whot/wireplumber/-/tree/wip/session-initialized-property
Strictly for testing only.
The following upstream issues track the progress of session status reporting:
For now, it looks for the 'session.initialized' property and checks if it is set to a non-zero value or contains the string 'audio' somewhere in it. If the property is present and everything is initialized, the backend initialization succeeds. If it is present but uninitialized, a timed wait is used to wait for initialization to complete. If initialization is not complete within the specified period (currently 3 seconds), the backend initialization fails. If the 'session.initialized' property is not found at all, the backend initialization fails. The session check is, however, completely bypassed if the Pipewire backend is explicitly forced on via the SDL_AUDIODRIVER envvar.
Fixes #5304, part of #5268
@flibitijibibo