Commit graph

177 commits

Author SHA1 Message Date
Wim Taymans
ca066fbf3b jack: use PIPEWIRE_PROPS env to add properties to jack nodes 2020-07-21 16:50:45 +02:00
Wim Taymans
d4d80c16c1 jack: handle NULL keys 2020-07-21 16:47:58 +02:00
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