Commit graph

648 commits

Author SHA1 Message Date
Wim Taymans
c6a7b3eedb channelmix: implement per channel volume
Implement per channel volume on channelmix. Extend control on stream to
take an array of values when possible.

Remove name argument from pw_node_new and pw_device_new. We can pass
this as a property instead.

Improve properties on nodes to more closely match what pulseaudio does.
Don't let the monitor do too much with the udev properties but let the
session manager set the description and icon-names.

Remove some change_mask flags for things that don't change in
introspect. Use the flags to mark changes in -cli and -monitor.
2019-08-12 15:14:39 +02:00
Wim Taymans
a42c517682 improve debug 2019-08-08 11:03:13 +02:00
Wim Taymans
447d1f94bf jack: update 2019-08-07 12:59:46 +02:00
Wim Taymans
f1ea49d6e9 mem: add size of tag to make it possible to check subtags 2019-08-01 13:55:03 +02:00
Wim Taymans
8590ac158b node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this
because of the IO params and buffer params.

Add flags to the port_use_buffer call. We also want this call to
replace port_alloc_buffer. Together with a new result event we can
ask the node to (a)synchronously fill up the buffer data for us. This
is part of a plan to let remote nodes provide buffer data.
2019-07-25 13:19:39 +02:00
Wim Taymans
18776b155b mem: Add tag to memmap
Add a tag field when creating a memmap so that we can do lookup on it.
This makes it easier to implement the tracking of mappings for io areas.
Remove custom io memory tracking and use the tags.

Add flags to spa_chunk to make data corrupted. The flags on the buffer
stay constant for the life of the buffer. Add flags to mark memory
readable and writable. Mark memory readonly in v4l2-source.

Pass the daemon activation area to the client in the transport event.
This never changes and need to be handled differently from the other
activation areas.

Use the right flags when importing memory.

Add the (desired) memory type to mempool_alloc.

improve some debug.
2019-07-25 12:10:05 +02:00
Wim Taymans
2caf81c97c mem: improve memory handling
Add a memory pool to manage blocks of memory. Make it possible
to allocate and import blocks.

Add add_mem and remove_mem to the core events to signal a client
of a block of memory. Remove the client-node add_mem.

Make a global pool for memory and a per client pool where we
import and share the memory we need with the client.

Use the new memory pool to track and map memory in clients.
2019-07-23 17:46:43 +02:00
Wim Taymans
497a8364c5 printf format fixes 2019-06-07 17:16:02 +02:00
Wim Taymans
db88e9f954 System: More work on making system functions pluggable
Move the epoll functions to the system functions and make the loop
use those. Use simple mask for events instead of enum.
Add the used system api in pw_loop.
Add System API to spa_support and use it where possible.
Pass the system API used in the realtime loops in spa_support as
well and use this in the realtime paths.
Improve bootstrapping, load only the log and cpu interfaces because
those can/need to be shared between instances. Let the core load
the other interfaces.
Add keys to configure the System and Loop implementations used in
pw_loop.
2019-06-06 15:31:53 +02:00
Wim Taymans
3ad73f0532 keys: add keys.h with defines and docs
Add a keys.h file that lists and documents all keys available to
be used in properties.
2019-05-24 15:47:48 +02:00
Wim Taymans
ff946e3d4b interface: add an interface struct
The interface struct has the type,version and methods of the
interface.
Make spa interfaces extend from spa_interface and make a
separate structure for the methods.
Pass a generic void* as the first argument of methods, like
we don in PipeWire.
Bundle the methods + implementation in a versioned inteface
and use that to invoke methods. This way we can do version
checks on the methods.
Make resource and proxy interfaces that we can can call. We
can then make the core interfaces independent on proxy/resource and
hide them in the lower layers.
Add add_listener method to methods of core interfaces, just
like SPA.
2019-05-23 12:59:24 +02:00
Wim Taymans
58fa5561b8 interface: get_registry always returns a Registry type 2019-05-21 15:46:31 +02:00
Wim Taymans
9ec3e3ab6d private: set min quantum to 32
Going as low as 32 is possible now with the better clock rate
estimation.
2019-04-25 13:04:44 +02:00
Wim Taymans
dcddd5080b submodule update 2019-04-23 17:42:55 +02:00
Wim Taymans
45e2219149 update submodule 2019-04-11 16:39:08 +02:00
Wim Taymans
964be84e1c list: check for empty list before insert
We can't insert an empty list.
2019-03-08 11:34:28 +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
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
499dd3ff22 node: add port and node params
Add a new struct spa_param_info that lists the available params on
a node/port and if they are readable/writable/updated. We can use
this to replace and improve the PARAM_List and also to notify
property change and updates.

Update elements and code to deal with this new param stuff. Add
port and node info to most elements and signal changes.

Use async enum_params in -inspect and use the param info to know
which ones to enumerate.

Use the port info to know what parameters to update in the
remote-node.
2019-02-27 16:43:01 +01:00
Wim Taymans
245a0d5634 global: pass bind function to _new
Make the bind function a callback instead of an event. We can then
get a return value and use that to clean up the pending proxy and
generate an error.
2019-02-25 17:16:40 +01:00
Wim Taymans
d2c18c7b1a Improve async handling
Don't use special callback in node to receive the results. Instead,
use a generic result callback to receive the result. This makes things
a bit more symetric and generic again because then you can choose how
to match the result to the request and you have a generic way to handle
both the sync and async case. We can then also remove the wait method.
This also makes the remote interface and spa interface to objects very
similar.

Make a helper object to receive and dispatch results. Use this in the
helper for enum_params.

Make device use the same result callbacks.
2019-02-25 12:29:57 +01:00
Wim Taymans
7b12212eeb node: improve async handling
Remove the done and error callbacks. The error callback is in an
error message. The done callback is replace with spa_pending.

Make enum_params take a callback and data for the results. This allows
us to push the results one after another to the app and avoids ownership
issues of the passed data. We can then extend this to handle the async
case by doing a _wait call with a spa_pending+callback+data that will
be called when the _enum_params returns and async result.
Add a sync method.

All methods can now return SPA_RESULT_IS_ASYNC return values and you
can use spa_node_wait() to register a callback when they complete
with optional extra parameters. This makes it easier to sync and
handle the reply.

Make helper methods to simulate the sync enum_params behaviour for
sync nodes.

Let the transport generate the sequence number for pw_resource_sync()
and pw_proxy_sync(). That way we don't need to keep track of numbers
ourselves and we can match the reply to the request easily.
2019-02-21 09:40:12 +01:00
Wim Taymans
eea062ee53 interfaces: improve remote API
Add return values to events and method callbacks. This makes it
possible to pass any error or async return value.
Add sync/done/error in both directions so that both proxy and resource
and perform/reply sync and produce errors.
Return a SPA_ASYNC from remote method calls (and events), keep the
sequence number in the connection.
With the core sync/done we can remove the client-node done method and
it's internal sequence number along with the seq number in method calls.
We can also use the method/event async return value to perform a sync
with as the unique sequence number for this method.
Add sync method and done/error event to proxy and resource.
2019-02-18 12:31:36 +01:00
Wim Taymans
e9bedae5fa node: add max_ports to node info 2019-02-14 17:40:01 +01:00
Wim Taymans
61276da87e submodule update 2019-02-13 12:46:53 +01:00
Wim Taymans
5de7898808 node: implement activation
Make an eventfd for each node and listen for events when the node
is activated.
Reorganize some graphs links to make it possible to activiate nodes
by signaling the eventfd
Pass the peer node to each remote node and let the remote node
directly activate the peer when needed.
Let each node signal the driver node when finished.
With this we don't need to go through the daemon to schedule the
graph, nodes will simply activate eachother. We only go to the
server when there is a server node to schedule.
Keep stats about the state of each node and the time it was
triggered, running and finished.
2019-02-12 17:42:33 +01:00
Wim Taymans
658c1da52f node: allocate shared mem for activation
Allocate a per node a piece of shared memory where we place the
activation structure with the graph state and io_position.
We can then give this info to nodes so that they can get the position
in the graph directly but also later, activate the next node in
the graph.
2019-02-07 12:34:54 +01:00
Wim Taymans
569cbb48a9 use SPA_EXPORT to export symbols 2019-02-06 13:24:41 +01:00
Wim Taymans
11769aa7e7 media-session: track our DSP link
Set our DSP link proxy to NULL when it gets destroyed so that we
don't accidentally try to do things with it anymore.
2019-01-29 10:29:06 +01:00
Wim Taymans
13bf70a8dd mem: align memory to requested alignment
Improve the allocators to always align the buffer memory to the
requested alignment
Use aligned read and writes for sse functions and check alignment,
optionally falling back to unaligned path.
Add more tests and benchmark cases
Check and warn for misaligned memory in plugins.
2019-01-24 18:28:52 +01:00
Wim Taymans
351fb9ce29 pod: improve parser and builder
Remove the spa_pod_iter helpers
Remove builder/parser vararg recurse option, you have to
manually recurse into structures when needed. This simplifies
things a lot.
Pass spa_pod_frames to builder and parser explicitly, we don't
have to keep an internal stack anymore.
The parser is now almost a mirror image of the builder.
Make the parser safer when iterating over objects, add functions
to check and get pod contents in a safe way.
Make the builder return errno style results on errors
Improve performance of object properties when they are stored and
retrieved in the same order.
Add many more tests for the builder and parser
Add some benchmarks
2019-01-22 17:38:23 +01:00
Wim Taymans
5376832676 builder: control_header -> control 2019-01-17 17:11:58 +01:00
Wim Taymans
80cfda89c1 pod: improve the vararg pod builder and parser
Automatically parse and build key/value when in objects without having
to prefix the key with ":"
Automatically build control/value when in sequence without the "."
prefix.
Remove the builder with key/pod, taking a reference to the stack built
temporary pods is not allowed in c++. We can use the varargs version
with the same convenient syntax.
Remove the parser "*" option, it is unused.
Improve spa_pod_builder_add_* and spa_pod_parser_get_* and make them
look similar.
2019-01-16 11:05:12 +01:00
Wim Taymans
66bab1d9b2 remote: remove some events
Remove some events from the remote that we can find on the core_proxy.
Use the core_proxy to get to the done and info events.
Remove pw_remote_get_core_info(), we don't need this anymore now that
we don't listen for the event and the user can keep track of this
herself.
2019-01-10 10:08:14 +01:00
Wim Taymans
1ed27a8f2b add _GNU_SOURCE as compiler flag 2019-01-08 17:36:58 +01:00
Wim Taymans
979d155382 core: add user_data to core 2019-01-08 17:32:37 +01:00
Wim Taymans
5b7ddb0105 buffer: remove buffer id
The buffer id is not needed/used, we use the index of the buffer in the
buffer array when configuring the port.
2019-01-07 17:57:03 +01:00
Wim Taymans
e918f9f77c fix sign confusion 2019-01-07 15:52:42 +01:00
Wim Taymans
97f7ad31a4 submodule update 2018-12-11 16:38:07 +01:00
Wim Taymans
f063cc9086 audioconvert: improve negotiation
Configure format and buffers when the ports are configured instead of
in the start command.
2018-11-19 10:03:55 +01:00
Wim Taymans
8d9aae061b submodules 2018-11-07 09:59:11 +01:00
Wim Taymans
57d9f597d9 jack: update submodule 2018-10-29 14:30:44 +00:00
Wim Taymans
06fe3af7fb update submodules 2018-10-24 10:35:41 +02:00
Wim Taymans
0395897856 node: only run the graph when we are the selected driver
Update submodules
2018-10-23 16:52:28 +02:00
Wim Taymans
9479a00871 update submodules 2018-10-10 18:50:49 +02:00
Wim Taymans
78444aba4e uninstalled: update uninstalled 2018-10-10 18:04:28 +02:00
Tapasweni Pathak
8d71d2dab8 pipewire: add enable/disable to meson for spa plugins 2018-10-10 16:01:28 +02:00