Commit graph

629 commits

Author SHA1 Message Date
Julian Bouzas
151ba8425e m-si-audio-adapter: add 'disable.dsp' configuration property
If 'disable.dsp' is set to TRUE, the adapter will always be configured in
passthrough mode. Then, if 2 adapters want to be linked with different formats,
the si-standard-link session item will automatically reconfigure one of the
adapters in convert mode so that the format matches.
2021-09-29 14:03:27 -04:00
Julian Bouzas
133249399a m-si-standard-link: refactor and add support for no DSP mode
We always use the output session item mode and format when configuring adapters,
unless the input session item is a device node and the output session item is
not a device node.
2021-09-29 14:03:27 -04:00
Julian Bouzas
30b1dd7b4c si-adapter: call format task if port param-info is triggered in non DSP mode
This is needed so that the async callback passed to _set_ports_format is called
when changing the adapter's port format and the port has not been removed or
added. Eg: when configuring the adapter in S16 convert mode to S32 convert mode.
2021-09-29 14:03:23 -04:00
Julian Bouzas
334d92b5cb si-adapter: use F32P default format if mode is NULL 2021-09-29 13:38:22 -04:00
George Kiagiadakis
a253aa4c49 modules: implement logind module and integrate with bluez monitor
This copies the logic of media-session's logind module and allows
the bluez monitor to be active in only one user session at a time.
This is especially useful to avoid interference between the gdm
session and the actual user session, which momentarily both have
wireplumber running when logging in/out.

Fixes #54
2021-09-27 18:30:32 +03:00
Julian Bouzas
7005c4518f m-portal-permissionstore: try to reconnect on idle if DBus connection is closed
This change also keeps the plugin always activated, regardless of whether the
DBus connection is closed or not, which is useful when the dbus service is
restarted.
2021-09-24 09:31:29 -04:00
Julian Bouzas
a5a0af5dff m-device-reservation: try to reconnect on idle if DBus connection is closed
This change also keeps the plugin always activated, regardless of whether the
DBus connection is closed or not, which is useful when the dbus service is
restarted.
2021-09-24 08:53:41 -04:00
George Kiagiadakis
f82ca0155c si-audio-adapter: use INPUT direction to configure virtual sources
Virtual sources are actually sinks (null sinks), so they expect to
be configured with INPUT direction

Fixes #57
2021-09-23 19:00:29 +03:00
Julian Bouzas
711d1ee686 spa-pod: add support for custom Id properties
Allows creating and parsing Pod Objects with custom properties.
2021-09-21 12:29:54 -04:00
Julian Bouzas
7c03da82e7 si-audio-endpoint: don't build DSP format in _set_ports_format
Allows any format to be set, which is needed for non DSP modes.
2021-09-20 12:53:34 -04:00
Julian Bouzas
eff435c7f1 si-audio-adapter: don't build DSP format in _set_ports_format
Allows any format to be set, which is needed for non DSP modes.
2021-09-20 12:32:43 -04:00
George Kiagiadakis
2a5f9c51f2 lua/api: fix object constructors to fail gracefully 2021-09-15 12:51:47 +03:00
George Kiagiadakis
8949e98d1f remove wpipc
This component has been split out to form a separate project,
moved to https://git.automotivelinux.org/src/pipewire-ic-ipc/
2021-08-19 16:53:28 +03:00
George Kiagiadakis
27ed36c2da wp: make the config file lookup methods more generic
* Make the flags public and give them nicer names
* Pass down the flags from the caller, so the caller can now explicitly
  ask for looking into specific directories
* Rename the methods
* Remove and inline the wp_get_xdg_config_dir() method, since it's only
  used internally
* Refactor the lookup dirs ordering to get both WIREPLUMBER_*_DIR env
  variables to replace all the other directories. Previously, we were looking
  for scripts in WIREPLUMBER_DATA_DIR, but we were also looking in /etc at
  the same time (with precedence, even), which could result in unexpected
  behaviour. Now, if a WIREPLUMBER environment variable is specified,
  we only look in there.
2021-08-19 10:06:37 +03:00
Arun Raghavan
129b44bb0c doc: Add WpImplModule docs for the C and Lua API 2021-08-18 16:04:39 +00:00
Arun Raghavan
ef29018c55 m-lua-scripting: Add WpImplModule bindings 2021-08-18 16:04:39 +00:00
Julian Bouzas
7abd3728e7 build: fix volatile compatible-pointer-types warnings
Happens when compiling with GCC 11
2021-08-18 09:17:05 -04:00
Julian Bouzas
9b8a876662 m-lua-scripting: add GLib access Lua API 2021-08-10 11:50:51 +03:00
Julian Bouzas
907a67fcb1 modules: add new API module to monitor files 2021-08-10 11:50:51 +03:00
jakobrs
92d99f4a75 dump_table: Sort keys before printing 2021-08-10 07:50:01 +00:00
jakobrs
86bfdbea13 Fix not-equals verb having the wrong number of arguments in Lua API 2021-08-08 20:45:56 +02:00
George Kiagiadakis
9ebea2976d wp: refactor and rename wp_iter_conf_files() to use WpIterator
This also corrects the logic of loading config files in m-lua-scripting.
Previously, if an error occured within the iteration function,
the error was not properly propagated to the caller because -EINVAL
was being added to nfiles instead of checked.
2021-07-20 14:42:42 +03:00
Peter Hutterer
d38c3fb4cc lib: add functions to search in configuration/data directories
The previous approach to loading config files was to ask WP for the
directory and then search those for the config files. This patch changes the
approach - a caller now asks WP to search for a specific config file or
iterate over a config file directory.

This allows us to implement a directory lookup order, i.e.
"wireplumber.conf" may be in XDG_CONFIG_DIR, /etc/,
/usr/share and the first one found is used.

For configuration directories, the new method iterates over all matching
entries (files + directories) and invokes a callback for each entry.

This enables distributions to ship default files in /usr/share/wireplumber
but have admins and users override them on a local basis. For lua scripts in
particular, overriding a distribution-provided file with an empty file
effectively disables it, adding a file adds it in the right sort order.
2021-07-15 15:17:01 +00:00
Peter Hutterer
1132b37f0b modules: fix g_file_test for regular files
From the g_file_test documentation:
"For example, (G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR) will return TRUE if
the file exists; the check whether it's a directory doesn't matter since the
existence test is TRUE. With the current set of available tests, there's no
point passing in more than one test at a time."
2021-07-15 15:17:01 +00:00
George Kiagiadakis
ec397aaaca lua: add not-equals to the possible constraint verbs 2021-07-02 20:24:25 +03:00
Julian Bouzas
dc6fa6cbfe m-lua-scripting: unref value pod after adding it to control 2021-06-30 14:06:48 -04:00
George Kiagiadakis
888d6e5033 lua: add Port.get_direction() + documentation for it 2021-06-30 19:51:21 +03:00
George Kiagiadakis
18fe17fa01 lua: fail if an optional Interest is not none, nil, Interest or table 2021-06-30 19:51:21 +03:00
George Kiagiadakis
795a37d029 lua: complete the WpNode bindings 2021-06-30 19:51:21 +03:00
Julian Bouzas
014ef05308 m-reserve-device: use a weak ref instead of raw pointer for transition
This always guarantees the transition is valid when g_weak_ref_get() does not
return NULL.
2021-06-25 11:04:30 -04:00
Julian Bouzas
a65f3bb44e m-default-nodes: properly parse args 2021-06-25 08:50:08 -04:00
Julian Bouzas
f0830e5a7d m-lua-scripting: check return values of lua_getstack and lua_getinfo 2021-06-25 08:50:08 -04:00
Julian Bouzas
51128f0521 m-mixer-api: only add 'mute' if correctly parsed 2021-06-25 08:50:08 -04:00
Julian Bouzas
412fae485a m-lua-scripting: make sure pod is successfully parsed
Otherwise show a warning
2021-06-25 08:50:08 -04:00
Julian Bouzas
671b8110d9 m-lua-scripting: make sure lua type is valid 2021-06-25 08:50:08 -04:00
Julian Bouzas
c423012238 m-lua-scripting: fix conversion from SPA_TYPE_Bytes to LUA_TNUMBER 2021-06-25 08:50:08 -04:00
Julian Bouzas
02fd0a554a m-si-standard-link: make link_all a parameter
Otherwise its value will always be false, making it useless
2021-06-25 08:50:08 -04:00
George Kiagiadakis
8e5448fd0c si-audio-adapter/endpoint: do not sync() in loops, use ports-changed instead
Calling sync() in loops may end up looping forever if the operating
system's scheduling allows pipewire to reply to this sync() before
wireplumber's event loop has a chance to become idle.

In order for the new ports to appear, the object manager that monitors
them needs to emit "objects-changed", which only ever happens in an
idle callback. If the reply to sync() arrives before the idle callback,
it gets prioritized and processed, which causes another sync(), and so on...

Since setting PortFormat in the adapter always changes the ports,
watching for "ports-changed" feels like a better solution. Still,
there is more room for improvement.
2021-06-18 15:14:03 +03:00
George Kiagiadakis
87741e39ec s/metadatas/metadata/g
data is already plural
2021-06-18 10:44:24 +03:00
George Kiagiadakis
950c358180 create-item: handle all kinds of Audio/Video & Stream nodes
And be careful not to handle nodes created by si-audio-endpoint,
by using a specific property for that.

Also, use Audio/{Source,Sink}/Virtual as the media class of null sinks
created by si-audio-endpoint, it sounds more appropriate.

Fixes #34
2021-06-10 16:41:01 +03:00
George Kiagiadakis
558ab50367 si-standard-link: treat endpoints as devices when linking stream<->endpoint
This avoids reconfiguring endpoint nodes when re-linking streams
to their endpoint after having been corked by the policy.

This is not ideal, the logic here needs some refinement.
2021-06-10 14:53:09 +03:00
George Kiagiadakis
2668900e18 lua: improve the object:activate() callback to report errors
There is now a second param to the callback that is an error string,
if any error happened
2021-06-10 14:53:08 +03:00
George Kiagiadakis
7355215cf1 pipewire-object: change params-changed signal to take a string param name
To be consistent with the rest of the API where strings are used
to identify param types
2021-06-09 13:29:34 +03:00
George Kiagiadakis
892129bd08 lua: implement metadata:set() 2021-06-08 13:40:13 +03:00
George Kiagiadakis
77454243bc lua: fix refcounting of metadata iterator
wplua_push* takes a full ref
2021-06-08 13:40:13 +03:00
Julian Bouzas
8ba6439dd4 m-default-nodes-api: free default nodes when disabling plugin 2021-06-07 11:33:21 -04:00
Julian Bouzas
464f1de641 m-default-nodes: free default nodes when disabling plugin 2021-06-07 11:33:21 -04:00
George Kiagiadakis
80fad18e3d lua: remove hack around WpObjectInterest since we can _ref() it now 2021-06-07 18:01:49 +03:00
Wim Taymans
342c3a7ea2 si-adapter: handle autoconnect property
When the autoconnect property is not available or false, we must
simply configure the stream in its default channel map and leave it
unconnected.

Fixes pw-cat -p --target=0 ..
2021-06-07 10:29:25 +02:00
Wim Taymans
72d8778e3f si-adapter: handle dont-remix streams
Don't-remix streams don't change their channel mapping based on
the device they connect to but are always configured with their
default channel mapping, just like devices.

This fixes the gnome-control-center channel test.

This patch also removes the 1 channel -> many patch because it is
not the right thing to do in this case and should be implemented
with some proper channel mapping patch later.
2021-06-07 09:56:54 +02:00