Commit graph

2441 commits

Author SHA1 Message Date
Wim Taymans
77e07e1948 improve properties on globals and ports 2019-09-20 13:28:06 +02:00
Wim Taymans
6756a3c8fc monitor: remove monitor API and use device
Remove the monitor API, we can use the device API for it. Make sure
we support creating devices (like alsa) from another device (udev).

Use new object.id to store the object id in the object properties. Use
the port.id/node.id etc to make relations to other objects.
2019-09-20 13:04:14 +02:00
Wim Taymans
818fb9e904 alsa: add midi bridge
Add a node that exposes all midi input and output ports and converts to
and from PipeWire control streams.
2019-09-19 16:57:00 +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
d3c7acb137 iter: add helper to parse pod from memory region 2019-09-19 13:17:48 +02:00
Wim Taymans
322ccb452c small cleanups 2019-09-19 13:17:30 +02:00
Wim Taymans
59bf522ce1 system: use the same bits as POLL and EPOLL
Use the same bits for the io mask as POLL and EPOLL so that we
can avoid conversions.
2019-09-19 13:15:38 +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
565f0475f0 tests: update test 2019-09-16 21:08:03 +02:00
Wim Taymans
4381e79632 control: clean up some control includes
Remove control from channelmix, it's not used
Add control metadata
Add OSC control type
Improve some docs
2019-09-16 15:49:46 +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
2d8bce7479 names: add vulkan compute source factory name 2019-09-10 12:38:25 +02:00
Wim Taymans
7fd6d6d820 node: revert previous commit
Always add work to the work queue, some code relies on the fact that
the state change continuation happens from next iteration of the
mainloop.

Don't warn when destroying the work queue and there are still items in
it, this is ok.
2019-09-10 12:27:29 +02:00
Wim Taymans
80ba0b2dcf node: only put async state changes to work queue 2019-09-10 12:13:26 +02:00
Wim Taymans
c9855763c3 remote: always close the fd in connect_fd
Not closing the fd causes leaks in existing apps. It's probably better
to always close it and let apps deal with that by using dup or similar.

Make gst sink and source dup the fd before connect_fd().

Fixes #181
2019-09-10 11:05:38 +02:00
Julian Bouzas
ddd2a97f7e bluez: set bluez profile property when emitting node
We need to expose the bluetooth profile in the nodes so that external
applications know how to handle them.
2019-09-10 10:42:11 +02:00
Wim Taymans
3142d3b979 mem: add private mapping flag 2019-09-10 09:59:31 +02:00
Wim Taymans
b9e517ee67 pipewire: add PIPEWIRE_LOG environment variable
PIPEWIRE_LOG will redirect logging to a file.
2019-09-10 09:44:05 +02:00
Wim Taymans
0fe7f9765d link: use the port as the work-queue object
Use the port as the object/seq identifier of the defered work. This
way we can handle feedback links between the same node and identify
what port completed.
2019-09-10 09:42:23 +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
3340f3cacc core: don't touch unassigned nodes that don't need_driver 2019-09-05 17:06:49 +02:00
Wim Taymans
729dd1360a alsa: don't set rate, it's set by the app 2019-09-05 17:05:20 +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
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