Commit graph

253 commits

Author SHA1 Message Date
Ashok Sidipotu
83e990bf2d policy-endpoint-device.lua: enhance link log msgs 2023-11-22 08:22:59 +00:00
Ashok Sidipotu
eba3d9d6f8 policy-endpoint-client.lua: avoid connecting filters to endpoints
Equalizer Node or filter nodes are considered as regular linkable and
its output is connected to endpoint. Prevent this by skipping over
filter nodes in this script.
2023-11-22 08:22:59 +00:00
George Kiagiadakis
0a7bd4fe86 si-standard-link: remove the "passive" property
PipeWire no longer uses the link.passive property, so there's no
point in adding it here. The node.passive property is used directly.
2023-11-20 12:00:54 +02:00
George Kiagiadakis
5b1ff7377f si-audio-endpoint: mark the nodes as passive instead of marking the links
This is a behavioural change in effect since pipewire 0.3.68, where
pipewire's link-factory ignores the link.passive property and the
node.pasive = in/out/true is used instead.
2023-11-20 11:56:07 +02:00
James Calligeros
7a65d76a57 policy-dsp: add ability to hide parent nodes
some hardware devices are never supposed to be accessed directly by
clients, and are designed under the assumption that they will be
front-loaded by some sort of DSP. add a hide_parent property
to policy-dsp and revoke all permissions to the bound node of a DSP
graph where this is set to prevent hardware misuse or damage by poorly
behaved/configured clients.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
2023-10-30 20:11:47 +00:00
Dmitry Sharshakov
5faab4e8c2 policy-device-profile: set default and best by device.profile 2023-10-02 14:52:45 +00:00
Dmitry Sharshakov
2970ee2634 policy-dsp: expect policy-device-profile to manage profiles 2023-09-25 12:31:18 +03:00
Dmitry Sharshakov
2dd28c0015 policy-dsp: load filters from file 2023-09-25 12:31:18 +03:00
Dmitry Sharshakov
11b3803edc policy-dsp: add a policy for loading filter chains
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2023-09-25 12:31:18 +03:00
Jonas Holmberg
92e53bb7ba policy-device-profile: Use device.profile if set
Don't set best profile if device.profile property has been set with
alsa_monitor.rules.
2023-09-15 17:56:29 +02:00
George Kiagiadakis
02e1393c9f policy-node: destroy node only after sending an error to the client
if the node is destroyed before, pw_stream shuts down and doesn't
relay the error to the application
2023-09-01 16:23:09 +03:00
George Kiagiadakis
5d4db78427 suspend-node: check if the node still exists before suspending it
After a timeout, it's possible that something else may have
destroyed the node already. This can happen for example with virtual
sinks that were created from another process.

Fixes: #467
2023-06-14 23:26:30 +03:00
Pauli Virtanen
faf98ae76e bluez: emit combine-stream for BAP device sets
For Bluetooth LE Audio device sets (e.g. pair of earbuds), bluez5-device
emits "internal" nodes for each individual device, and a combine node
for the device set.

Make the bluetooth monitor to create the combine nodes using
module-combine-stream.

Do some shenanigans to route ObjectConfig events from bluez5-device to
the correct combine node: look for combine nodes associated with device
sets, and put them as managed objects of the Spa devices.
2023-04-08 23:18:58 +03:00
Ashok Sidipotu
b78e441c79 libcamera.lua: add support for disabling nodes
Fixes #418
2023-02-22 14:13:17 +00:00
Robert Mader
979fd59329 policy-node: do not hold references in link-error handler
Using `si` and `si_target` in the error handler results in references to
the objects getting added, keeping them alive indefinitely. Look them up
using their ids instead.

Fixes b8201d2716

Closes https://gitlab.freedesktop.org/pipewire/wireplumber/-/issues/419
2023-02-20 15:05:25 +01:00
Wim Taymans
eae8d2d0b5 alsa: boost pro- profiles priority
So that they are more likely to become the driver in the graph.
2023-02-16 10:44:48 +00:00
Robert Mader
b8201d2716 policy-node: handle WpSiStandardLink link-error signal
It gets emitted e.g. on format negotiation errors. Send `-EPIPE`
errors to the respective clients to let them close the connection.
2023-02-16 10:39:31 +00:00
Julian Bouzas
a0e8470764 restore-stream: add default-channel-volume config option
Allows users to set a default channel volume for streams whose properties have
never been saved before.
2023-01-31 17:06:10 +00:00
Pauli Virtanen
2daa2da773 bluez-midi: add property for setting latency offset 2023-01-24 17:01:20 +02:00
Pauli Virtanen
69fcdb5b69 bluez-midi: set api.glib.mainloop
Indicate to the plugin that Glib mainloop = PW mainloop.
2023-01-24 17:01:20 +02:00
Pauli Virtanen
0978c224dc scripts: add bluez-midi monitor and its configuration
Add support for BLE MIDI devices and local endpoints.

Disabled by default for now, as the feature currently faces some
DBus/SELinux policy issues e.g. on Fedora.
2023-01-24 17:01:20 +02:00
Wim Taymans
f6dc1b3347 alsa-monitor: handle snd_aloop devices better
Place Loopback as the device description for snd_aloop devices.

Fixes pipewire#2214
2022-12-13 15:19:06 +01:00
George Kiagiadakis
98d968caa6 policy-node: rescan also when streams are removed
This is useful, for example, to cleanup monitor streams in pavucontrol
after a stream has been destroyed.

Fixes #388
See also pipewire#1840
2022-12-06 12:01:34 +02:00
Frédéric Danis
3152b89e82 bluez: Add Offload SCO nodes
For offload SCO, the audio stream should be routed to/from Bluetooth
chipset via ALSA.
To do this, this commit prevent the creation of the sco-source or sco-sink
nodes, and replace them by loopback nodes.
It's up to the platform to correctly the the route to the Bluetooth chipset
ALSA entries.

When the loopback node state change to running, the script also call the
bluetoothOffloadActive param of the device to start/stop the SCO link.
2022-12-02 10:57:03 +01:00
Ashok Sidipotu
09a6881269 restore-stream.lua: do not restore the target when it is defined in node props
Fixes #335
2022-12-01 11:25:37 +00:00
Dmitry Sharshakov
a40ab8243e monitors: v4l2: allow disabling devices and nodes 2022-11-30 16:54:02 +03:00
Wim Taymans
3e63610bc5 access-portal: re-evaluate permission when a camera is added
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.
2022-11-14 13:08:09 +01:00
Ashok Sidipotu
e77ad8c0c0 alsa.lua: remove the disabled entities from the names table
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
2022-11-08 14:55:40 +00:00
Pauli Virtanen
f79a330849 scripts: policy-node: wait for unactivated links instead of removing
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.
2022-11-07 11:45:21 +00:00
George Kiagiadakis
8fa1693919 Apply 1 suggestion(s) to 1 file(s) 2022-09-28 14:39:30 +00:00
Dmitry Sharshakov
6002cea116 alsa-midi: move MIDI bridge properties into a table
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2022-09-28 14:39:30 +00:00
Dmitry Sharshakov
b86847ec75 alsa-midi: add an option to disable longname/card number display
Signed-off-by: Dmitry Sharshakov <d3dx12.xx@gmail.com>
2022-09-28 14:39:30 +00:00
Pauli Virtanen
40e7ad5ccc bluez: use device id instead of profile name in node names
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.
2022-09-27 07:49:52 +00:00
Frédéric Danis
591f2e77e9 scripts: bluez: Autoconnect bap-sink stream on peripheral/acceptor 2022-09-15 13:21:37 +02:00
Frédéric Danis
57518ed2ce scripts: bluez: Autoconnect media.source stream
New version of PipeWire replaced a2dp.source stream by more generic
media.source stream.
Keep the former for compatibility.
2022-09-15 13:21:37 +02:00
Pauli Virtanen
37c839b930 policy-node: fix potential rescan loop
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"
2022-08-14 19:47:11 +00:00
Julian Bouzas
7a70b04237 policy-device-profile: set best profile even if it has not changed
We want to set the best profile even if it has not changed, because it can be
different than the active profile.

Fixes #329
2022-07-31 10:09:32 -04:00
Fabian Vogt
d5029697de Fix leftover use of module-reserve-device's state property
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.
2022-07-14 13:02:19 +00:00
Pauli Virtanen
aee4fe2579 policy-device-routes: consider routes only for active profile
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.
2022-07-07 18:28:24 +00:00
Pauli Virtanen
73b0dccb8d policy-default-routes: use different default volume for input direction
Input direction volume doesn't need a safety margin.
2022-07-07 18:10:11 +00:00
Pauli Virtanen
affdf36a29 policy-device-routes: change default volume to 0.4 on cubic scale
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.
2022-07-07 18:10:11 +00:00
George Kiagiadakis
c16e637c32 alsa: use "obj_type" as a variable name to avoid shadowing lua's "type" function
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
2022-07-07 20:58:36 +03:00
George Kiagiadakis
37bd392119 alsa: add mechanism to override node default properties for VMs
Fixes #162, #134
2022-06-28 14:31:17 +03:00
George Kiagiadakis
d7f17104bf policy-device-profile: always consider the stored default profile when re-evaluating
Fixes: #179
2022-06-28 08:30:10 +00:00
Julian Bouzas
392bd81913 alsa.lua: remove node names from table when parent device is destroyed
Fixes #293
2022-06-27 08:52:36 +00:00
Julian Bouzas
46e7c5c144 m-reserve-device: use WpDbus API 2022-06-02 12:34:16 -04:00
George Kiagiadakis
2ac384711d libcamera: give higher priority to external cameras
if you have plugged an external camera, that probably means you
prefer using that instead of the internal one
2022-05-31 12:15:11 +03:00
George Kiagiadakis
334a134471 v4l2: append "(V4L2)" in node descriptions
This is to make it easier to work with V4L2 and libcamera simultaneously
2022-05-31 10:53:01 +03:00
George Kiagiadakis
b44759ec3f libcamera: improve the front/back camera descriptions 2022-05-31 10:41:20 +03:00
George Kiagiadakis
6931050b7f v4l2/libcamera: set node.nick on nodes 2022-05-31 10:40:56 +03:00