You can now override:
* Whether to store/restore properties like volume
* Whether to store/restore the target.node
* Things like media.name/application.name/etc which affect which
entry is going to be used in the state file
Related to #169
If a stream audio node does not have the 'media.role' property set, the policy
will asign the 'Default' media role name to it. In addition to this, if the
'Default' endpoint can not be found, the policy will link the stream audio node
with the lowest priority endpoint.
Video nodes will always be handled by policy-node.lua, and they will never be
handled by policy-endpoint-client.lua
This allows users to assign a particular endpoint for streams that don't have
the 'media.role' property set.
Only the configured headset profile needs to be persistent, the switched
status and saved profile should not persist over wireplumber restart.
When devices appear initially, they should not appear as switched,
but recheck switch status.
Monitor whether streams are running or suspended. When they are
suspended, switch to normal mode.
This is required e.g. for programs such as Teams, which keep recording
streams open but inactive for their whole runtime.
Profile restore also needs to be done with a timeout, to avoid switching
rapidly when streams are moved between sources.
Use Lua tables properly as maps.
Headset profile saving does not work properly currently (only called on
metadata change; if headset-profile == current-profile, it doesn't get
saved etc.)
Change it to follow the logic:
- Each device has a "normal" and "switched" mode. The latter becomes
active if a "communication" input stream exists and the current
default sink is bluez sink. The switched mode is exited only when
there are no "communication" input streams.
- On transition normal->switched, record current profile as the "saved"
profile. Then switch to "headset" profile. If no headset profile
was saved previously, pick profile with input direction & highest
priority.
- On transition switched->normal, save currently active profile as the
"headset" profile. Then switch back to "saved" profile.
Monitor streams can be identified based on the stream.monitor property.
They should not be identified based on application name, because that
may be localized, and the previous code does not work properly on
non-English locale.
This also improves the status output to display the configured default node
names using the new get-default-configured-node-name API, and refactors
set-default to also use the new set-default-configured-node-name API from
the default-nodes-api module.
Some devices have different nodes for speakers and headphones. In that scenario,
this change notifies the policy to re-link all clients to the new default node
when the user plugs and unplugs the headset.
Currently, spa-bluez5 devices start in non-off profile, which causes
m-device-activation logic to set the highest priority profile instead of
the saved one.
Fix this by having spa-bluez5 start devices in off profile, similarly as
spa-alsa does.
We now only use module-rt. Explicitly set the nice.level to -11 instead
of leaving the default (do nothing). Adjust the rt limits to their new
defaults in module-rt (unlimited).
We now only use module-rt. Explicitly set the nice.level to -11 instead
of leaving the default (do nothing). Adjust the rt limits to their
defaults in module-rt.
The "saved headset profile" is taken as the profile that was active when
the headset mode deactivates. So in case the user switches profile during
the time when the Communication input stream is active, the selected
profile is remembered next time.
When a stream gets added, we might have a situation where the device
does not yet exist to actually link on the basis of intended role. For
example this can be observed if no mic sources are present and then the
mic appears after a bluetooth profile switch to HFP.
To fix this, iterate over streams when a device connects in addition to
iterating over devices when a stream connects.
This reverts commit ad80faaa8d.
The same issue is fixed by the intermediate commit by Wim. Let's revert
this to keep the logic in-sync with policy-node.lua and media-session.
The Role traversal of config data to take notice of the
media class as well so that source and sink roles dont
overstep on each other and pick up unexpected endpoints.