When a new camera is added, go over all clients and update the
permissions for the new camera.
This makes it possible to plug in a new camera and make it visible to
the portal apps.
entities here are the device cards and the device nodes.
sometimes null device objects are reported by monitor, this results in lua
exceptions handle this use case.
Fixes#361
If a link is not activated, don't remove it. Instead, schedule a rescan
when a link activates, so that we'll handle it once it does.
This is a workaround for some problems, see
https://github.com/Audio4Linux/JDSP4Linux/issues/74
However, the underlying cause is not understood.
Don't include profile name in node names for HFP and A2DP. Instead,
append the id number from the spa.bluez5 backend. The backend takes
care of choosing the unique id numbers appropriately.
This makes the sink/source names the same for A2DP and HFP. This allows
outputs directed to the Bluetooth device to remain there when switching
profiles between A2DP and HFP, without needing to determine the new
sink/source name.
SiLink activation might be delayed indefinitely under some error
conditions. Currently, policy-node schedules a rescan when it sees a
non-activated link on a stream to be moved, which produces busy loop if
the si-link doesn't activate.
Instead of rescheduling on non-active si-links, just remove and emit a
warning. The si-link then gets removed once it gets activated.
Reproducer:
1. Play audio from Rhythmbox and pause.
2. Switch default output with pactl between two different outputs
3. Links from the paused stream stay at "init"
The move to the WpDbus API dropped the "state" property from the plugin,
but left the property enum and use of it in alsa.lua. Remove the enum and
port over the code in alsa.lua.
If a route specifies a set of profiles, it should not be used if the
profile is not in that list.
In findBest/SavedRoute, exclude routes that don't match the active
profile.
Currently in the SPA devices, the device id is different for different
profiles so this condition does not occur, but in general this might not
be so.
It's safer to have the default volume value at significant attenuation,
to mitigate situations where the output is at high gain.
Use linear scale 0.4^3 (-24 dB), which puts Pulseaudio volume sliders at
40%, as a better starting value than 0.4 (-8 dB / 74%). E.g. for many
Bluetooth headphones, the volume at 74% is still uncomfortably high, and
a lower value is better.
This causes a crash when running in a VM because the code tries to
execute lua's "type()" and ends up executing the local string variable...
Fixes: #303
Currently v4l2 nodes will get higher priority than libcamera ones.
The default can be changed, of course, with wpctl.
Things are still not great if a camera is enumerated by both monitors.
The first node to be linked will grab the device and the second one
from the other subsystem will fail to negotiate.
Currently, when using filter nodes such as echo-cancel or filer-chain, the
ports format of the virtual stream node might not always match the format of its
associated virtual device node. This can happen if the virtual stream node is
linked with a real device node configured with many channels, such as surround
profile. In that case, the channel configuration is not forwarded to the virtual
device node, making the application not being aware of a surround setup.
This change listens for port format changes in the virtual stream nodes, and
reconfigures the virtual device node ports everytime the virtual stream node's
port format changes.
This behavior is experimental and optional, so it is disabled by default.
In Lua, `0` is a truthy value, which means `not 0` is `false`. Compare
the resulting value from bitwise AND with 0 instead of checking it with
`if not` to ensure correctness.
This script, base on PipeWire module fallback-sink will create a fallback
sink node if there's no other sink available except the endpoints created
by WirePlumber.
Filter-like streams (e.g. output stream from filter-chain) should not
start following default sink, as usually the user intends their routing
to remain static, and not change unless explicitly requested.
Pulseaudio has special handling for streams associated with filter
sinks/sources, and does not make such streams follow default.
Use presence of node.link-group to determine which streams are
associated with filter sinks/sources, and don't make them to follow
default.
Some devices (Mostly USB devices) have a generic pcm name (USB Audio)
that is quite useless. Filter this out and fall back to the device nick
in that case.
Since nodes may have a target specified in their props, the logic in
cleanupTargetNodeMetadata does not work correctly.
Instead, emulate what Pulseaudio does: if we see a reconnectable node
with target defined by node props, but not by metadata, which is linked
to the default sink, then make the stream follow the default from that
point on.
Setting node target by id is not safe due to id reuse, and so
target.object which specifies the target by its object.serial was
introduced, and is used e.g. by pipewire-pulse.
Use target.object specifications in policy-node if they are present.
This avoids using device.nick, which is the card name, on all nodes
of a card. Useful on UCM, where analog, hdmi, etc are all exposed
as nodes on a single profile.
Connecting dont-reconnect nodes that have a defined target to fallback
probably does not make sense.
They will be linked to a target that the client likely did not intend,
and the link will not be changed later on.
In Pulseaudio, if the defined target is not found, streams are not
connected to the fallback but instead fail. This happens also with
streams that don't have DONT_MOVE specified.
Pipewire-media-session also did not link dont-reconnect streams with a
defined target to the fallbacks.
Dont-reconnect streams should not be moved to a new target, even though
other streams would move.
Pulseaudio DONT_MOVE works like this, and also pipewire-media-session
worked like this.
When device nodes go away, we should remove links and peer_id references
concerning them, so that we don't leave behind stale links and stale id
entries in the peer_id tables.
Also fix bug in si_flags[out_id] handling in unhandleLinkable.
Policies need to know if there are session items that are pending
activation. Linkables are not activated in the same order as nodes
appear, which causes problems for e.g. resolving target nodes, if some
of the linkables are pending.
Register linkables in create-items before they are activated. When
activation completes, remove those that did not activate successfully.
Policies can filter out inactive items by tracking active-features
flags.
If there are existing linkables that are not ready, suspend policy-node
processing, and continue it only after all linkables are ready.
This makes the configuration more consistent. The storing of the default routes
logic needs to be implemented eventually in a C module-default-routes, similar
to module-default-profile.
Persistent profiles will never change. This can be useful if we want to keep
a specific device profile even if a new one with higher priority becomes
available. For example, keep the 'off' profile instead of switching to best
profile when monitor screens is resumed.
See #138