Commit graph

2398 commits

Author SHA1 Message Date
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
f36daaedea node: add flag to always assign a driver to a node
Add flag to always assign a node to a driver. This makes sure that
even when the node is not linked to anything, it will still be
scheduled by an active driver. This is needed for JACK support.
2019-08-27 14:39:04 +02:00
Wim Taymans
bc88e1cbf8 stream: add SEQ_READ/SEQ_WRITE macros 2019-08-27 14:36:03 +02:00
Wim Taymans
ae457625d3 client-node: also don't remove our own activation
.. because we don't add it.
2019-08-22 18:14:57 +02:00
Wim Taymans
8f01dd4c75 node: improve debug 2019-08-22 18:02:15 +02:00
Wim Taymans
f86ca63597 client-node: refuse params on the wrong side of our mixers 2019-08-22 18:00:55 +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
570575f052 pod: cleanup event and command init 2019-08-22 12:47:27 +02:00
Wim Taymans
c9e177827b node: calculate cpu time 2019-08-22 10:59:53 +02:00
Julian Bouzas
3a43fac0c2 sco-sink: fix several timeout issues 2019-08-22 00:07:04 +02:00
Wim Taymans
1a4713ee3a jack: update 2019-08-21 20:37:36 +02:00
Wim Taymans
9351b14bf4 remote-node: avoid map and unmap for our own node 2019-08-21 20:35:28 +02:00
Wim Taymans
8ed3cfe679 audioconvert: be more careful when clearing buffers
clean_convert() removes the internally negotiated formats but
it does not set the format (or buffers) of the externally visible
ports. Therefore, don't clear the buffers_set flags.

Instead, clear the buffers_set flag when we explicitly reconfigure
the ports, when we also clear the format.

Also clear the port buffers when we set a NULL format.

Fixes #178
2019-08-21 19:52:53 +02:00
Wim Taymans
f8d5b3947a jack: update 2019-08-21 18:37:57 +02:00
Wim Taymans
f746c29768 jack: more improvements
Fill in the position and clock fields with jack values.
Advertize PARAMS correctly.
2019-08-21 15:20:57 +02:00
Wim Taymans
6f5e6568c9 node: warn when we can't set position on a driver 2019-08-21 15:16:59 +02:00
Wim Taymans
dd69b1dd7d alsa: advertize node params correctly 2019-08-21 13:05:52 +02:00
Wim Taymans
5b9869200f jack: add jack source and sink
Makes a device with a source and sink that automatically
proxies all physical ports from jack. Jack then drives our
PipeWire pipeline from its own thread.
2019-08-20 20:35:41 +02:00
Wim Taymans
d00c641559 protocol: we need to read Fd into int64_t 2019-08-20 10:51:58 +02:00
Julian Bouzas
4b202b9656 a2dp-sink: fix infinite loop when buffer could not be encoded 2019-08-20 00:22:40 +02:00
Wim Taymans
4f31ca5383 vulkan: only send out buffers when ready
Keep track of the buffer that is rendering and when it finishes,
move it to the ready queue.
2019-08-19 18:16:32 +02:00
Wim Taymans
38169ec5db vulkan: update some properties 2019-08-19 16:47:02 +02:00
Wim Taymans
97b3c6d1d5 travis: disable vulkan option 2019-08-19 16:39:24 +02:00
George Kiagiadakis
0af5e981e0 pipewire-cli: add interface filter in the list-objects command
so that you can now write, for example, "list-objects Node"
and see only the nodes, instead of seeing all the objects, which
can be hundreds...
2019-08-19 16:35:13 +02:00
George Kiagiadakis
f1d60d6009 protocol-native: downgrade getsockopt SO_PEERSEC error to warning
Getting SO_PEERSEC on distributions that do not use a LSM by default,
results always in a "protocol error", which is just annoying and not
a real problem for pipewire's operation.
2019-08-19 16:34:18 +02:00
Wim Taymans
9799b0e679 vulkan: add vulkan compute source
Add a source that runs a compute shader and exports the GPU buffer
as a DmaBuf to the clients.
2019-08-19 16:32:22 +02:00
Wim Taymans
edbd9eb077 video: add support for RGBA with 16 and 32 bit float 2019-08-19 16:22:12 +02:00
Wim Taymans
09eb121099 videotestsrc: fix format description 2019-08-19 16:21:11 +02:00
Wim Taymans
d9050fcb72 connection: use right size 2019-08-16 22:57:24 +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
Wim Taymans
32ce5c4deb properties: add function to copy list of keys 2019-08-16 21:54:49 +02:00
Wim Taymans
774e11bc10 keys: rename device.id to device.bus-id 2019-08-16 21:52:32 +02:00
Wim Taymans
9807e7fdab pulse: sync 2019-08-16 15:23:35 +02:00
Wim Taymans
84ec90da2d proxy: add refcount to keep the proxy alive in demarshal
We need to keep the proxy alive during demarshal because the callbacks
might decide to destroy the proxy.
2019-08-16 15:19:19 +02:00
Wim Taymans
58fd46ebd1 remote: remove our listener when the core_proxy is destroyed 2019-08-16 15:18:49 +02:00
Wim Taymans
23fe46b698 stream: implement drain
Set the drained flag.

If the server calls us and we're out of buffers and the drained
flag is set, emit the drained signal.

Deactivate the node on disconnect.

Make sure we have no more pending process callbacks in the invoke
queue before when we pause.
2019-08-16 15:14:23 +02:00
Wim Taymans
7ad111de47 connection: return INVALID for invalid fds 2019-08-16 15:12:30 +02:00
Wim Taymans
2f28e59c63 protocol: use Fd pod for fd indexes for easier debugging 2019-08-16 15:11:04 +02:00
Wim Taymans
8da7222c7e protocol-native: avoid NULL pointer access 2019-08-16 15:09:16 +02:00
Wim Taymans
aa2e2f192b client-node: dont' send peer_added with our own node
.. because it's just ignored in the client anyway.
2019-08-16 15:08:21 +02:00
Wim Taymans
47f0f1f9a3 loop: flush items in invoke from thread
When we do invoke from the loop thread, first process the pending
invoke items before handling ours. This can be used to sync the
invoke queue before cleanup.
2019-08-16 15:04:27 +02:00
Wim Taymans
954c96632c channelmix: try to handle 1 channel as MONO/FC 2019-08-16 15:03:16 +02:00
Wim Taymans
6f16d6ff8e example: remove some unused fields 2019-08-16 15:02:48 +02:00
Wim Taymans
dff1cfe13e fix example 2019-08-15 19:07:03 +02:00
Wim Taymans
78765e8d82 v4l2: set port ref to implementation 2019-08-15 18:40:22 +02:00