Ignore self connect requests to external ports only is now the default
mode.
In the default now 'e' mode, jack clients are still able to connect
their own ports. jack client attempts to connect its own ports to
other jack client ports, including "system", will be ignored in the
default configuration.
Despite still observable self-connect behaviour of firefox and other
jack clients, it is not desirable for jack (modular) setups.
* fix ringbuffer thread safety on ARM. fix#715#388
This patch addresses the thread safety problem of `jack_ringbuffer_t`
mentioned in #715 and #388. The overbound read bug caused by this problem
is impossible to reproduce on x86 due to its strong memory ordering, but
it is a problem on ARM and other weakly ordered architectures.
Basically, the main problem is that, on a weakly ordered architecture,
it is possible that the pointer increment after `memcpy` becomes visible
to the other thread before `memcpy` finishes:
memcpy (&(rb->buf[rb->write_ptr]), src, n1);
// vvv can be visible to reading thread before memcpy finishes
rb->write_ptr = (rb->write_ptr + n1) & rb->size_mask;
If this happens, the other thread can read the remaining garbage values
in `rb->buf` due to be overwritten by the unfinished `memcpy`.
To fix this, an explicit pair of release/acquire memory fences [1] is
used to ensure the copy on the other thread *happens after* the `memcpy`
finishes so no garbage values can be read.
[1]: https://preshing.com/20130922/acquire-and-release-fences/
* remove volatile qualifier on ringbuf r/w pointers
The volatile constraints are excess when compiler barriers are present.
It generates unnecessary `mov` instructions when pointers aren't going
to be updated.
* simplify read/write space calculations
This optimization is possible because the buffer size is always a power
of 2. See [1] for details.
[1]: https://github.com/drobilla/zix/pull/1#issuecomment-1212687196
* move acq fences to separate lines
LADI jack2&jackdbus projects are maintained in parallel with jackaudio.org jack2,
so remove the support links in order to not burder jackaudio project with LADI stuff.
This adds a LICENSE file that describes which licenses this project is
licensed under. This is very important, as the project is licensed under
three licenses.
Also added are copyright notices to the wscript files. I added myself as
copyright holder to them, but there are other people who have
contributed to these files which should have their name in the copyright
header. Clearly stating the license of the wscript files should have
been done long ago.
Before this commit the fill_template script used to always
preprocess/install jackd.0 file.
This commit makes preprocessing/installation of jackd.0 man page to
only happen when jackd is configured to be built.
jackdbus is going to be maintained in a dedicated repo
jackd executable is kept but its build is disabled by default.
When jackd build is enabled, D-Bus reservation functionality for jackd
is also enabled unless explicitly disabled with --no-dbus configure
option.
commit 4ab3b0744a
Author: krasjet <nil@krj.st>
Date: Fri Aug 12 18:17:33 2022 +0000
simplify read/write space calculations
This optimization is possible because the buffer size is always a power
of 2. See [1] for details.
[1]: https://github.com/drobilla/zix/pull/1#issuecomment-1212687196
commit 06749e0c67
Author: krasjet <nil@krj.st>
Date: Fri Aug 12 18:07:45 2022 +0000
remove volatile qualifier on ringbuf r/w pointers
The volatile constraints are excess when compiler barriers are present.
It generates unnecessary `mov` instructions when pointers aren't going
to be updated.
commit 165f5fdd92
Author: krasjet <nil@krj.st>
Date: Thu Jul 21 03:27:10 2022 +0000
fix ringbuffer thread safety on ARM. fix#715#388
This patch addresses the thread safety problem of `jack_ringbuffer_t`
mentioned in #715 and #388. The overbound read bug caused by this problem
is impossible to reproduce on x86 due to its strong memory ordering, but
it is a problem on ARM and other weakly ordered architectures.
Basically, the main problem is that, on a weakly ordered architecture,
it is possible that the pointer increment after `memcpy` becomes visible
to the other thread before `memcpy` finishes:
memcpy (&(rb->buf[rb->write_ptr]), src, n1);
// vvv can be visible to reading thread before memcpy finishes
rb->write_ptr = (rb->write_ptr + n1) & rb->size_mask;
If this happens, the other thread can read the remaining garbage values
in `rb->buf` due to be overwritten by the unfinished `memcpy`.
To fix this, an explicit pair of release/acquire memory fences [1] is
used to ensure the copy on the other thread *happens after* the `memcpy`
finishes so no garbage values can be read.
[1]: https://preshing.com/20130922/acquire-and-release-fences/
The volatile constraints are excess when compiler barriers are present.
It generates unnecessary `mov` instructions when pointers aren't going
to be updated.
This patch addresses the thread safety problem of `jack_ringbuffer_t`
mentioned in #715 and #388. The overbound read bug caused by this problem
is impossible to reproduce on x86 due to its strong memory ordering, but
it is a problem on ARM and other weakly ordered architectures.
Basically, the main problem is that, on a weakly ordered architecture,
it is possible that the pointer increment after `memcpy` becomes visible
to the other thread before `memcpy` finishes:
memcpy (&(rb->buf[rb->write_ptr]), src, n1);
// vvv can be visible to reading thread before memcpy finishes
rb->write_ptr = (rb->write_ptr + n1) & rb->size_mask;
If this happens, the other thread can read the remaining garbage values
in `rb->buf` due to be overwritten by the unfinished `memcpy`.
To fix this, an explicit pair of release/acquire memory fences [1] is
used to ensure the copy on the other thread *happens after* the `memcpy`
finishes so no garbage values can be read.
[1]: https://preshing.com/20130922/acquire-and-release-fences/
Unless overriden during configure stage, autostart now defaults to
none.
This is safer approach for packagers wanting to provide both
jackdbus and jackd executables (via two distinct packages).
See also commit 35f4101850
The updated build.yml will be made to work on any linux distro,
not only debian derivates. While currently Ubuntu is provided at
github, a runner verifying the build for upstream should run
"./waf --configure && ./waf" steps instead of the deleted ones, that
were running Ubuntu specific steps.
When 14 years ago --dbus configure option was added to wscript,
I was affraid that deployments of builds configured with defaults will
get broken, so I kept jackd daemon enabled by default.
Since then the mixed jackd+jackdbus deployments had happened -
a bunch of distro packagers ignored the upstream configure time
warning and the JACK2 project suggested packaging approach that
strongly discouraged such deployments.
Another issue that has proven problematic is the configuration of
autolaunching capabilities. For the sake of robust jackdbus
deployments, I'm also enabling dbus autolaunching. This will ensure
that jackdbus daemon will work as designed and expected to behave.
This commit is first of several that will remove the jackd code
from the source tree. Then, jackdbus will be buildabe from
dedicated repo+branch for jackdbus source code only, to be built
against jack2 (with jackdbus stuff removed), installed system-wide and
libjackserver accessible through pkg-config.