Commit graph

648 commits

Author SHA1 Message Date
Wim Taymans
8ea78c2e3f pw_core -> pw_context
The proxy API is the one that we would like to expose for applications
and the other API is used internally when implementing modules or
factories.

The current pw_core object is really a context for all objects so
name it that way. It also makes it possible to rename pw_core_proxy
to pw_proxy later.
2019-12-10 18:19:56 +01:00
Wim Taymans
8a959ea7a1 core_proxy: prepare to rename pw_remote -> pw_core_proxy
The pw_remote object is really a wrapper around the pw_core_proxy.
The events it emits are also available in the core proxy and are
generally awkward to use.

With some clever new pw_core_proxy_* methods and a pw_core_connect
to create the core_proxy, we can convert all code away from pw_remote.

This is a first step in this conversion, using the pw_remote behind
the scenes. It leaks into some places because it really needs to become
its own struct in a next step.
2019-12-06 11:48:40 +01:00
Wim Taymans
c9a54112e4 client-node: use bound id from the proxy
Remove the obsolete node_id from the transport. We get this info
now from the proxy.
2019-11-29 13:34:06 +01:00
Wim Taymans
a1801b690f jack: use explicit variable to keep track of transport 2019-11-29 13:34:06 +01:00
Wim Taymans
e40fbf8cc4 Add printf checks for proxy_error and resource_error
Add an error variant without checks.
2019-11-21 16:09:05 +01:00
Wim Taymans
40e837555d jack: improve port sort order
Sort by object path before attepting by id.
2019-11-21 09:33:16 +01:00
Wim Taymans
cd1ec41253 jack: use metadata when available 2019-11-05 10:03:35 +01:00
Arun Raghavan
863a642e08 Merge pipewire-jack subtree 2019-11-03 15:20:56 +01:00
Arun Raghavan
59bdab94bc Drop git submodule structure
The workflow is getting a little messy with these, so we're just going
to merge those repositories in.
2019-11-03 15:19:43 +01:00
Wim Taymans
612bfe9a64 jack: update 2019-11-03 10:41:26 +01:00
Wim Taymans
b179b11e66 jack: update 2019-10-29 12:03:57 +01:00
Wim Taymans
2728babc85 jack: sync 2019-10-28 18:05:37 +01:00
Wim Taymans
96ff726666 jack: update 2019-10-28 15:04:18 +01:00
Wim Taymans
4f5a5fc917 vulkan: tag port as video DSP port 2019-10-28 13:20:42 +01:00
Wim Taymans
aab72a70e6 submodule update 2019-10-24 11:05:49 +02:00
Wim Taymans
eb1d675cb0 node: add master priority
Change node.priority to priority.session to indicate that this
is the priority that the session manager uses to select the node.

Add another priority.master that the core uses to select a master
driver. Keep the driver nodes sorted by master priority.

Let jack always prefer to connect to the master driver nodes.
2019-10-22 12:25:25 +02:00
Wim Taymans
3aa19dd38a node: send Suspend to the node
Send suspend to the node when suspending. This is usually the same
as puse for all nodes.
Implement negotiation when we Start audioadapter. This makes it
easier that to track the ports that are negotiated for now.
Use Suspend to clear the audioadapter negotiation.
2019-10-21 17:24:51 +02:00
Wim Taymans
6e0ffb0c47 flags: change flag macros
SPA_FLAG_CHECK -> SPA_FLAG_IS_SET
SPA_FLAG_UNSET -> SPA_FLAG_CLEAR
Add SPA_FLAG_UPDATE
2019-10-02 18:00:42 +02:00
Wim Taymans
f539b42a03 alsa: improve midi
Add some debug
Ignore ports without buffers.
2019-09-26 11:57:25 +02:00
Wim Taymans
db341a6450 improve properties on node and port
Rename some alsa filenames.
2019-09-23 20:51:34 +02:00
Wim Taymans
ab0d1b7fad alsa: cleanups
Avoid getting the clock time just for debug.
Improve time at startup.
2019-09-19 16:55:02 +02:00
Wim Taymans
322ccb452c small cleanups 2019-09-19 13:17:30 +02:00
Wim Taymans
49a5e97d69 format: add application/control media type
Add a new application/control media type that can be used to negotiate
control streams between ports.
2019-09-16 21:09:52 +02:00
Wim Taymans
8b85cc225e rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA
It is more generic and works with control-only ports as well
2019-09-16 12:55:23 +02:00
Wim Taymans
d648ea4ad3 control: don't fail on async port_set_io 2019-09-10 18:50:28 +02:00
Wim Taymans
80ba0b2dcf node: only put async state changes to work queue 2019-09-10 12:13:26 +02:00
Wim Taymans
3142d3b979 mem: add private mapping flag 2019-09-10 09:59:31 +02:00
Wim Taymans
9c9bff8fe9 data-loop: add _wait function
Add function to wait for one iteration of the loop. This can be used
by specialized implementations of the data loop, like jack.
2019-09-09 17:17:03 +02:00
Wim Taymans
4a4fa57efc alsa: handle target better
Rework how we handle the current device fill level and our desired
fill level so that we handle it more consistently.
2019-09-05 13:45:37 +02:00
Wim Taymans
73628c91de audioconvert: refuse invalid channels and rate 2019-09-03 13:49:38 +02:00
Wim Taymans
6341469456 jack: update 2019-09-02 17:19:00 +02:00
Wim Taymans
faaf84286b node: improve position and transport
Reorganize some things, let the clients update the segment info
in their own activation, then let the server merge it. This avoids
clients stepping on eachother. When looping through the clients,
copy the segment info when we encounter its owner.

Remove the list of segment owners to the activation. This is better
than in the activation because we can then just keep one list of
owners.

Remove the NONBLOCK flag from the eventfd so that we can do blocking
reads as well.

Just keep a reposition owner in the driver activation. This points
to the node that has the reposition info. This avoid complicated
synchronization to keep multiple nodes from stepping on eachother.
Now they can just prepare the reposition info in their activation and
set themselves as the reposition owner. The last one who succeeds
wins.
2019-09-02 12:05:05 +02:00
Wim Taymans
0f9594e119 node: add suport for quantum updates
When the node latency property is changed, trigger a graph recalc
to set the new quantum if needed.

Also update the driver quantum when unassigned nodes are assigned
to a driver.
2019-08-30 17:00:26 +02:00
Wim Taymans
aaa6821052 jack: update 2019-08-30 15:41:49 +02:00
Wim Taymans
fc770a5fbb jack: update 2019-08-30 15:30:49 +02:00
Wim Taymans
8afa5b0ada node: move segment owner into the io area
This makes it easier to keep track of who is responsible for what.
Also remove the valid fields and move them to flags in the segment
info. That way, the owner can update the flags without having to
worry about concurrency.

Keep separate info for the reposition information. We need to do this
to make it possible to seek in other formats than the frame.

Clear out the owner field when the node is destroyed or removed from
the driver.
2019-08-29 18:24:09 +02:00
Wim Taymans
a910deb0fc pipewire: set default log level to WARNING 2019-08-29 15:34:36 +02:00
Wim Taymans
35c5cf9b52 node: improve sync
Place the requested sync and position update flag in the node
activation. This way we can use our existing loop to update the node
sync states and check if the node is ready.

Implement sync timeout, when the client can't start or seek within the
timeout, we start RUNNING anyway and hope the client catches up.
2019-08-29 14:01:48 +02:00
Wim Taymans
84405dae2a node: add fields to support sync
Sync is enabled when clients need time to move to a new location.
It's a bit like GStreamer preroll after a seek. Clients that need
time, increment the sync_total. Whenever a seek is done, the server
waits in the Starting state until the sync_pending is 0 (or timeout
later).

Improve atomic operations
2019-08-28 13:56:23 +02:00
Wim Taymans
0a15e1f804 io: add offset for clock times
Add an offset to apply to the clock time before we can compare to the
segment values. This way we can keep the segment start independent of the
clock values and we only need to adjust the offset when paused. It's
like the base_time in GStreamer to calculate the running time.
2019-08-28 10:28:06 +02:00
Wim Taymans
2805713da3 io: rename some segment variables
Also initalize a default segment in the node.
2019-08-27 21:49:49 +02:00
Wim Taymans
7c865f5db0 io: add support for segment
Move fields from the io_position to io_segment. The segment contains
the mapping between raw clock time and stream time in various
formats. We keep an array of pending segments available in the
io_position field so clients can anticipate changes.

Make looping a flag in the segment instead of a state.

Prepare for segment masters. These will be registered clients that
are responsible for updating parts of the extended segment info.

Add namespace to some defines.
2019-08-27 21:36:15 +02:00
Wim Taymans
b356c83d32 node: add support for transport
Move some things around. Move the duration of the current cycle
to the clock. Also add the estimated next timeout to the clock.
Add a generic media specific counter to the clock.

Clean up the position_bar info. We can do with only a double beat
value and make the signature in floats.

Flesh out the io_position info. This has now the information needed
to convert a raw clock time into a stream time. It basically has
the same kind of features as GStreamer segments such as looping,
variable rate playback etc.. It also contains the state of the
timeline (paused/playing) and it can be used to update the position
and state from clients.

There is also extended information in the position field that
clients can update when they can.

Plugins basically only update the clock info they get (and use
the position info to check if they are slaved or not).

Before each cycle, check if there is a pending position update and
apply it.
2019-08-27 14:41:47 +02:00
Wim Taymans
8f01dd4c75 node: improve debug 2019-08-22 18:02:15 +02:00
Wim Taymans
93fbe121d0 node: tweak CPU load values
JACK uses a CPU calculation with an exponential moving average
with degree of 1/2.
2019-08-22 14:06:59 +02:00
Wim Taymans
6ad4adc194 node: add xrun callback
Let alsa emit xrun callbacks.
Write the xrun stats to the activation area of the node so all
clients can read it.
2019-08-22 13:25:38 +02:00
Wim Taymans
c9e177827b node: calculate cpu time 2019-08-22 10:59:53 +02:00
Wim Taymans
1a4713ee3a jack: update 2019-08-21 20:37:36 +02:00
Wim Taymans
f8d5b3947a jack: update 2019-08-21 18:37:57 +02:00
Wim Taymans
8db4a797aa core: remove parent_id from the global event
Remove the parent_id from the global event. Remove the parent
and owner from the global object.

Use properties instead to mark parents and owners of objects.

Properties are easier to control for client exported objects and
usually a simple parent/child is not enough. For example, a client
exported node has the client as a parent but also the factory that
created the node.
2019-08-16 22:11:42 +02:00