Commit graph

214 commits

Author SHA1 Message Date
Wim Taymans
c430b1de58 jack: move monitor ports after playback ports
Enumerate monitor ports after their playback ports, like how
jack does this.

See #527
2021-01-05 15:38:52 +01:00
Wim Taymans
776147c125 jack: also find port by aliases
one can also use the aliases to connect ports, qjackctl does this.

Fixes #527
2021-01-03 21:25:55 +01:00
Wim Taymans
2b507cbe79 jack: use the node activation position after connecting
Until we get assigned to a driver, use our own activation position
to report samplerate and buffer size.
2020-12-09 20:48:59 +01:00
Elliott Sales de Andrade
86fd6a0d3e Fix some possible-NULL pointer usage. 2020-11-23 15:36:08 +00:00
Wim Taymans
fb44d3428c jack: block some cases
Refuse to run when we run in the daemon, we can't really do a blocking
connect to the daemon from its main thread.

Also refuse to run when we detect an old pipewire libaray. Blocks the
case where some app linked against 0.2 wants to use the replacement
libjack.so.
2020-11-19 12:37:10 +01:00
Wim Taymans
f42da492f9 warn about lock just once 2020-11-14 21:21:20 +01:00
Wim Taymans
38bcab4610 jack: handle connect errors
Listen on the proxy for errors and report this to the caller. This
avoids hanging in jack_connect.
2020-11-04 21:05:45 +01:00
Wim Taymans
c43026d93e don't handle EINTR and EAGAIN as the same
EAGAIN means a non-blocking operation would block and we should not
try again right away but leave the loop and wait instead.

See #358
2020-11-02 16:43:56 +01:00
Wim Taymans
e094640c7b handle EINTR and EAGAIN
Just do the call again instead of failing or logging an error.

Fixes #358
2020-11-02 14:51:07 +01:00
Wim Taymans
acfb48e3da pulse: improve debug 2020-10-27 16:46:12 +01:00
Wim Taymans
70e9e622eb jack: declare constants like jack does again 2020-10-22 15:23:56 +02:00
Wim Taymans
4dd1e02526 jack: return error when out of midi events
Fixes #334
2020-10-19 23:30:44 +02:00
Wim Taymans
68bff629b3 jack: optimize get_buffer
Keep track of global mix port.
Calculate the get_buffer function beforehand.
2020-09-30 11:59:41 +02:00
Wim Taymans
2a630dbecd jack: move some debug to fastpath 2020-09-29 16:57:50 +02:00
Wim Taymans
c2fc8423eb jack: move metadata to exports file
So that we don't have to depend on the header file.

Fixes #306
2020-09-25 17:39:26 +02:00
Wim Taymans
136f556d79 jack: lock for accessing the globals 2020-09-22 13:10:58 +02:00
Wim Taymans
c979f181a5 jack: return useful version number (major version 3)
Also add the PipeWire string in there to give apps a chance to
report this.
2020-09-11 11:28:04 +02:00
Wim Taymans
dc2cfb2bd2 jack: only report latency for terminal ports
Only report latency for terminal ports for now and use the buffer
size as the latency.
2020-09-10 09:15:47 +02:00
Simon McVittie
b8c58c74d8 Link pipewire-jack to libatomic if required
This is necessary on some 32-bit architectures that implement atomic
operations on 64-bit quantities as library calls, including Debian's
armel and mipsel ports.

Signed-off-by: Simon McVittie <smcv@debian.org>
2020-09-07 15:17:57 +00:00
Wim Taymans
d995df95f8 jack: small cleanup 2020-09-07 16:16:26 +02:00
Wim Taymans
4c372a87ca pw-jack: add samplerate and period options 2020-09-03 11:14:29 +02:00
Wim Taymans
0c04481ba7 metadata: improve default sink/source
Only check defaults when subject is PW_ID_CORE
Handle NULL keys: remove the defaults
2020-08-18 17:56:05 +02:00
Wim Taymans
759e1ccb6b jack: fix default source and sink handling 2020-08-18 17:18:37 +02:00
Wim Taymans
8c893cbc4a jack: improve debug 2020-08-18 16:52:27 +02:00
Wim Taymans
36c10046da metadata: fix string compare 2020-08-12 18:58:48 +02:00
Wim Taymans
cc044b0e08 jack: don't overwrite any PIPEWIRE_PROPS values 2020-08-11 12:12:37 +02:00
Wim Taymans
f73a0c97e3 jack: use empty area when get_buffer frames is 0
Client that call port_get_buffer with 0 frames get the empty scratch
buffer because we can't know the final output size.
2020-08-11 12:09:50 +02:00
Wim Taymans
753af7c7b3 jack: improve buffer size callbacks
Make sure we emit the buffer callback either from the calling thread
or from the thread_loop. Mark the callback as pending and don't call
the process function until the callback has been handled.
2020-08-11 11:11:00 +02:00
Wim Taymans
e71936f870 Improve naming
master -> driving
priority_master -> priority_driver
segment_master -> segment_owner
2020-08-06 13:49:33 +02:00
Wim Taymans
3abd46b619 jack: Use out node name from the server
Get the node name from the global info when we see it.
Check if the name changed and set the right result flag for the app.
2020-08-05 12:26:59 +02:00
Wim Taymans
d76b509995 jack: prefer nick for node name
The nick is shorter and nicer for jack applications. We have the
full description in the port alias 2.
2020-08-03 18:13:31 +02:00
Wim Taymans
407ea74513 don't use qsort_r, it's not implemented everywhere
Fixes #260
2020-08-02 12:50:56 +02:00
Wim Taymans
2b3a58ed13 jack: improve client name
Only append app name and node name when they are different
Use / to separate app name from node name because : is used to
separate client name from port name.
2020-07-30 12:56:20 +02:00
Wim Taymans
2e95f7dd85 jack: improve metadata callbacks
Only emit callbacks when something changed.

When setting a value, first update the local store. This triggers
the emit from the calling thread (as expected by jack clients) and
when the update arrives from the server, it will not emit the callback
anymore because the value didn't change.
2020-07-30 12:11:24 +02:00
Wim Taymans
f888c58b83 jack: fix client uuid 2020-07-30 12:10:46 +02:00
Wim Taymans
bb20e0646c jack: parse varargs and use server name
Parse the varargs and use the server name as the remote
2020-07-23 13:18:14 +02:00
Wim Taymans
266e1301d2 use id to store default sink/source
This is easier to handle in general and we should not use the name
as a unique id. If the session manager wants to save things, it can
use whatever fields it wants from the object to create a unique
persistent name.
2020-07-23 11:59:13 +02:00
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