Commit graph

6884 commits

Author SHA1 Message Date
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
c9e177827b node: calculate cpu time 2019-08-22 10:59:53 +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
6f5e6568c9 node: warn when we can't set position on a driver 2019-08-21 15:16:59 +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
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
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
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
0af87d2685 client-node: keep port buffers in special location
Keep the output port buffers in a special mix info. They should
stay there even when the mix is removed and should only be cleared
explicitly with a NULL Format or 0 use_buffers.
2019-08-15 11:49:32 +02:00
Wim Taymans
96ba0fbdeb client-node: only clear buffers when format cleared
.. like we don on the client.
2019-08-14 17:07:22 +02:00
Wim Taymans
449d98910b proxy: remove unncessary link in remote 2019-08-14 12:09:49 +02:00
Wim Taymans
e3d19993e9 stream: EIO on format and buffers when disconnecting 2019-08-14 11:59:00 +02:00
Wim Taymans
35f617157f proxy: improve proxy cleanup
When we destroy a proxy, mark it as zombie until the server removes
the id. This way we can still keep the id locked with a valid entry
and remove it later.
2019-08-14 11:52:59 +02:00
Wim Taymans
d86e462dca client-node: clean up buffers and other memory 2019-08-14 11:45:28 +02:00
Wim Taymans
c879b85884 export-sink: add more buffer space 2019-08-14 11:44:37 +02:00
Wim Taymans
6a8fe43a0c improve debug 2019-08-14 11:44:16 +02:00
Wim Taymans
f6fca48459 client-node: always remove the previous io memory 2019-08-13 18:43:22 +02:00
Wim Taymans
ab069d45be stream: improve debug 2019-08-13 18:41:55 +02:00
Wim Taymans
e827d65659 stream: make the control info const 2019-08-13 18:41:22 +02:00
Wim Taymans
b90c5b925a examples: add example of memfd upload
Add an example of a client that allocates the buffer memory and
uploads the fds to the server.
2019-08-12 16:54:05 +02:00
Wim Taymans
935de18aa5 port: return async result from use_buffers if any 2019-08-12 16:50:10 +02:00
Wim Taymans
3e674f1646 stream: find right media_class from format 2019-08-12 15:14:39 +02:00
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
b8b2e494bd audioconvert: improve proxy of internal params 2019-08-12 15:14:39 +02:00
Wim Taymans
a42c517682 improve debug 2019-08-08 11:03:13 +02:00
Wim Taymans
3ee9cbd57d fix errno values 2019-08-07 13:33:14 +02:00
Wim Taymans
7cbdaeb3b6 remove obsolete dbus protocol 2019-08-07 13:09:02 +02:00
Wim Taymans
06446e0d64 port: simplify buffer allocation
Use just one function to do buffer allocation on a port.

Remove some unused variables.
2019-08-07 12:56:57 +02:00