Commit graph

74 commits

Author SHA1 Message Date
Ashok Sidipotu
efb0c5a635 Wireplumber Settings: Port the latest changes from master
Port them from Lua config to JSON config.
2023-04-17 07:47:09 -04:00
Ashok Sidipotu
66c63a91a9 monitors: Align nomenclature of the settings and rules 2023-04-17 07:47:09 -04:00
Julian Bouzas
a512ddaaf3 scripts: use the WpSettings safe APIs
Avoids Lua errors if a setting cannot be parsed or does not exist.
2023-04-17 07:47:09 -04:00
Julian Bouzas
5e6262718a monitors: use new Settings.get_all() API 2023-04-17 07:47:09 -04:00
Julian Bouzas
a76e780b4b docs: update new configuration file names 2023-04-17 07:47:09 -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
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
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
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
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
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
Dmitry Sharshakov
a40ab8243e monitors: v4l2: allow disabling devices and nodes 2022-11-30 16:54:02 +03: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
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
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
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
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
George Kiagiadakis
2299c389b5 libcamera: set a user-friendly description for internal cameras 2022-05-30 11:06:46 +03:00
George Kiagiadakis
9ec2757d27 monitors: enable libcamera by default and set priority on all camera nodes
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.
2022-05-26 14:08:16 +03:00
Julian Bouzas
c00c5a6675 alsa.lua: fix device name deduplication when reservation is enabled
Fixes #241
2022-05-19 07:43:12 -04:00
Pauli Virtanen
6feecab74e scripts: translate user-visible strings in alsa.lua 2022-04-11 19:20:43 +03:00
Wim Taymans
0747d34e44 alsa: fixup node.nick
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.
2022-03-08 11:03:24 +00:00
Pauli Virtanen
03c6fb0a86 scripts: bluez: set icon name for bluez devices 2022-03-08 09:56:28 +00:00
George Kiagiadakis
b95da3393c alsa: also try the profile description if the pcm name is empty, for node.nick 2022-03-01 12:11:25 +02:00
George Kiagiadakis
4e5af26382 alsa: use the pcm name to populate the node.nick
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.
2022-03-01 11:35:55 +02:00
Julian Bouzas
b3446efa16 config: port device-activation module to policy-device.profile.lua
Because all wireplumber policies are in Lua.
2022-02-16 13:37:40 -05:00
Pauli Virtanen
2db8c0a288 bluez5: fix initial profile selection
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.
2022-01-24 07:32:22 +00:00
George Kiagiadakis
18bc3d3596 scripts: fallback to empty config table if args were not passed from the config files
Fixes #158
2022-01-13 11:10:03 +02:00
mazunki
bbd23fa3e3 added support for disabling nodes and devices through conf 2022-01-12 13:07:05 +00:00
Julian Bouzas
40b16974cf scripts: monitors: log warning if spa devices were not created successfully
Can happen if the user does not have the specific spa pluging installed.
2022-01-12 10:09:56 +00:00
Wim Taymans
efd2458418 alsa: handle the release-requested signal
Handle the release-requested signal by destroying the device and
then calling release.

Fixes pipewire/pipewire#1846
2021-11-23 13:17:29 +01:00
Peter Hutterer
9208ea051c Fix some typos 2021-11-18 12:09:57 +00:00
Wim Taymans
45fae97036 libcamera: use the new manager object for monitoring 2021-11-15 11:58:14 +01:00
Wim Taymans
7907d39aff scripts: add libcamera monitor 2021-10-06 10:22:36 +02:00