Commit graph

2418 commits

Author SHA1 Message Date
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
88299ab225 alsa: add sync-id to properties 2019-09-05 13:18:56 +02:00
Wim Taymans
a232e67dd8 resample: completely fill resampler
start with a completely filled resampler so that the first
input byte immediately gives an output sample. When then have
n_taps/2 leading (almost) 0 samples.

Also make the passthrough resampler act like the real resampler
by introducing an n_taps/2 delay.
2019-09-05 13:13:20 +02:00
Wim Taymans
b1bfc900d6 improve: debug 2019-09-05 13:09:01 +02:00
Wim Taymans
0eb2705766 alsa: fix read of second part of ringbuffer 2019-09-05 09:17:14 +02:00
Wim Taymans
bd2d0ebc75 node: handle target without node 2019-09-03 13:57:20 +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
ca34a75173 protocol-native: attempt to remove socket
After we grab the lockfile we should remove the socket when it
exists so that we can bind again. This should solve startup
problems after a crash, which left the socket around and caused
bind failures.
2019-08-30 18:08:00 +02:00
Wim Taymans
1bbb144b59 alsa-utils: update the threshold also for capture 2019-08-30 17:32:56 +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
001c0a5217 alsa: don't compensate for rate match for very low latencies
For very small buffer sizes, don't try to attempt to compensate
for the rate matching because we would come dangerously close to
the read/write pointers and cause dropouts. Instead this latency
should be reported on the ports later.
2019-08-30 16:31:51 +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
0d35f44fd9 tests: add channelmix test 2019-08-29 14:05:02 +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
Julian Bouzas
5363d3352c bluez: process available buffers in read_ready callback for a2dp-source and sco-source 2019-08-28 17:17:12 +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
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