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.
This is expected to be printed if a stream opens and closes
very quickly, like in the case of pipewire-alsa opening the device
for querying formats and then closing it immediately.
If the default nodes module is loaded, and the default node is not found, it
means that there is no valid target for that session item. We only need to
manually find a default target if the default nodes module is not loaded.
This makes sure nodes are ready before finding the default node, avoiding audio
glitch in wrong device if profile was also changed while changing the default
node (can happen with Gnome Sound Settings).
Since nodes are destroyed and recreated again when a device profile changes, the
only way to make sure device nodes are ready is to check the profile classes
structure, which tell us how many total nodes the device has, and then check
that those nodes exist for that device. A rescan is triggered whenever devices,
nodes or ports changed.
This patch also improves the logic when finding default nodes, allowing virtual
sources to be set as default sources.
Fixes#85 and #130
Fixes the warning:
[string "policy-node.lua"]:117: attempt to index a nil value (field '?')
stack traceback:
[string "policy-node.lua"]:117: in function <[string "policy-node.lua"]:109>