Commit graph

308 commits

Author SHA1 Message Date
Wim Taymans
f599120433 mix: keep track of mix id 2018-04-03 16:29:36 +02:00
Wim Taymans
6eea9247ea graph: add new scheduler
Move the activation state to the graph
Replace an old scheduler with a new one that works with the new
activation states.
Remove the DISABLED port flags, we explicitly add and remove to
make ports enabled/disabled.
Find first compatible port for link
Remove the node based scheduler and use the spa one.
2018-04-03 16:29:36 +02:00
Wim Taymans
b6239fb1ab node: improve scheduling
Don't use the graph scheduler anymore, instead use a more simple
method using the nodes directly. The idea is that when a node
pulls, we walk the graph backwards and collect nodes to process.
Searching stops on a node with output. Then we process the nodes,
each one in turn calling process on the next one when all dependend
nodes are processed. This is quite similar to jack2 and with some
modifications seems to work well for more complicated input/output
patterns.
Set per mix input/output buffers.
Implement mixing in the audio-dsp node.
remote: handle mix ports a little better
2018-04-03 16:29:36 +02:00
Wim Taymans
2ea9addcf2 port: delegate initialization of mix ports to port 2018-04-03 16:29:36 +02:00
Wim Taymans
4f680c224b make per mix port io and buffers
Move the io areas to a separate memory block.
Make per link io areas for the ports
Send per mix port io area and buffers
2018-04-03 16:29:36 +02:00
Wim Taymans
1b2e73de0c node: export method to update ports 2018-03-14 15:55:35 +01:00
Wim Taymans
6cb35bf23e link: remove unused field 2018-03-14 15:14:30 +01:00
Wim Taymans
53ee07c901 link: generate unique mix ids
Generate a per link id for the mixer input of the ports.
2018-03-01 09:30:42 +01:00
Wim Taymans
1ecf982504 link: improve allocation
Always move the allocated buffers to the output port and reuse them
from there if possible.
2018-02-27 12:51:25 +01:00
Wim Taymans
28779b8e25 port: move mix_node to private.h
This will make it easier to override the implementation later
2018-02-26 17:20:27 +01:00
Wim Taymans
13fcaf74e6 link: improve allocation
Make a structure to track allocation of buffers on ports.
Handle more allocation failures.
Update port status immediately when clearing format
2018-02-26 17:05:30 +01:00
Wim Taymans
58667d6ced params: make method on node and port to enum params
Do not pass the params of the node in the node_info, instead,
make a method to enumerate the params. This makes it possible for
clients to only enumerate what they need and when they need it.
Improve introspection of a port, add the name and properties.
Add an enum_param method on the port that can be used to enumerate
port formats.
Change -monitor and -cli and add support for enum_params on the node
and port.
2018-02-20 10:31:55 +01:00
Wim Taymans
5034770eae node: unlink ports before destroy
First unlink the ports, then destroy them. This is a more natural
way of cleaning up.
Make sure we destroy the node after destroying the ports.
Destroy the port after destroying its controls
Destroy resources after destroying the global
2018-02-16 12:04:33 +01:00
Wim Taymans
8c4bb3a104 factory: improve registration 2018-02-16 12:01:18 +01:00
Wim Taymans
6c000229f0 port: add port globals
Expose all ports as globals, linking is then done by specifying
the global id of the ports.
Add method to destroy objects. not much security on this one but
yet but it should allow priviledged clients to kill connections
and other clients etc.
Make events on the global object. Implement the bind with the event,
handle destroy of the globals.
Add link properties
Use append to preserve the order.
2018-02-15 17:49:04 +01:00
Wim Taymans
8a4f3c546d port: remove port_pause
port_pause is not needed, spa elements should pause themselves when
setting NULL format or buffers.
Handle use_buffer or alloc_buffer error cases.
Clear buffers in the port before cleaning up the memory.
2018-02-13 10:22:30 +01:00
Wim Taymans
2fe6a8245d control: keep track of prop_id
Keep track of the property id which describes the property
functionality.
Link controls based on the property instead of the param_id.
2018-02-07 17:56:35 +01:00
Wim Taymans
f9237eb0db control: keep track of linked controls
Keep track of what controls are linked together.
Clean up links on destroy.
Implement unlink, reset io area.
Add events for control link/unlink
2018-02-07 11:52:55 +01:00
Wim Taymans
bd1fea49c2 node: add enabled state
Add method to enable/disable a node. Disabled nodes will SUSPEND and not
be available for automatic connections, it is intented for handling
the monitor node state.
2018-01-30 15:05:23 +01:00
maxice8
1e411bfe09 pipewire/private.h: add missing sys/types.h for pthread_t 2018-01-27 07:40:04 +01:00
Wim Taymans
f115646bcd core: remove permission callback
Remove the core permission check callback. We can now use the per
client permission configuration.
Rework the flatpak module to use the permissions. When a client
connects, do the portal call and iterate all globals, updating the
permissions. Also update the permissions of newly added globals.
The client is owner of itself.
2018-01-24 16:17:13 +01:00
Wim Taymans
ff17fb68b5 permissions: use current_client for security checks
Don't pass around the client object but keep track of the current
client in the core object. This way we don't need to add a client
argument to functions and can check security when needed.
2018-01-24 12:04:32 +01:00
Wim Taymans
ab099d09dd permissions: check permissions more
Pass client to some core functions to make it possible to check
permissions when iterating globals.
Check permissions of factory before using it.
Check permissions in link factory, only allow linking of nodes we can
see.
Check permissions in the autolink module, only try to link to nodes
we can see.
Make client permissions update behave like an atomic update of an
unordered set of permissions, which is perhaps a bit more intuitive.
2018-01-24 10:42:40 +01:00
Wim Taymans
c593d868fb global: add properties
Add properties to global objects to make it easier to select what
nodes and objects to bind too. They can also be used to implement
permissions on the globals based on properties.
Add more error handling in _register.
Make more functions return a result code.
Make a separate pw_module_register, like all other objects.
2018-01-19 11:27:54 +01:00
Wim Taymans
f7b6fea43d Add dbus support interface
Add an interface that can manager a dbus connection.
Make a dbus interface in the core that can create connections running
in the core main loop. Keep this as support for spa plugins.
2017-12-18 12:41:47 +01:00
Wim Taymans
4d6ac37398 Use int instead of bool as result
Prefer to use an int return from a function instead of bool because
it can contain more info about failures.
2017-12-18 11:38:30 +01:00
Wim Taymans
d5643e8472 core: add permissions call
Add a permissions call that can be used to update the permissions
of global objects. This can be used to set specific permissions
on certain objects, hide objects and define the permissions on new
objects. The system is quite generic so that we can extend it later
with more complicated match rules or so.
2017-12-14 18:37:05 +01:00
Wim Taymans
a8cbffac7f core: get page size 2017-12-01 12:41:48 +01:00
Wim Taymans
541553be1c control: add control objects
Add control objects for all controllable properties on ports.
Try to link compatible control properties in autolink.
Allocate shared memory for the output property memory and configure
the io area on the ports when the controls are linked.
Send the shared memfd to clients when the io area is configured.
Add port_set_io support in remote.c, mmap the control io area and
set on the port.
Add some param helpers
Add volume control to export-source update the volume before
sending each buffer.
2017-11-30 16:36:29 +01:00
Wim Taymans
91a3670610 node: make port for_each more powerful
Make an int return from pw_node_for_each_port() so that we can return
errors or early exit.
Add pw_port_for_each_param() to iterate params. And use this to collect
the formats.
2017-11-29 16:58:17 +01:00
Wim Taymans
140c3959ab meta: remove shared meta data
Make a method to find the memory block for the given ptr. We can
use this to find the memfd of the memory if there is any. We can
then remove the Shared metadata on buffers.
2017-11-28 18:30:29 +01:00
Wim Taymans
8efea3e1ea node: Add id to set_io
Make it possible to configure multiple io areas on a port by giving
an id to set_io.
Add some types to enumerate the supported ids
Make an area to exchange buffers and one to specify pull ranges.
The idea is to make more area types for controlable properties.
Implement enumeration of IO areas in volume.
2017-11-21 19:38:48 +01:00
Wim Taymans
c78fe6a353 port: work on port commands 2017-11-14 15:44:48 +01:00
Wim Taymans
157a8b6ddf factory: add events
Add events to the factory and use the destroy event to clean up.
2017-11-14 10:59:10 +01:00
Wim Taymans
440f681f4b Improve enum_param
Add an argument to pass the result param to the caller instead of
having the caller have to pick it up from the builder.
Improve docs for node, clock and monitor
Pass spa_pod everywhere instead of spa_pod_object.
Pass result argument to spa_pod_filter to make things a little
nicer.
2017-11-13 17:57:38 +01:00
Wim Taymans
caaeaff223 Reorganise SPA tree
Reorganise the SPA includes to make it more extensible later
Simplify the naming of the buffer and meta params
2017-11-10 13:36:14 +01:00
Wim Taymans
f3bca48398 Unify props, params and formats
Make enum_params and set_param to configure properties, format
and other parameters. This allows us to remove some duplicate
code and make the properties and parameters much more extensible.
Use the object id to mark the id of the parameter.
Remove the spa_format and spa_props.
We can now make the client-node easier by merging the various
format methods into the params.
Make the stream API more powerful now that we can pass params
around.
2017-11-07 17:48:40 +01:00
Wim Taymans
65a8bc8b34 graph: improve debug 2017-10-18 10:03:55 +02:00
Wim Taymans
93a52f4837 Simplify node activation
Don't directly expose the state change methods. Only expose an activate
method for nodes that indicates if the node should be scheduled or not.
Let the link automatically negotiate two active nodes.
Make some defines for properties.
Use link property to make passive links. Passive links don't activate
the nodes.
Make sure the mainloop quits when quit is called before run.
2017-09-18 20:42:55 +02:00
Wim Taymans
f64c28c091 Cleanups
Make separate _register function so that we can first configure the
object before making it publicly visible.
2017-09-18 11:54:25 +02:00
Wim Taymans
67d4dd8656 factory: add introspection 2017-09-18 09:35:00 +02:00
Wim Taymans
7f20e04803 node_factory -> factory
Rename the node-factory to a more generic object factory.
Add type and version to create objects from a factory
Start on factory introspection
2017-09-17 16:47:03 +02:00
Wim Taymans
4bef583b75 command: clean up a little 2017-09-15 14:54:52 +02:00
Wim Taymans
8a45fd4f31 remote: add user data 2017-09-15 14:51:39 +02:00
Wim Taymans
c72d797dde Fix crash on shutdown
Sometimes we insert NULL into the client object map to mark the object
freed. Now that the map also returns those NULL's, don't try to free
them.
Small cleanups
Make some port methods private.
2017-09-11 09:48:13 +02:00
Wim Taymans
21cd5a2918 Add example to play sine wave
Various build fixes and cleanups
Move port_add to private and make node ports based on implementation.
Improve pull based scheduling on remote nodes
2017-09-07 10:22:32 +02:00
Wim Taymans
36ac8a6545 update docs 2017-09-05 13:35:25 +02:00
Wim Taymans
28ae844de9 node: always use a spa_node as the implementation
Avoid duplicating API, remove implementations from port and node and
always use an spa_node as the implementation, it's just as easy to
implement a spa node. With the implementation always being a spa_node
we will be able to better implement the negotiation of the mixers.
2017-08-25 19:02:27 +02:00
Wim Taymans
b7b80683bc jack: work on mixing 2017-08-25 10:01:04 +02:00
Wim Taymans
c25834a692 Work on cleanup
Add signal handlers for daemon to shut down
Add destroy listeners for modules and do cleanup
Fix some leaks
Simplify port registration in new nodes
Hide some more data structures
Let the node implementation take care of the reuse_buffer signal because
then we can get to the graph nodes to find the destination port.
Destroy modules in core cleanup. Modules should undo everything they
have done.
Activate the link after we negotiated format and buffers.
2017-08-22 18:30:10 +02:00