Commit graph

271 commits

Author SHA1 Message Date
Ashok Sidipotu
5550777983 policy-bluetooth.lua: Port onto Event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
1f77be36e5 policy-bluetooth.lua: Adjust style 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
d57e387f75 event-hooks: give unique names to event hooks 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
82a8bc5673 event-hooks: remove the unwanted second arg in simple hooks 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
695b99f0e8 device-profiles: Port to event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
464cda4cad create-item.lua: Adjust style 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
ebffbc9ca1 restore-stream.lua: Adjust style 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
78c2e3167a device-profiles: Add summary 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
9197dac94d policy-device-profile.lua: Adjust style 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
bc2d403396 policy-device-routes.lua: Port to event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
f8072889aa policy-device-routes.lua: Add summary and enhance the debug messages 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
5ebef4be6e policy-device-defaults.lua: Adjust style 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
6e31b47c28 event-dispatcher: Add an enumeration of default event hook priorities
This scheme provides for an orderly execution of hooks as the priorities
are controlled from one single place. Enumeration is defined in such a
way that new items can be added easily.

All the event hooks are changed to get the priorities from this
enumeration.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
9337bb25ef m-default-nodes*: Remove suffixes in hooks name
Suffix is redundant for on events as Events names and Event chains are
printed with 847c0.

Update the settings file used.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
ff03094d67 restore-stream.lua: Port to event-stack 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
dc3e523240 policy-node.lua: Update settings file used 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
ff833b138d event-dispatcher: log event and hook names and chains
- Add a new variable "name" in WpEventHook and use it to log all the
  hooks(by name) picked up in _push_event(). This gives a clear picture
  if hook is registered for a given event.
- Form a name for an event and a chain of events for an event run, log
  both of them. This gives a clear picture of the events executed and
  order in which they are dispatched.
- Similarly build hooks chain and print it in _source_dispatch(), this
  gives a clear picture of the hooks picked and the order in which they
  are dispatched.
- Log only the dispatchable(with hooks) events, this de-clutters
  the log messages.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
11dacb9b5f policy-node.lua: Update the summary
Update the summary of what the script does.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
18727d41e4 create-item.lua: Update the summary
Update the summary of what the script does.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
d2770123d3 policy-node: Adjust the priority of policy event
handlelinkable() should run after the linkable is created by the
create-item adjust the Priorities accordingly.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
fbac3a38a9 policy-node: Port to Event Stack design
- register hooks(simple) for handling linkable object-added/removed
  events.
- register simple rescanning after-event hook for "linkable
  addition/removal" and "device added" events.
2023-04-17 07:47:09 -04:00
George Kiagiadakis
aefc50da3d create-item: push linkable events.
push linkable object-added/removed events.
2023-04-17 07:47:09 -04:00
George Kiagiadakis
fd91d8a35b WIP: port create-item.lua to use event hooks 2023-04-17 07:47:09 -04:00
Ashok Sidipotu
8a0c4fde4c policy: Switch policy settings to JSON
- Create policy-settings.conf and move all the policy settings to it.
- Change all the policy scripts to fetch the settigs from WpSettings
  API.
- Remove all the references to config/lua.
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
2f60077460 endpoints: Switch endpoints config to JSON
- Move the endpoints defination to wireplumber.conf under a new section
  in the form of two JSON objects, namely endpoints and
  endpoints-roles.
- Treat the endpoint objects as settings, for the sake of loading,
  parsing and querying.
- m-settings loads the objects and WpSettings parses them as any other
  settings.
- Make the following changes in endpoint scripts.
   - Get the endpoint settings using the _get_string() API.
   - Parse and use the data.
   - Remove references to the config/lua
- Remove the endpoints defination in config/lua
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
2ef76f823a bluez.lua: Switch bluez lua monitor to wpsettings
- Monitor to use the JSON APIs and move away from config/lua
- Enhance logic in wpsettings to parse settings which are JSON arrays,
  some of the bluetooth properties are JSON arrays and parsing
  logic confused them for a rule.
- Add corresponding tests around this logic as well.
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
4282dff187 wpsettings: switch settings in main.lua.d to JSON
- switch stream based lua script and their configs to wpsettings,
  remove all the config/lua references
- move last remaining scripts and modules from 90-enable-all.lua to
  wireplumber.conf
- delete all files in main.lua.d
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
e180ff2f94 device-settings: Switch device settings to wpsettings
- move all the device based settings and scripts to JSON config and
  remove config/lua references.
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
161c43b71a lua monitors: switch to wpsetttings
- switch alsa.lua, v4l2.lua & libcamera.lua
- remove the config/lua references for these scripts
- fix the wpsettings deps parsing bug.
2023-04-17 07:44:19 -04:00
Ashok Sidipotu
a4f16a98f0 main: Add support for deps flag in loading modules
- support loading modules dependent on wireplumber settings in JSON
  config.
- load the settings module before parsing wireplumber.components,
  so that dependencies can be fetched during parsing.
- access lua scripts are switched to JSON based config and lua configs
  are removed.
2023-04-17 07:44:19 -04: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