Commit graph

375 commits

Author SHA1 Message Date
Wim Taymans 8b291ada27 jack: increase client name size 2020-07-21 15:41:52 +02:00
Wim Taymans 13492fd282 jack: include application name in client name 2020-07-20 16:54:38 +02:00
Wim Taymans ee2c1f3882 jack: enforce unique port names as well 2020-07-20 16:27:26 +02:00
Wim Taymans 7711c98123 jack: use default sink/source to sort ports 2020-07-17 17:23:43 +02:00
George Kiagiadakis a108752514 jack: fix crash on close when metadata are not available 2020-06-17 12:13:34 +00:00
Wim Taymans 0441653ce4 jack: use PIPEWIRE_LINK_PASSIVE environment var
Let the jack client make passive links when the PIPEWIRE_LINK_PASSIVE
variable is set. Makes it possible to start qsynth with passive links
so that it suspends when not in use.
2020-06-17 13:17:28 +02:00
Wim Taymans 660d77cff0 jack: allocate mix structure dynamically 2020-06-16 21:12:12 +02:00
Wim Taymans c9d4c1ba95 jack: dynamically fill the port array
Don't preallocate ports, do so on demand to reduce memory
usage.
2020-06-16 20:57:52 +02:00
Simon McVittie b852b58f82 Optionally install examples and tests
This makes it easier to test PipeWire in its "as-installed" state,
for example in an OS distribution.

The .test metadata files in ${datadir}/installed-tests/${package} are
a convention taken from GNOME's installed-tests initiative, allowing a
generic test-runner like gnome-desktop-testing to discover and run tests
in an automatic way.

The installation path ${libexecdir}/installed-tests/${package} is also
a convention borrowed from GNOME's installed-tests initiative.

In addition to the automated tests, I've installed example executables
in the same place, for manual testing. They could be separated into
a different directory if desired, but they seem like they have more
similarities with the automated tests than differences: both are there
to test that PipeWire works correctly, and neither should be relied on
for production use. Some examples are installed in deeper subdirectories
to avoid name clashes.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-16 17:58:02 +00:00
Simon McVittie e493be3844 scripts: Use special ${LIB} token for architecture-independence
On GNU/Linux systems, the literal string '${LIB}' in dynamic linker
paths expands to "lib", a biarch libQUAL directory such as "lib64", or
a Debian-style multiarch directory such as "lib/x86_64-linux-gnu".
If we're installing libraries to such a directory, and we have both
word-sizes' compatibility libraries available, then pw-pulse can
use LD_LIBRARY_PATH='/usr/${LIB}/pipewire-0.3/pulse' to make both
i386 and x86_64 programs load the correct version.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-05 13:40:50 +00:00
Simon McVittie 96eb6e4df8 scripts: Don't add an empty entry to LD_LIBRARY_PATH
LD_LIBRARY_PATH="/path/to/lib:" is interpreted as equivalent to
LD_LIBRARY_PATH="/path/to/lib:.", loading libraries from the current
working directory, which could lead to malicious libraries being loaded
if the current working directory is untrusted. To avoid this, only add
the current LD_LIBRARY_PATH to the new LD_LIBRARY_PATH if it is
actually set.

This commit also single-quotes the interpolated @VARIABLES@ so that
their values can contain shell special characters (other than single
quotes).

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-06-05 13:40:50 +00:00
Wim Taymans 6ee9853133 jack: free old mem after we configure new mem 2020-06-05 13:02:56 +02:00
Wim Taymans 814b74265c jack: stop the thread loop before we destroy objects 2020-06-04 13:08:39 +02:00
Wim Taymans 253e304124 jack: destroy link proxy
Destroy the link proxy immediately so that we don't leak it.
The link is marked as 'linger' and will thus keep on living
even when our proxy is gone.
2020-06-04 12:59:55 +02:00
Wim Taymans 38cfa2d71d jack: fix leaks 2020-06-04 12:59:20 +02:00
Wim Taymans c546167ad3 require meson 0.49 2020-05-20 15:26:35 +02:00
Wim Taymans a898f21c87 improve debug
When we fail to read the eventfd, don't try to use the value.
2020-05-20 15:24:25 +02:00
Wim Taymans e6ccc72feb fix compiler warnings 2020-05-08 20:40:02 +02:00
Wim Taymans c117ca0899 jack: fix unlock 2020-04-30 16:18:40 +02:00
Wim Taymans 420c186124 jack: also sync position area with data thread 2020-04-30 16:15:22 +02:00
Wim Taymans 0fd46d057e remote: free io area after we set the new area
First set the new area, then destroy the old one. Otherwise the
data thread might still be using the old area and crash.
2020-04-30 16:13:50 +02:00
Wim Taymans 8141c92dde jack: free some objects 2020-04-30 13:11:01 +02:00
Wim Taymans 30d5a247e1 jack: improve locking
Protect the global metadata with a lock because we update this from
multiple clients. Avoid updating the metadata if it didn't change.

Add a simple lock to protect the session objects, they could be
accessed from the main thread or data thread. Use the simple lock
in methods that just read.

Use the new data loop invoke to make sure we sync the data update
with the data thread.

Stop the data loop when our position io is removed.
2020-04-30 12:57:56 +02:00
Wim Taymans d8d4e2f335 jack: make dummy server and net libraries 2020-04-29 16:32:15 +02:00
Wim Taymans 9f810d1bbc add pw-jack and pw-pulse to set the library path
pw-pulse and pw-jack set the replacement library path correctly
so that pulse and jack apps run on top of PipeWire.
2020-04-29 13:28:08 +02:00
Wim Taymans 293386c21a install replacement libraries in modules directory
Don't use a special name for the replacement libraries but install
them into the modules directory by default. Add an option to install
them into another location.

This way, we don't need to set up symlinks in development, distros can
choose to install them where they want and/or we can use symlinks or
LD_LIBRARY path to select the replacement versions.
2020-04-29 11:24:24 +02:00
Wim Taymans 83b30dcd3d jack: always initialize the port buffer
Init the port buffer after we create it, not only after we get a buffer
on the port.
Cleanup a little.
2020-04-28 14:15:49 +02:00
Wim Taymans 730c85e5b0 metadata: fix order of type/value 2020-04-27 12:54:14 +02:00
Wim Taymans 90e1eb1b22 jack: add more metadata keys 2020-04-27 12:22:32 +02:00
Wim Taymans aafd1e7298 improve debug
Improve log so that debug level 3 gives a reasonably readable overview
of what is going on.
2020-04-22 12:47:18 +02:00
Wim Taymans 2e06d0819b jack: only do transport when there is a driver 2020-04-21 16:15:45 +02:00
Wim Taymans 90054f5f3e jack: clear buffers when freeing the mixer 2020-04-21 15:53:43 +02:00
Wim Taymans 539296069d jack: implement more metadata API
Rework the metadata implementation without pw_properties to make
it easier to delete all subjects and implement the metadata API.
Remove metadata from all objects when they are destroyed.
2020-04-20 15:19:06 +02:00
Wim Taymans 16ca53e592 jack: implement get_property 2020-04-20 11:51:20 +02:00
Wim Taymans 0db9c4ef6b jack: use current buffer and samplerate 2020-03-18 17:52:48 +01:00
Wim Taymans e8cf29a7c8 jack: remove some hardcoded defaults
We get those from the server instead.
2020-03-18 17:42:11 +01:00
Wim Taymans 72d70b0f48 Add and fix some more warnings
Fixes #216
2020-03-17 11:37:56 +01:00
Wim Taymans cb7bfdf98a sprinkly SPA_LIKELY/UNLIKELY around 2020-03-16 12:52:28 +01:00
Wim Taymans 5273320825 jack: fix midi output 2020-03-15 08:45:56 +01:00
Wim Taymans b070752add context: don't load rtkit by default
Don't load and use rt-kit by default because it can cause sigkill in
the app, which is not good when it happens in a compositor.

Make the module profile a comma-separated list of profiles and make
it possible to explicitly load rtkit as well.

load the rtkit profile as well in jack.
2020-03-05 12:12:46 +01:00
Wim Taymans c4b2be2aad use true and false for boolean properties
So that it's easier to convert them to booleans in introspection
code later.
2020-03-03 18:17:46 +01:00
Wim Taymans 37a1dc5265 jack: use constant for type_id 2020-03-02 16:50:37 +01:00
Wim Taymans 73da0f8878 jack: use pthread cancel to stop the data thread
Activate the new option to pthread_cancel the data thread because
that is what jack apps expect.

Fixes #211
2020-03-02 15:47:52 +01:00
Wim Taymans bcdd47273d jack: call buffer_size callback right after activate
Some jack clients expect this callback right after activate.
Should fix jackaudiosink in gstreamer.
2020-02-25 18:02:49 +01:00
Wim Taymans a4d744e3cf jack: improve sample_rate callback
Call the sample rate callback when we install it and we know the
sample rate. Otherwise, the sample rate callback might never be
triggered.
2020-02-24 15:39:19 +01:00
Wim Taymans cde7fa797c jack: improve timemaster install
When we get the driver activation try to install ourselves as
timemaster.
2020-02-24 15:38:21 +01:00
Wim Taymans 9e44b957f0 jack: check arguments
Guard against some evil jack clients
2020-02-24 11:25:31 +01:00
Wim Taymans ea911f2e3f tweak buffers a little
JACK can handle 2 buffers at most, make the default buffer allocator
allocate 2 buffers when no params are given.
Prefer 2 buffers, it allows some form of async fill/consume
2020-02-19 10:17:00 +01:00
Wim Taymans b3d94cde87 jack: fix stride of midi
Midi has a stride of 1
Error when the number of buffers is too big
2020-02-18 18:03:30 +01:00
Wim Taymans 1f3cb3d207 jack: fix invalid unlink
Don't unlink the mix->link when freeing, it is only linked when
in the free pool.

Protect against invalid number of buffers that could corrupt our
state.
2020-02-18 17:37:02 +01:00
Wim Taymans e6c3619521 jack: don't try to consume port without data
Or else we handle old data.
2020-02-18 13:38:25 +01:00
Wim Taymans 905e5af058 jack: implement the jack_info_callback and function 2020-02-10 10:59:24 +01:00
Jan Koester 656c58fd98 jack: add error callback 2020-02-10 10:48:49 +01:00
Wim Taymans ee67ab9c04 client-node: keep target links in list
Don't allocate the links in an array because they might be moved
when the array is resized. Instead just use calloc and add them
to a list.

Make sure we update the list used in the real-time thread from a
safe context.
2020-02-07 16:45:58 +01:00
Wim Taymans 936c290cc1 plugins: fix the licence of alsa and jack libraries
It's all MIT
2020-02-07 15:43:13 +01:00
Wim Taymans 9acf592e9c jack: remove leftover printf debug 2020-02-07 13:33:59 +01:00
Wim Taymans ed1cf46c31 jack: add jack_get_video_image_size extension
Add a JACK PipeWire extension to get the video size of the DSP
pipeline and use this instead of the hardcoded values in the example.
2020-02-07 13:31:49 +01:00
Wim Taymans 14fbd4f520 jack: wait for transport
Wait for the transport to be configured before we exit from
client_open. We then have at least an activation or even a driver
set.
2020-02-07 13:30:24 +01:00
Wim Taymans ae4e17e9a2 Remove old LICENSE files and README 2020-02-07 13:24:06 +01:00
Wim Taymans 5c4be385ad jack: only append node id when name already taken 2020-02-05 10:27:37 +01:00
Wim Taymans 41b47e726e context: add some more defaults
Make a property to allow mlock and use it.
mlock in stream and filter when asked to mmap mem.
2020-02-04 17:09:41 +01:00
Wim Taymans 5e5bab4680 jack: don't take clock time as awake timestamp
Take a sample from the monotonic clock to generate the AWAKE
timestamp.
2020-01-31 13:35:39 +01:00
Wim Taymans 7450bfd88b Improve mlock failure warning message 2020-01-29 11:07:26 +01:00
Wim Taymans 8de267cf02 jack: handle plugins that cache jack_port_get_buffer()
Some plugins (calfjackhost) only call jack_port_get_buffer()
once and cache the pointer. This behaviour has been deprecated
in JACK2 but still works.

Add a workaround for this by getting a buffer ourselves and memcpy
into it from the scratch buffer.
2020-01-29 10:29:26 +01:00
Wim Taymans 84258c9078 jack: fix set_sync_timeout
It needs to update the node activation, not the driver activation.
2020-01-28 20:49:21 +01:00
Wim Taymans 6ac9b7b3a7 spa: add spa_aprintf helper
Add a asprintf helper function that handles errors correctly.
Use this in places where we use asprintf to avoid warnings when we
don't check the return value.
2020-01-27 12:19:21 +01:00
Wim Taymans ae51b0acf1 jack: stop data thread when closing client
Make sure we deactivate and stop the data thread when closing a
client or we might get segfaults.
2020-01-16 13:29:56 +01:00
Wim Taymans ded3a2a58f append -pw and version to .so libraries
So that we can place them next to the real ones and use a symlink
to switch.
2020-01-16 12:57:25 +01:00
Wim Taymans 1f03d26e53 install the jack and pulseaudio libraries 2020-01-15 17:01:48 +01:00
Wim Taymans 9b41e4dfd9 jack: use sample rate from position
Use the sample rate from the position io area as soon as we get it.
2020-01-09 16:06:28 +01:00
Wim Taymans 852ac043d3 Use the DSP format for dsp formats
Use the DSP media subtype to describe DSP formats. DSP formats
don't include the rate, channels and channel position in the
format and must use the rate and duration from the position io. This
makes it possible to later change the samplerate dynamically without
having to renegotiate the graph.

The same goes for the video DSP format, which uses the io_video_size
from the io_position to get the size/stride. Set this up in the node
based on the defaults from the context.

Make it possible to define defaults in the daemon config file, such
as samplerate, quantum, video size and framerate. This is stored in
the context and used for the DSP formats.
2020-01-09 15:18:59 +01:00
Wim Taymans f391353c7f Make interface types a string
This is more in line with wayland and it allows us to create new
interfaces in modules without having to add anything to the type
enum. It also removes some lookups to map type_id to readable
name in debug.
2019-12-19 13:36:04 +01:00
Wim Taymans 698ab911c3 loop: pass spa_dict to *_loop_new
Make the thread_loop alloc its own loop by default to simplify
some core. Add extra new_full method to pass a custom pw_loop.
Make other loop implementations ready to support custom loops
if we want that later.
2019-12-13 11:34:25 +01:00
Wim Taymans 743450a19f pw_client_node_proxy -> pw_client_node 2019-12-11 16:13:46 +01:00
Wim Taymans e633e205c2 pw_link_proxy -> pw_link 2019-12-11 15:11:56 +01:00
Wim Taymans 49d736bbb7 pw_registry_proxy -> pw_registry 2019-12-11 09:44:48 +01:00
Wim Taymans ecc6b27cd7 rename core_proxy -> core
Rename core_proxy to core and move the introspect and interface
contents to core.h

In an effort to promote the proxy API.
2019-12-11 07:46:59 +01:00
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
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 a42c517682 improve debug 2019-08-08 11:03:13 +02:00
Wim Taymans 447d1f94bf jack: update 2019-08-07 12:59:46 +02:00
Wim Taymans f1ea49d6e9 mem: add size of tag to make it possible to check subtags 2019-08-01 13:55:03 +02:00
Wim Taymans 8590ac158b node: add flags to port_use_buffer
Remove the CAN_USE_BUFFERS flag, it is redundant. We can know this
because of the IO params and buffer params.

Add flags to the port_use_buffer call. We also want this call to
replace port_alloc_buffer. Together with a new result event we can
ask the node to (a)synchronously fill up the buffer data for us. This
is part of a plan to let remote nodes provide buffer data.
2019-07-25 13:19:39 +02:00
Wim Taymans 18776b155b mem: Add tag to memmap
Add a tag field when creating a memmap so that we can do lookup on it.
This makes it easier to implement the tracking of mappings for io areas.
Remove custom io memory tracking and use the tags.

Add flags to spa_chunk to make data corrupted. The flags on the buffer
stay constant for the life of the buffer. Add flags to mark memory
readable and writable. Mark memory readonly in v4l2-source.

Pass the daemon activation area to the client in the transport event.
This never changes and need to be handled differently from the other
activation areas.

Use the right flags when importing memory.

Add the (desired) memory type to mempool_alloc.

improve some debug.
2019-07-25 12:10:05 +02:00
Wim Taymans 2caf81c97c mem: improve memory handling
Add a memory pool to manage blocks of memory. Make it possible
to allocate and import blocks.

Add add_mem and remove_mem to the core events to signal a client
of a block of memory. Remove the client-node add_mem.

Make a global pool for memory and a per client pool where we
import and share the memory we need with the client.

Use the new memory pool to track and map memory in clients.
2019-07-23 17:46:43 +02:00
Wim Taymans 497a8364c5 printf format fixes 2019-06-07 17:16:02 +02:00
Wim Taymans db88e9f954 System: More work on making system functions pluggable
Move the epoll functions to the system functions and make the loop
use those. Use simple mask for events instead of enum.
Add the used system api in pw_loop.
Add System API to spa_support and use it where possible.
Pass the system API used in the realtime loops in spa_support as
well and use this in the realtime paths.
Improve bootstrapping, load only the log and cpu interfaces because
those can/need to be shared between instances. Let the core load
the other interfaces.
Add keys to configure the System and Loop implementations used in
pw_loop.
2019-06-06 15:31:53 +02:00
Wim Taymans 3ad73f0532 keys: add keys.h with defines and docs
Add a keys.h file that lists and documents all keys available to
be used in properties.
2019-05-24 15:47:48 +02:00
Wim Taymans ff946e3d4b interface: add an interface struct
The interface struct has the type,version and methods of the
interface.
Make spa interfaces extend from spa_interface and make a
separate structure for the methods.
Pass a generic void* as the first argument of methods, like
we don in PipeWire.
Bundle the methods + implementation in a versioned inteface
and use that to invoke methods. This way we can do version
checks on the methods.
Make resource and proxy interfaces that we can can call. We
can then make the core interfaces independent on proxy/resource and
hide them in the lower layers.
Add add_listener method to methods of core interfaces, just
like SPA.
2019-05-23 12:59:24 +02:00
Wim Taymans 58fa5561b8 interface: get_registry always returns a Registry type 2019-05-21 15:46:31 +02:00
Wim Taymans 9ec3e3ab6d private: set min quantum to 32
Going as low as 32 is possible now with the better clock rate
estimation.
2019-04-25 13:04:44 +02:00
Wim Taymans dcddd5080b submodule update 2019-04-23 17:42:55 +02:00
Wim Taymans 45e2219149 update submodule 2019-04-11 16:39:08 +02:00
Wim Taymans 964be84e1c list: check for empty list before insert
We can't insert an empty list.
2019-03-08 11:34:28 +01:00
Wim Taymans b357b7a7da scheduling: don't use the graph helpers.
Simplify the scheduling by using simple lists and removing the
subgraphs etc..

Make the driver node trigger all nodes it manages and when they
complete, trigger the driver node to finish the graph.
2019-03-06 20:33:55 +01:00
Wim Taymans ed988788fd client-node: pass spa_node_info along
Pass the complete spa_node_info to update node information. Remove
the redundant max/min port info.
Update the remote node based on port and node update events.
2019-03-04 12:30:45 +01:00
Wim Taymans 09c4683ef1 interfaces: make events return void
Events are dispatched with hooks and have no return value.

Make it possible to get the last resource and proxy sender value
for where we need it.
2019-03-01 14:04:05 +01:00
Wim Taymans 499dd3ff22 node: add port and node params
Add a new struct spa_param_info that lists the available params on
a node/port and if they are readable/writable/updated. We can use
this to replace and improve the PARAM_List and also to notify
property change and updates.

Update elements and code to deal with this new param stuff. Add
port and node info to most elements and signal changes.

Use async enum_params in -inspect and use the param info to know
which ones to enumerate.

Use the port info to know what parameters to update in the
remote-node.
2019-02-27 16:43:01 +01:00
Wim Taymans 245a0d5634 global: pass bind function to _new
Make the bind function a callback instead of an event. We can then
get a return value and use that to clean up the pending proxy and
generate an error.
2019-02-25 17:16:40 +01:00
Wim Taymans d2c18c7b1a Improve async handling
Don't use special callback in node to receive the results. Instead,
use a generic result callback to receive the result. This makes things
a bit more symetric and generic again because then you can choose how
to match the result to the request and you have a generic way to handle
both the sync and async case. We can then also remove the wait method.
This also makes the remote interface and spa interface to objects very
similar.

Make a helper object to receive and dispatch results. Use this in the
helper for enum_params.

Make device use the same result callbacks.
2019-02-25 12:29:57 +01:00
Wim Taymans 7b12212eeb node: improve async handling
Remove the done and error callbacks. The error callback is in an
error message. The done callback is replace with spa_pending.

Make enum_params take a callback and data for the results. This allows
us to push the results one after another to the app and avoids ownership
issues of the passed data. We can then extend this to handle the async
case by doing a _wait call with a spa_pending+callback+data that will
be called when the _enum_params returns and async result.
Add a sync method.

All methods can now return SPA_RESULT_IS_ASYNC return values and you
can use spa_node_wait() to register a callback when they complete
with optional extra parameters. This makes it easier to sync and
handle the reply.

Make helper methods to simulate the sync enum_params behaviour for
sync nodes.

Let the transport generate the sequence number for pw_resource_sync()
and pw_proxy_sync(). That way we don't need to keep track of numbers
ourselves and we can match the reply to the request easily.
2019-02-21 09:40:12 +01:00
Wim Taymans eea062ee53 interfaces: improve remote API
Add return values to events and method callbacks. This makes it
possible to pass any error or async return value.
Add sync/done/error in both directions so that both proxy and resource
and perform/reply sync and produce errors.
Return a SPA_ASYNC from remote method calls (and events), keep the
sequence number in the connection.
With the core sync/done we can remove the client-node done method and
it's internal sequence number along with the seq number in method calls.
We can also use the method/event async return value to perform a sync
with as the unique sequence number for this method.
Add sync method and done/error event to proxy and resource.
2019-02-18 12:31:36 +01:00
Wim Taymans e9bedae5fa node: add max_ports to node info 2019-02-14 17:40:01 +01:00
Wim Taymans 61276da87e submodule update 2019-02-13 12:46:53 +01:00
Wim Taymans 5de7898808 node: implement activation
Make an eventfd for each node and listen for events when the node
is activated.
Reorganize some graphs links to make it possible to activiate nodes
by signaling the eventfd
Pass the peer node to each remote node and let the remote node
directly activate the peer when needed.
Let each node signal the driver node when finished.
With this we don't need to go through the daemon to schedule the
graph, nodes will simply activate eachother. We only go to the
server when there is a server node to schedule.
Keep stats about the state of each node and the time it was
triggered, running and finished.
2019-02-12 17:42:33 +01:00
Wim Taymans 658c1da52f node: allocate shared mem for activation
Allocate a per node a piece of shared memory where we place the
activation structure with the graph state and io_position.
We can then give this info to nodes so that they can get the position
in the graph directly but also later, activate the next node in
the graph.
2019-02-07 12:34:54 +01:00
Wim Taymans 569cbb48a9 use SPA_EXPORT to export symbols 2019-02-06 13:24:41 +01:00
Wim Taymans 11769aa7e7 media-session: track our DSP link
Set our DSP link proxy to NULL when it gets destroyed so that we
don't accidentally try to do things with it anymore.
2019-01-29 10:29:06 +01:00
Wim Taymans 13bf70a8dd mem: align memory to requested alignment
Improve the allocators to always align the buffer memory to the
requested alignment
Use aligned read and writes for sse functions and check alignment,
optionally falling back to unaligned path.
Add more tests and benchmark cases
Check and warn for misaligned memory in plugins.
2019-01-24 18:28:52 +01:00
Wim Taymans 351fb9ce29 pod: improve parser and builder
Remove the spa_pod_iter helpers
Remove builder/parser vararg recurse option, you have to
manually recurse into structures when needed. This simplifies
things a lot.
Pass spa_pod_frames to builder and parser explicitly, we don't
have to keep an internal stack anymore.
The parser is now almost a mirror image of the builder.
Make the parser safer when iterating over objects, add functions
to check and get pod contents in a safe way.
Make the builder return errno style results on errors
Improve performance of object properties when they are stored and
retrieved in the same order.
Add many more tests for the builder and parser
Add some benchmarks
2019-01-22 17:38:23 +01:00
Wim Taymans 5376832676 builder: control_header -> control 2019-01-17 17:11:58 +01:00
Wim Taymans 80cfda89c1 pod: improve the vararg pod builder and parser
Automatically parse and build key/value when in objects without having
to prefix the key with ":"
Automatically build control/value when in sequence without the "."
prefix.
Remove the builder with key/pod, taking a reference to the stack built
temporary pods is not allowed in c++. We can use the varargs version
with the same convenient syntax.
Remove the parser "*" option, it is unused.
Improve spa_pod_builder_add_* and spa_pod_parser_get_* and make them
look similar.
2019-01-16 11:05:12 +01:00
Wim Taymans 66bab1d9b2 remote: remove some events
Remove some events from the remote that we can find on the core_proxy.
Use the core_proxy to get to the done and info events.
Remove pw_remote_get_core_info(), we don't need this anymore now that
we don't listen for the event and the user can keep track of this
herself.
2019-01-10 10:08:14 +01:00
Wim Taymans 1ed27a8f2b add _GNU_SOURCE as compiler flag 2019-01-08 17:36:58 +01:00
Wim Taymans 979d155382 core: add user_data to core 2019-01-08 17:32:37 +01:00
Wim Taymans 5b7ddb0105 buffer: remove buffer id
The buffer id is not needed/used, we use the index of the buffer in the
buffer array when configuring the port.
2019-01-07 17:57:03 +01:00
Wim Taymans e918f9f77c fix sign confusion 2019-01-07 15:52:42 +01:00
Wim Taymans 97f7ad31a4 submodule update 2018-12-11 16:38:07 +01:00
Wim Taymans f063cc9086 audioconvert: improve negotiation
Configure format and buffers when the ports are configured instead of
in the start command.
2018-11-19 10:03:55 +01:00
Wim Taymans 8d9aae061b submodules 2018-11-07 09:59:11 +01:00
Wim Taymans 57d9f597d9 jack: update submodule 2018-10-29 14:30:44 +00:00
Wim Taymans 06fe3af7fb update submodules 2018-10-24 10:35:41 +02:00
Wim Taymans 0395897856 node: only run the graph when we are the selected driver
Update submodules
2018-10-23 16:52:28 +02:00
Wim Taymans 9479a00871 update submodules 2018-10-10 18:50:49 +02:00
Wim Taymans 78444aba4e uninstalled: update uninstalled 2018-10-10 18:04:28 +02:00
Tapasweni Pathak 8d71d2dab8 pipewire: add enable/disable to meson for spa plugins 2018-10-10 16:01:28 +02:00