Commit graph

499 commits

Author SHA1 Message Date
Wim Taymans
6ee192dff5 hooks: use hook to implement the callbacks
This way we get the version check implemented and save some
code.
2019-05-15 11:19:23 +02:00
Wim Taymans
903cbeb7c1 hook: handle port and factory implementation with hook
This way we can also handle the version number.
2019-05-14 18:08:02 +02:00
Wim Taymans
29164a0f54 link: remove error from method
We return a reason in errno
2019-05-14 12:59:18 +02:00
Wim Taymans
795b14f48b protocol-native: also handle 0 recvmsg as EOF
When recvmsg returns 0, also handle it like an EOF and close to
connection otherwise we keep spinning forever.
2019-05-13 10:10:41 +02:00
Wim Taymans
a2bf4ce96e protocol: add security label to a client
Don't pass the ucred to the client construct, just set the properties
in the protocol.
Use the client properties to get ucred.
Add the security label to the client properties (from SO_PEERSEC)
2019-05-10 13:28:18 +02:00
Wim Taymans
1a7fcaf9c6 Fix cleanup 2019-05-10 11:15:48 +02:00
Wim Taymans
9b1da77bfc node: remove obsolete enabled state
We will create/destroy nodes instead of enabled/disable
2019-04-24 15:39:29 +02:00
Wim Taymans
3b513fa7ae floatmix: remove some unused code 2019-04-23 17:37:46 +02:00
Wim Taymans
8dabd52807 audio-dsp: use audioconvert to get a resampler 2019-04-23 17:37:22 +02:00
Wim Taymans
bb3da2fcc1 remote-node: reuse activation logic in pw_node
Set the received eventfd as the node eventfd and let existing
logic take care of scheduling the node.
2019-04-17 15:23:11 +02:00
Wim Taymans
092a0c660d make bitfields unsigned
Remove driver property from client-node of client-stream.
2019-04-10 17:52:42 +02:00
Wim Taymans
0db5817ed7 client-stream: Don't allow DYNAMIC_DATA
We don't want to use dynamic data for the remote nodes, the buffers
need to keep pointing to the memfd memory.
2019-04-10 16:35:28 +02:00
George Kiagiadakis
40a5063b9f module-link-factory: fix wrong goto label
harmless, but leads to a wrong error message being printed
2019-04-02 23:26:17 +02:00
George Kiagiadakis
7a7a12138f module-access: don't leak the fd in check_cmdline 2019-04-02 23:26:05 +02:00
Wim Taymans
5c896fedd5 connection: stop refill when 0 bytes read 2019-04-02 23:02:58 +02:00
Wim Taymans
e7ef13e310 audioconvert: add avx optimizations 2019-03-28 16:45:57 +01:00
Wim Taymans
5a2ccee1ff Add FASTPATH trace log
Add a trace_fp that can be optimized away when FASTPATH is defined.
2019-03-21 11:31:53 +01:00
Wim Taymans
036ca89c0e audioconvert: mark ports and buffers as DYNAMIC
Only passthrough buffer data when the buffer and ports are
marked as DYNAMIC.
Use extra buffer for nodes that keep a ref on buffers (resample).
2019-03-21 10:45:24 +01:00
Wim Taymans
c2cb74a146 protocol-native: fix indentation 2019-03-20 15:57:34 +01:00
Wim Taymans
70e62aacd7 protocol-native: pass a message around
Pass a message around to make things more extensible later.
Keep fds per message if we ever want to write individual
messages.
Pass number of fds in the message header. We might need this to
close the fds when the proxy is gone.
2019-03-19 16:15:20 +01:00
Wim Taymans
30747942ac connection: add more test 2019-03-19 11:58:46 +01:00
Wim Taymans
a3e4726ea6 connection: add test and fix a bug
Add a unit test for the connection

When we consumed all packets in a buffer, try to get more data instead
of failing right away.
2019-03-19 11:44:23 +01:00
Wim Taymans
ca051282a4 port: add port subscribe_params 2019-03-18 16:34:07 +01:00
Wim Taymans
ae7e60d790 interfaces: add subscribe params method
Add a node subscribe params method that automatically emits the new
params when they change so that we can avoid an enum_params.
Use this in the stream object.

Remove the control messages to update controls in stream, use the
set_param. This is more overhead but allows for notifications to other
clients.

Make it possible to update many controls in one go.
2019-03-18 16:12:27 +01:00
Wim Taymans
9245c81227 client-node: add get_node method
Make a get node method that binds to the server side node of the
client-node immediately. use this in the remote_export and always
return a node proxy.

Use the node proxy to get property updates and signal those in the
stream.
2019-03-15 20:29:34 +01:00
Wim Taymans
33afa18621 client-node: don't make add_listener async
It is not really async, the init is async.
2019-03-15 20:28:42 +01:00
Wim Taymans
1ab00fae6d client-stream: make PropInfo visible 2019-03-15 20:25:21 +01:00
Wim Taymans
3fb9fa06a9 client-stream: emit property change events
Emit a property (param) change event when the volume or mute is
changed on a stream.
2019-03-14 16:40:17 +01:00
Wim Taymans
132dd760ee client-stream: only add link once 2019-03-14 12:28:01 +01:00
Wim Taymans
24117b33c7 control: make control links many to many
Output controls can be linked to many input controls and many input
controls can receive input from many output controls. Keep the control
link information inside the link.
2019-03-14 12:04:20 +01:00
Wim Taymans
1646b13e29 node: improve debug 2019-03-13 16:02:50 +01:00
Wim Taymans
776ed79b86 remote-node: improve some errors 2019-03-12 09:07:33 +01:00
Wim Taymans
743874dd9f client-stream: improve cleanup 2019-03-11 22:07:17 +01:00
Wim Taymans
4d99bf9297 improve some debug 2019-03-11 22:06:58 +01:00
Wim Taymans
d3d7b7e39f client-node: ignore io on the node itself
We only handle the io on the mixer ports, the internal io from the
port to the node is done on the client side.
2019-03-11 16:43:43 +01:00
Wim Taymans
61ad5ee518 fix some small memory leaks 2019-03-11 15:50:52 +01:00
Wim Taymans
3e359646d7 client-stream: first destroy the node
When the client-stream is destroyed, let us first destroy the node
of the stream and then the internal client-node.
2019-03-08 11:55:01 +01:00
Wim Taymans
1d3ce5a9d9 stream: prepare output before signaling ready
Just prepare the output on the port and signal ready. When the graph
completes we will be signaled again to recycle the buffer and
prepare more output if we can.

Improve the bookkeeping a little when activating nodes.

Fix race with moving nodes between drivers.
2019-03-07 23:01:32 +01:00
Wim Taymans
94ce6d528c client-stream: handle driver
When we have a client driver node, it will have prepared the io
areas for us before sending the ready signal. We then need to run
the converters before signaling ready.
2019-03-07 18:37:12 +01:00
Wim Taymans
264383cdd4 remote-node: first run the tee and then signal ready
We first need to run the tee so that all the io areas are ready before
we can start the driver on the daemon.
2019-03-07 18:34:39 +01:00
Wim Taymans
e31f1fcdca remote-node: handle add/remove of activation 2019-03-07 18:34:15 +01:00
Wim Taymans
b357b7a7da scheduling: don't use the graph helpers.
Simplify the scheduling by using simple lists and removing the
subgraphs etc..

Make the driver node trigger all nodes it manages and when they
complete, trigger the driver node to finish the graph.
2019-03-06 20:33:55 +01:00
Wim Taymans
dcbe94c55a port: simplify states
Remove the mix states, we can get rid of them when:

The format is the same for all mixer ports. Set the existing
format on new mixer ports. When the first format is set, the port
becomes READY. When all mixer ports are cleared the port goes back
to CONFIGURE.

Only output ports allocate and manage buffers, input ports share
the buffers of the peer output port on the link.
2019-03-06 09:53:41 +01:00
Wim Taymans
412c7f4cee client-node: send own activation to client for stats 2019-03-06 09:52:40 +01:00
Wim Taymans
5ee287d79b client-node: improve cleanup 2019-03-06 09:52:07 +01:00
Wim Taymans
936dcbea2e remote-node: handle driver nodes 2019-03-04 17:55:43 +01:00
Wim Taymans
f42e214c2d client-node: also send param idss 2019-03-04 17:54:17 +01:00
Wim Taymans
ed988788fd client-node: pass spa_node_info along
Pass the complete spa_node_info to update node information. Remove
the redundant max/min port info.
Update the remote node based on port and node update events.
2019-03-04 12:30:45 +01:00
Wim Taymans
09c4683ef1 interfaces: make events return void
Events are dispatched with hooks and have no return value.

Make it possible to get the last resource and proxy sender value
for where we need it.
2019-03-01 14:04:05 +01:00
Wim Taymans
0390969228 node: make add_listener method
Make struct spa_node_events for events emited from the main thread
and keep the spa_node_callbacks for the data thread callbacks.

The add_listener method installs the events and it's possible to
install multiple handles. Adding a listener first emits the info
and port_info events when installed, similar to how the PipeWire
proxy bind works.

This removes the need for the spa_pending_queue and makes it easier
to implement the _sync versions.

Add some helpers to make it easier for plugins to emit all the info
to new listeners.

Use the listeners for devices as well.
2019-03-01 12:00:42 +01:00