* Add flake8 configuration
.flake8:
Add flake8 configuration that limits the line length to 120 chars and
outputs to flake8.txt
* Add flake8.txt to gitignore
.gitignore:
Add flake8.txt (flake8 output file) to ignore.
* Syntax fixes and cleanup for top-level wscript
wscript:
Fix syntax of wscript according to pep8 (but do not break long lines).
Remove unused imports and move all module level imports to the top of
the file.
Fix broken build target of IIO driver (source argument to
`create_driver_obj()` supplied an uninitialized variable).
Break lines at 120 chars.
* Fix common/wscript syntax
common/wscript:
Fix syntax problems, unneeded imports and break lines at 120 chars.
* Fix compat/alloca/wscript syntax
compat/alloca/wscript:
Fix compat/alloca/wscript syntax
* Fix compat/wscript syntax
compat/wscript:
Fix compat/wscript syntax
* Fix dbus/wscript syntax
dbus/wscript:
Fix syntax and break lintes at 120 chars.
* Fix example-clients/wscript syntax
example-clients/wscript:
Fix syntax and remove commented code.
* Fix tests/wscript syntax
tests/wscript:
Fix syntax and commented code.
* Fix tools/wscript syntax
tools/wscript:
Fix tools/wscript syntax.
* Add github workflow for linting wscripts
.github/workflows/lint.yml:
Add github workflow for linting wscripts using findutils and flake8.
* Fix project version extraction in CI
.github/workflows/build.yml:
Adapt the project version extraction in CI to the syntax changes in
the top-level wscript.
* JackWeakAPI: fix DLL loading on Windows
LoadLibrary takes a LPCWSTR (UTF16). LoadLibraryA is needed to
work with ASCII C string literals.
* JackWeakAPI: call tryload_libjack if it hasn't been called already
On non-Windows tryload_libjack is loaded on startup with
__attribute__((constructor)) but with MSVC, Microsoft documentation
says to not load libraries in a DLL's initialization function:
https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-best-practices
* JackWeakAPI: add debugging message for Windows
Unbreak the build with Clang on architectures where JACK uses non-packed
data structures, like arm64 or powerpc. The alignment errors are exposed
there because:
* The non-packed data structures require 8 byte alignment.
* alignas() is not allowed to weaken alignment requirements to 4 bytes.
* Clang enforces this according to standard, GCC ignores it.
Use an additional alignas() specifier to let the compiler choose between
minimum alignment (packed) and "natural" alignment (non-packed). This is
both standard c++11 and compatible with older GCC, which does not
propagate alignment requirements of packed substructures properly.
The function pointers jack_error_callback and jack_info_callback are
offered by the jack.h header as non-weak API members, but they were not
exported to the jack library, only to the jackserver library.
This broke the Jack backend of the OpenAl Soft library when switching
from Jack1 to Jack2.
* apply changes without whitespace
* remove neon intrinsics and fix indentation
* update float_32 macro and fix misspellings
* check msbits to determine number of bits in alsa driver
* add better error messages and support for SND_PCM_FORMAT_S32_BE
* log when sample format is not equal to bits
Co-authored-by: Claudio Cabral <clca@bang-olufsen.dk>
Co-authored-by: Claudio Cabral <cl@udio.co>
Since doxygen 1.8.16, opening and closing a group must not be done as
C comment but as doxygen command. In other words, not one but two
asterisk characters are required so that doxygen finds a group.
* macOS: Pass JackMachSemaphore send right via mach_msg IPC
Previously, JackMachSemaphore would communicate the send right for the
semaphore object from the server to a client via a named service
registered via `bootstrap_register`. However, to do this, it would
register the semaphore's port as the service port directly.
In theory this ought to be fine, however in practice, macOS `launchd`,
which provides the `bootstrap_register` interface, does not correctly
detect when such a port becomes dead, and incorrectly believes that the
service that it provides is forever alive, even past the end of the
`jackd` process' (and therefore the semaphore's) existence. This seems
to be *specific* to semaphore ports, as `launchd` is expecting a
standard IPC port, owned by the task, not the kernel. This prevents
`jackd` from later registering another service with the same name, as
`launchd` rejects the registration as conflicting with an active service.
To get around this, `jackd` previously added a counter to the end of the
named service registrations, allowing old services to remain in the
system until the end of the session. To prevent things getting out of
hand, this was capped at 98 service registrations for a given semaphore
name. This led to #784, in which running a client for the 99th time
resulted in the semaphore creation failing and the client failing to
connect.
As `launchd` outlives multiple runs of `jackd`, this situation persisted
across restarts of `jackd`, requiring a restart of the user's session
(i.e. a reboot) to fix.
An initial attempt at fixing this (see #785) tried passing the port
rights directly via shared memory, however mach is too clever for us and
foils that plan by having port names be looked up in a per-task table
(sensible when you think about it).
In this commit, we use mach IPC messages to transfer the send right for
the semaphore from the server to the client. By registering a standard
IPC port with the bootstrap server, the service registrations are
correctly torn down when the ports are destroyed.
It works something like this:
* Server creates IPC port and registers it globally via `bootstrap_register`
* Server listens on IPC port for messages
* Client looks up IPC port via `bootstrap_look_up`
* Client sends it a message
* Server replies with a message containing a send right to the
semaphore's port
* Client is then free to use the semaphore port as before.
This resolves#784.
* Improve error handling
* Add myself to Authors
* Add jack_position_t::tick_double, and flags around it
Signed-off-by: falkTX <falktx@falktx.com>
* s/precision/resolution/
Signed-off-by: falkTX <falktx@falktx.com>
* Assert alignment is suitable for atomic accesses
* Move fields and pad to meet alignment constraints
* Add padding to JackEngineControl to account for inherited data
* Parenthesise padding length for clarity
* Revert "Parenthesise padding length for clarity"
This reverts commit 1f757b9ece.
* Revert "Add padding to JackEngineControl to account for inherited data"
This reverts commit 3d8c7d83ad.
* Revert "Move fields and pad to meet alignment constraints"
This reverts commit ff631bbbdc.
* Assure alignment by using 'alignas' on fields
FUTEX_WAIT may be interrupted by a signal and return EINTR. If a client
process takes a signal while on the futex, the jack client may error out
with no way to recover despite the signal being safe. Instead, retry if
errno is set to EINTR.
jack_port_get_latency_range only returns meaningful values after ports get
connected, and that is signalled via the latency callback. Saying that it's
normally used in callbacks is too soft, the docs should make it clear that the
function is not very useful outside of the callback, because you don't know
whether the port is connected / whether the latency values changed.
jack_port_get_latency_range only returns meaningful values after ports get
connected, and that is signalled via the latency callback. Saying that it's
normally used in callbacks is too soft, the docs should make it clear that the
function is not very useful outside of the callback, because you don't know
whether the port is connected / whether the latency values changed.
to ensure that it is not modified by any client.
const have internal linkage unless marked by extern
Change-Id: Ife1def2feb43aead32164f479e39ee3fd71b2ba0
Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>