Commit Graph

4201 Commits

Author SHA1 Message Date
falkTX 45042beac5 Make JackMachSemaphore more robust, dont use thread_terminate
Fixes #841
2022-04-15 20:02:58 +01:00
David Runge 5aa5861af0 Fix jack_control for flake8 compatibility
dbus/jack_control:
Remove unused imports for os and traceback.print_exc.
Fix indentation, whitespace and line length issues across the entire
file.
Simplify printing in `print_help()` by calling `print()` only once.
2022-04-13 22:57:52 +01:00
David Runge b5ca229866 Run flake8 on all wscript files and on jack_control
.github/workflows/lint.yml:
Ensure that flake8 in CI is run on all wscript files and on
jack_control.
2022-04-13 22:57:52 +01:00
falkTX 88102ec4a7
Bump version to 1.9.21
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 19:02:09 +01:00
falkTX ac00dee3ae
Fix ubuntu-20.04 CI test
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 18:44:24 +01:00
falkTX fc82bfc572 Update changelog
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 18:44:07 +01:00
nick87720z 3a19b628f8
jack_control - shell mode and update (#821)
* jack_control: move to tools for a while

* jack_control: shell mode command

This command runs loop, which executes commands from stdin until EOF
(Ctrl+D in terminal). Command status is printed to stdout.

* jack_control: optimize some functions

* jack_control: unused function

* jack_control: more informative message about dbus typesig error

* jack_control: Fix shell mode I/O

* restore jack_control path
2022-04-13 18:31:49 +01:00
David Runge aa27576236
Fix wscripts syntax (#826)
* 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.
2022-04-13 18:29:29 +01:00
Be cceca54255
fix JackWeakAPI on Windows (#846)
* 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
2022-04-13 18:25:47 +01:00
falkTX 84d80c0a8c
Make sure CI builds do not use LTO
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 17:43:16 +01:00
falkTX 61f0d4accb
Update changelog, fixup for CI builds
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 17:38:08 +01:00
falkTX c9d8173d27
Make example-tools off by default
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 17:24:02 +01:00
falkTX 6af0909e1d
Make example-tools off by default
Signed-off-by: falkTX <falktx@falktx.com>
2022-04-13 17:21:30 +01:00
Florian Walpen 4c55ca8be0 Missing check for graph manager in JackAPI.
This seems to be the only place where the result of GetGraphManager() is
not checked for null, at least in JackAPI. Found by llvm scan-build.
2022-04-07 15:20:45 +01:00
Florian Walpen 84a21a8cb9 Bad semaphore allocation in midi_latency_test.
The code did a pointer-sized heap allocation instead of the actual size
of a semaphore struct sem_t. This could result in heap memory corruption
when handling the semaphore.
Found by llvm scan-build.
2022-04-07 15:20:45 +01:00
Florian Walpen d8f59c2f80 Fix bad deallocation in JackMidiAsyncQueue.
The code is only run when other allocations fail, fix it anyway.
This was found by llvm scan-build.
2022-04-07 15:20:45 +01:00
Andreas Pape 58194d90f4 JackFifo: Apply given init value in allocate
When using as sync opbject the given 'value' is meant to
already 'unblock' for that amount of Wait calls.

Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
2022-03-29 11:49:24 +01:00
Biswapriyo Nath 3a5e040155 pkgconfig: Use predefined variables in Libs and Cflags
This fixes path relocation in mingw environment. Without this,
libdir and includedir are not shown in pkgconfig output. e.g.
* Without predefined variables:
  - pkgconf -cflags jack: No output
  - pkgconf -libs jack: -ljack64
* With predefined variables:
  - pkgconf -cflags jack: -IC:/msys64/mingw64/include
  - pkgconf -libs jack: -LC:/msys64/mingw64/lib -ljack64

Also official documentation suggests to use variables
https://people.freedesktop.org/~dbn/pkg-config-guide.html
2022-02-17 18:28:09 +00:00
Florian Walpen 21b293dbc3 Fix alignas() on non-packed architectures (#839).
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.
2022-02-08 18:59:46 +00:00
Alexis Murzeau 3d681a3a99 installer: add qwindowsvistastyle.dll for QJackCtl
This DLL is required to have a proper Qt skin on Windows.
2022-01-27 22:18:21 +00:00
Florian Walpen 37d6369ad3
FreeBSD: Cleanup unused SNDCTL_AUDIOINFO code.
Fixes a scan-build warning about using uninitialized values.
2022-01-22 21:40:40 +01:00
Guido Aulisi 9beb02d828 Fix build of jack-example-tools man pages
Commit e8c0be1ce9 changed the name
of the configuration environment to build the jack-example-tools,
but forgot to change it for man pages.
2022-01-16 20:44:43 +00:00
Florian Walpen 2980933a80 API: Export missing symbols to jack library.
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.
2022-01-16 17:17:15 +01:00
falkTX a2fe7ec2fd Update Changelog
Signed-off-by: falkTX <falktx@falktx.com>
2022-01-15 15:09:56 +00:00
Claudio Cabral 719fa1d545 Add 32 bit support for ALSA driver (#811)
* 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>
2022-01-15 15:09:56 +00:00
Alexander Traud e2ad1e40cf Fix grouping for latest doxygen.
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.
2022-01-15 15:09:56 +00:00
Aleksandr Beliaev d4d464e2b1 Override permission issues by separating users metadata 2022-01-15 15:09:56 +00:00
Florian Walpen a1ea8a9bb5 FreeBSD: Add missing OSS option --excl to man page.
While there, also improve the short description of this option in the
OSS backend part of usage help and jack_control.
2022-01-15 15:09:56 +00:00
Florian Walpen 54217a5d8d CI: Bogus install prefix in FreeBSD Cirrus CI.
Apparently the ${HOME} variable is set to the filesystem root "/" in
Cirrus CI FreeBSD instances. Just create an installation directory
without it, then.

While here, set --pkgconfigdir to closely mimick the build in the
FreeBSD ports tree.
2022-01-15 15:09:56 +00:00
falkTX e332bd7e72 Update changelog
Signed-off-by: falkTX <falktx@falktx.com>
2022-01-15 15:09:56 +00:00
Florian Walpen ea359377fc CI: Add FreeBSD builds through Cirrus CI.
When the github application Cirrus CI (https://cirrus-ci.org/) is
installed, this build description file adds FreeBSD build checks to
changes and PRs in github.

There are four build tasks currently, a minimal build and one with all
options enabled on two different FreeBSD versions.
2022-01-15 15:09:56 +00:00
falkTX ffde5f7863 CI: use full list of bad packages, for posterity
Signed-off-by: falkTX <falktx@falktx.com>
2022-01-15 15:09:56 +00:00
falkTX ce575b3b81 Add back IRC notifications
Signed-off-by: falkTX <falktx@falktx.com>
2022-01-15 15:09:56 +00:00
Filipe Coelho 300692b051 Update CI setup (#832)
* CI: Build with latest PawPaw and LTO

Signed-off-by: falkTX <falktx@falktx.com>

* Ensure LTO is not enabled

Signed-off-by: falkTX <falktx@falktx.com>

* Finalize changes

Signed-off-by: falkTX <falktx@falktx.com>
2022-01-15 15:09:56 +00:00
David Runge 8d7faa5bea Move jack_control to dbus (#831)
* Move jack_control to dbus dir

dbus/jack_control:
The `jack_control` script is dbus specific and not part of the original
jack tools. As the files offered by jack-example-tools are now
optionally not built, the script needs to be made available from a
location, that is not ignored when omitting the build of
jack-example-tools files.

* Move installation of jack_control to dbus integration

dbus/wscript:
Install `jack_control` script if building/installing jackdbus.

tools/wscript:
Remove (unconditional) installation of `jack_control` script.
2022-01-15 15:09:56 +00:00
Filipe Coelho 4dec157f60 Fix CI windows builds (#830)
* Alternative attempt at fixing CI

Signed-off-by: falkTX <falktx@falktx.com>

* Cleanup

Signed-off-by: falkTX <falktx@falktx.com>

* Forgot apt-get update

Signed-off-by: falkTX <falktx@falktx.com>
2022-01-15 15:09:56 +00:00
David Runge e8c0be1ce9 Fix build of jack-example-tools with waf autooptions
wscript:
In 61a708f2c6873881ae36fa2f01b38a15bfc3f681 a regression has been
introduced, that always leads to not building the jack-example-tools
(even if selected).
This has been introduced due to the use of the wrong configuration
environment `HAVE_JACK_EXAMPLE_TOOLS`, whereas it should have been
`BUILD_JACK_EXAMPLE_TOOLS`.
2022-01-15 15:09:56 +00:00
David Runge ef2a0d3b79 Remove unused travis ci integration
.{ci/*,travis.yml}:
Remove unused travis-ci integration.
2022-01-15 15:09:56 +00:00
David Runge d02211614f Remove unused script
svnversion_regenerate.sh:
Remove unused script.
2022-01-15 15:09:56 +00:00
David Runge 3d6fd78701 Remove use of svnversion_regenerate.sh
dbus/jackdbus.c:
Rely on the `JACK_VERSION` define instead of `SVN_VERSION` (included
from svnversion.h).

dbus/wscript:
Add the `JACK_VERSION` define based on `JACK_VERSION` configuration.

wscript:
Remove all code related to the use of `svnversion.h` and
`svnversion_regenerate.sh`.
2022-01-15 15:09:56 +00:00
David Runge 8566d4a630 Add changelog entry for optional example tools
ChangeLog.rst:
Add changelog entry for new configure option to allow not to build
files provided by jack-example-tools.
2022-01-15 15:09:56 +00:00
David Runge 508d95a97e Allow optional build of jack-example-tools
wscript:
Add option `--example-tools` to allow optional build of executables and
libraries provided by jack-example-tools (defaults to True).
It can be used as `--example-tools=yes|no` or `--no-example-tools` or
plain `--example-tools`.
Based on the new option, set the configuration environment variable
`HAVE_JACK_EXAMPLE_TOOLS` which is used throughout the configuration
and build steps to include the `example-clients`, `tools` and `tests`
subdirectories.

man/wscript:
Provide the `HAVE_JACK_EXAMPLE_TOOLS` build environment variable to the
`fill_template` script as second argument.
Remove unused imports.

man/fill_template:
Change the behavior of the script to only create all man pages if the
second argument to the script is `True` (the jack-example-tools are
being built), else only create the man page for jackd.
2022-01-15 15:09:56 +00:00
David Runge 810c78e349 Add custom variable to jack pkgconfig to distinguish implementations
jack.pc.in:
Add the custom `jack_implementation=jack2` pkgconfig variable to the
generated jack.pc file to be able to distinguish jack implementations.
As jack implementations exist with jack1, jack2 and pipewire-jack, it is
not (easily) possible to distinguish them by looking at the version
alone (particularly the case with jack2 vs. pipewire-jack, as they share
the same headers).
2022-01-15 15:09:56 +00:00
Florian Walpen 655ff5e4e1 POSIX: Remove unnecessary feature test macro.
This is a no-op since the line was already commented out, to make it
compile on FreeBSD. But it deserves an explanation:

The _POSIX_C_SOURCE macro is meant to restrict the C library to a
certain POSIX standard, not to enable features. This is inappropriate
here because:

1. Jack already uses non-POSIX functions. E.g. JackPosixSemaphore.cpp
   references gettimeofday(), which is part of the X/Open specs.

2. C++ does not define a POSIX level to be based on. Headers from the
   C++ standard library may (and do) break when the POSIX feature level
   is restricted.

The canonical way is to only set the feature level through the
"--std=gnu++11" compile options.
2022-01-15 15:09:55 +00:00
Florian Walpen b5597128c2 FreeBSD: Big driver overhaul for FreeBSD OSS.
Features:
 * Internal workings more in line with other Jack drivers.
 * Use poll() for wait and sync instead of blocking I/O.
 * Allows to use Jack in "async" mode.
 * Calculate DSP usage correctly.
 * OSS buffer management to achieve stable latencies.
 * Latency correction for asymmetric OSS buffer use.
 * More robust handling of over- and underruns.
 * Handle format changes forced by the OSS interface.
 * FreeBSD 24bit samples are always packed.

No changes to the driver parameters or the user interface.
2022-01-15 15:09:55 +00:00
Florian Walpen b6f93234ef FreeBSD: Specific FreeBSD OSS driver.
Start with an unchanged copy of the Solaris OSS driver.
2022-01-15 15:09:55 +00:00
Florian Walpen 2e3c6fab02 FreeBSD: Use uptime.h relay include. 2022-01-15 15:09:55 +00:00
Florian Walpen 7c81691e38 FreeBSD: Use driver.h relay include. 2022-01-15 15:09:55 +00:00
Florian Walpen f94f285ca5 FreeBSD: Cleanup tab indents. 2022-01-15 15:09:55 +00:00
Goran Mekić 25e09df3a6 It compiles 2022-01-15 15:09:55 +00:00