Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DONOTMERGE] pipewire: Check for an audio session before initializing #5346

Closed

Conversation

Kontrabant
Copy link
Contributor

@Kontrabant Kontrabant commented Feb 14, 2022

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

@flibitijibibo flibitijibibo marked this pull request as draft February 14, 2022 17:25
@flibitijibibo
Copy link
Collaborator

This pretty much all makes sense - next step is to see what the PW/WP maintainers think, I'll take care of this today.

@flibitijibibo flibitijibibo self-assigned this Mar 21, 2022
@flibitijibibo flibitijibibo changed the title [WIP][DO NOT MERGE]Pipewire session detection [DONOTMERGE] pipewire: Check for an audio session before initializing Apr 6, 2022
@Kontrabant Kontrabant force-pushed the pipewire_detect_session branch from 86a924f to a1629c8 Compare October 12, 2022 15:49
@slouken slouken added this to the 3.0 milestone Nov 23, 2022
@Kontrabant Kontrabant force-pushed the pipewire_detect_session branch from a1629c8 to 8c45de9 Compare December 16, 2022 20:00
Check if the session supports audio and fail if audio support is not present.
@Kontrabant Kontrabant force-pushed the pipewire_detect_session branch from 8c45de9 to 178cbdf Compare December 16, 2022 20:02
@Kontrabant
Copy link
Contributor Author

Updated to work with the current WIP session service code. Needs both the Pipewire and Wireplumber changes to test:

https://gitlab.freedesktop.org/pipewire/pipewire/-/merge_requests/1409
https://gitlab.freedesktop.org/pipewire/wireplumber/-/merge_requests/441

@flibitijibibo
Copy link
Collaborator

Forgot to mention over on this side: The patches above are open for anyone to take over, as the author had to return to other work! From what I can tell it's really close, just needs addressing of a couple comments and some overall cleanup.

@Kontrabant Kontrabant closed this Apr 12, 2024
@Kontrabant Kontrabant deleted the pipewire_detect_session branch April 12, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

pipewire: Add support for session detection
3 participants