Commit graph

24 commits

Author SHA1 Message Date
Julian Bouzas
72b3be9e83 m-si-audio-endpoint: use an internal audio adapter session item
Avoids code duplication with si-audio-adapter.
2021-10-21 14:03:10 -04:00
Julian Bouzas
44a0c55e3d m-si-audio-endpoint: do not use virtual media class for null sink nodes
The PulseAudio layer does not recognize virtual media classes.
2021-10-20 12:50:33 -04:00
Julian Bouzas
47896503a8 modules: fix default audio format segfault 2021-10-11 03:08:34 -04:00
George Kiagiadakis
e76c67c45c policy: refactor/improve policy-node & session items to fix linking to monitors
* populate most session item properties from create-item.lua to keep
  things more compact and readable
* use a standard naming scheme for the session item properties
* use session item properties instead of node properties in policy-node.lua
* improve policy-node's performance by converting the properties dictionary
  less times for each session item
* refactor some policy logic and make things slighly more readable
* change the accepted values for 'context' in wp_si_linkable_get_ports();
  use "input" and "output" to keep things clear, because the previous use
  of NULL and "reverse" were implying that a node has only one "standard"
  direction, but this is complicated for sinks w/ monitors and duplex nodes
* allow using monitors (which are Audio/Sink nodes in fact) as sources
* treat Audio/Duplex nodes as sinks, like p-m-s does
* respect the "stream.capture.sink" property of streams

Fixes #66
2021-10-08 00:26:41 +03: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
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
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
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
Julian Bouzas
f8cf723b19 si-adapter: take ownership of format argument
The wp_si_adapter_set_port_config API must take ownership of the param argument
as described by the documentation.
2021-06-03 14:53:00 -04:00
Julian Bouzas
3fbcf05c9b pipewire-object: take ownership of param argument
The wp_pipewire_object_set_param API must take ownership of the param argument
as described by the documentation.
2021-06-03 14:53:00 -04:00
George Kiagiadakis
ac9e1e89c4 wp: remove WpSession and WpEndpointLink
We have ended up not using them, so let's not carry them
in the ABI of 0.4

We can always revert that, but let's first decide how
these objects should be used
2021-05-21 19:57:31 +03:00
Julian Bouzas
e14bb5fa2f modules: steal the format_task before returning it
Fixes possible race condition when setting adapter ports format in the callback
of a previous adapter ports format call.
2021-05-19 07:42:18 -04:00
Julian Bouzas
58db9e1fad global-proxy: destroy the global when proxy is destroyed 2021-05-12 14:04:34 -04:00
Julian Bouzas
9cf1f94045 modules: implement WpSiAdapter in si-audio-adapter and si-audio-endpoint 2021-05-12 10:37:15 -04:00
Julian Bouzas
d68636f9b3 si-interfaces: rename WpSiPortInfo to WpSiLinkable 2021-05-11 10:56:44 -04:00
George Kiagiadakis
bc1413e1cd audio-endpoint: configure adapter for null sink with monitor.channel-volumes
This allows the channelVolumes and mute props to affect the output
of the null sink's monitor ports. This way we will be able to use
channelVolumes to track the configured volume of the endpoint
and the monitorVolumes to implement volume ducking.
2021-04-19 11:08:17 +03:00
George Kiagiadakis
6d84295fc5 si-audio-endpoint: give better descriptions to endpoints and their null sinks 2021-04-12 16:05:48 +03:00
Julian Bouzas
5c781db216 m-audio-endpoint: remove target property
Links between endpoints and device nodes are done externally in LUA
2021-04-09 14:19:25 -04:00
Julian Bouzas
cce02fec68 si-audio-endpoint: deactivate node when disabling active feature 2021-04-08 14:07:05 -04:00
Julian Bouzas
d38092a35c m-si-audio-endpoint: fix port configuration and target linking 2021-04-08 14:07:05 -04:00
Julian Bouzas
471f84c735 m-si-audio-endpoint: make target property optional
Allows using the endpoint even if a target is not set.
2021-04-08 14:07:01 -04:00
Julian Bouzas
fb1daa0bf2 modules: use dots instead of dashes for session item properties
Keeps consistency with PipeWire
2021-04-02 11:22:22 -04:00
Julian Bouzas
325522ae51 modules: add si-audio-endpoint session item 2021-03-26 16:16:02 -04:00