Commit Graph

150 Commits

Author SHA1 Message Date
Karl Linden 69b04bee68 License the project clearly
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.
2022-09-10 13:33:46 +03: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
Goran Mekić 5c667d5282 Add FreeBSD support 2022-01-15 15:09:55 +00:00
luz paz 0fe68adecc Fix misc. typos
Found via `codespell -q 3 -L capela,nd,numer,parm`
2021-06-30 09:11:21 +01:00
falkTX 93619ed0c5 Make sure we use python3 (another patch from Fedora) 2019-10-28 11:38:21 +01:00
luz.paz a93b210134 FIx doxygen and user facing and non-facing typos
Found via `codespell -q 3`
2019-09-11 19:17:07 +01:00
Thomas Brand be77f9e4f8 Add script to test jack_property (Metadata)
Running script 'jack_property_test.sh' with recent jack1 and jack2 git builds show different results.
Notes:
	-jack1 gives only false positives due to a small text change
	-jack2 has issues using client name as subject/identifier/uuid
		-> see '**      FAILED' lines
	-jack1 is much faster in performing the same script
	-running the script in a loop causes memory problems with jack2

output running with jack1:

test system_c1: jack_property -D
	OK: 0
**	FAILED: JACK metadata successfully delete
**	EXP EQ: JACK metadata successfully deleted
test system_c2: jack_property -l
	OK: 0
	OK:
test system_c3: jack_property -c -l system
	OK: 0
	OK:
test system_c4: jack_property -c -s system client_key client_value
	OK: 0
	OK:
test system_c5: jack_property -c -l system
	OK: 0
	OK: key: client_key value: client_value
test system_c6: jack_property -c -l system client_key
	OK: 0
	OK: client_value
test system_c7: jack_property -l
	OK: 0
	OK: key: client_key value: client_value
test system_c8: jack_property -p -l system:non
	OK: 0
	OK: cannot find port name system:non
test system_p1: jack_property -D
	OK: 0
**	FAILED: JACK metadata successfully delete
**	EXP EQ: JACK metadata successfully deleted
test system_p2: jack_property -l
	OK: 0
	OK:
test system_p3: jack_property -p -l system:playback_1
	OK: 0
	OK:
test system_p4: jack_property -p -s system:playback_1 port_key port_value
	OK: 0
	OK:
test system_p5: jack_property -p -l system:playback_1
	OK: 0
	OK: key: port_key value: port_value
test system_p6: jack_property -p -l system:playback_1 port_key
	OK: 0
	OK: port_value
test system_p7: jack_property -p -d system:playback_1 port_key
	OK: 0
	OK:
test system_p8: jack_property -p -l system:playback_1 port_key
	OK: 0
	OK: Value not found for port_key of system:playback_1
test system_p9: jack_property -p -d system:playback_1 port_key
	OK: 0
	OK: "port_key" property not removed for system:playback_1
test system_p10: jack_property -p -l system:playback_1
	OK: 0
	OK:
test system_p11: jack_property -p -l system:playback_1 non
	OK: 0
	OK: Value not found for non of system:playback_1
test system_p12: jack_property -c -l non
	OK: 0
	OK: cannot get UUID for client named non
metro:120_bpm
test metro_c1: jack_property -D
	OK: 0
**	FAILED: JACK metadata successfully delete
**	EXP EQ: JACK metadata successfully deleted
test metro_c2: jack_property -l
	OK: 0
	OK:
test metro_c3: jack_property -c -l metro
	OK: 0
	OK:
test metro_c4: jack_property -c -s metro client_key client_value
	OK: 0
	OK:
test metro_c5: jack_property -c -l metro
	OK: 0
	OK: key: client_key value: client_value
test metro_c6: jack_property -c -l metro client_key
	OK: 0
	OK: client_value
test metro_c7: jack_property -l
	OK: 0
	OK: key: client_key value: client_value
test metro_c8: jack_property -p -l metro:non
	OK: 0
	OK: cannot find port name metro:non
test metro_p1: jack_property -D
	OK: 0
**	FAILED: JACK metadata successfully delete
**	EXP EQ: JACK metadata successfully deleted
test metro_p2: jack_property -l
	OK: 0
	OK:
test metro_p3: jack_property -p -l metro:120_bpm
	OK: 0
	OK:
test metro_p4: jack_property -p -s metro:120_bpm port_key port_value
	OK: 0
	OK:
test metro_p5: jack_property -p -l metro:120_bpm
	OK: 0
	OK: key: port_key value: port_value
test metro_p6: jack_property -p -l metro:120_bpm port_key
	OK: 0
	OK: port_value
test metro_p7: jack_property -p -d metro:120_bpm port_key
	OK: 0
	OK:
test metro_p8: jack_property -p -l metro:120_bpm port_key
	OK: 0
	OK: Value not found for port_key of metro:120_bpm
test metro_p9: jack_property -p -d metro:120_bpm port_key
	OK: 0
	OK: "port_key" property not removed for metro:120_bpm
test metro_p10: jack_property -p -l metro:120_bpm
	OK: 0
	OK:
test metro_p11: jack_property -p -l metro:120_bpm non
	OK: 0
	OK: Value not found for non of metro:120_bpm
test metro_p12: jack_property -c -l non
	OK: 0
	OK: cannot get UUID for client named non
JACK metadata successfully delete
./jack_property_test.sh: line 215: 21025 Hangup                  jack_metro -b120
done, exit status is 1

real	0m1.011s
user	0m0.125s
sys	0m0.324s

==========================================
output running with jack2:

test system_c1: jack_property -D
	OK: 0
	OK: JACK metadata successfully deleted
test system_c2: jack_property -l
	OK: 0
	OK:
test system_c3: jack_property -c -l system
	OK: 0
	OK:
test system_c4: jack_property -c -s system client_key client_value
	OK: 0
	OK:
test system_c5: jack_property -c -l system
	OK: 0
	OK: key: client_key value: client_value
test system_c6: jack_property -c -l system client_key
	OK: 0
	OK: client_value
test system_c7: jack_property -l
	OK: 0
	OK: key: client_key value: client_value
test system_c8: jack_property -p -l system:non
	OK: 0
	OK: cannot find port name system:non
test system_p1: jack_property -D
	OK: 0
	OK: JACK metadata successfully deleted
test system_p2: jack_property -l
	OK: 0
	OK:
test system_p3: jack_property -p -l system:playback_1
	OK: 0
	OK:
test system_p4: jack_property -p -s system:playback_1 port_key port_value
	OK: 0
	OK:
test system_p5: jack_property -p -l system:playback_1
	OK: 0
	OK: key: port_key value: port_value
test system_p6: jack_property -p -l system:playback_1 port_key
	OK: 0
	OK: port_value
test system_p7: jack_property -p -d system:playback_1 port_key
	OK: 0
	OK:
test system_p8: jack_property -p -l system:playback_1 port_key
	OK: 0
	OK: Value not found for port_key of system:playback_1
test system_p9: jack_property -p -d system:playback_1 port_key
	OK: 0
	OK: "port_key" property not removed for system:playback_1
test system_p10: jack_property -p -l system:playback_1
	OK: 0
	OK:
test system_p11: jack_property -p -l system:playback_1 non
	OK: 0
	OK: Value not found for non of system:playback_1
test system_p12: jack_property -c -l non
	OK: 0
	OK: cannot get UUID for client named non
metro:120_bpm
test metro_c1: jack_property -D
	OK: 0
	OK: JACK metadata successfully deleted
test metro_c2: jack_property -l
	OK: 0
	OK:
test metro_c3: jack_property -c -l metro
**	FAILED: 255
**	EXP EQ: 0
**	FAILED: cannot parse client UUID as UUID
**	EXP EQ:
test metro_c4: jack_property -c -s metro client_key client_value
**	FAILED: 255
**	EXP EQ: 0
**	FAILED: cannot parse client UUID as UUID
**	EXP EQ:
test metro_c5: jack_property -c -l metro
**	FAILED: 255
**	EXP EQ: 0
**	FAILED: cannot parse client UUID as UUID
**	EXP EQ: key: client_key value: client_value
test metro_c6: jack_property -c -l metro client_key
**	FAILED: 255
**	EXP EQ: 0
**	FAILED: cannot parse client UUID as UUID
**	EXP EQ: client_value
test metro_c7: jack_property -l
	OK: 0
**	FAILED:
**	EXP EQ: key: client_key value: client_value
test metro_c8: jack_property -p -l metro:non
	OK: 0
	OK: cannot find port name metro:non
test metro_p1: jack_property -D
	OK: 0
	OK: JACK metadata successfully deleted
test metro_p2: jack_property -l
	OK: 0
	OK:
test metro_p3: jack_property -p -l metro:120_bpm
	OK: 0
	OK:
test metro_p4: jack_property -p -s metro:120_bpm port_key port_value
	OK: 0
	OK:
test metro_p5: jack_property -p -l metro:120_bpm
	OK: 0
	OK: key: port_key value: port_value
test metro_p6: jack_property -p -l metro:120_bpm port_key
	OK: 0
	OK: port_value
test metro_p7: jack_property -p -d metro:120_bpm port_key
	OK: 0
	OK:
test metro_p8: jack_property -p -l metro:120_bpm port_key
	OK: 0
	OK: Value not found for port_key of metro:120_bpm
test metro_p9: jack_property -p -d metro:120_bpm port_key
	OK: 0
	OK: "port_key" property not removed for metro:120_bpm
test metro_p10: jack_property -p -l metro:120_bpm
	OK: 0
	OK:
test metro_p11: jack_property -p -l metro:120_bpm non
	OK: 0
	OK: Value not found for non of metro:120_bpm
test metro_p12: jack_property -c -l non
	OK: 0
	OK: cannot get UUID for client named non
JACK metadata successfully deleted
signal received, exiting ...
done, exit status is 1

real	0m2.806s
user	0m0.176s
sys	0m0.374s
2019-02-08 17:27:12 +01:00
Thomas Brand 888759347d Test: exclude tests using deprecated functions for now. 2019-01-27 13:53:31 +01:00
Thomas Brand 54e03c12af add another testcase for client name 2019-01-27 06:22:18 +01:00
Thomas Brand 9753f71069 NO-OP whitespace / indentation 2019-01-27 05:59:10 +01:00
Thomas Brand 1050436b33 Use memset to fill buffer. Add test marker.
Notes:
The name length test still fails.

jack_client_open() will only allow 63 printable chars (unlike expected 64 == JACK_CLIENT_NAME_SIZE).
This difference isn't explained by the terminating NULL character. jack_client_name_size() takes care of that (returns JACK_CLIENT_NAME_SIZE + 1).
char arrays are initialized like arr[JACK_CLIENT_NAME_SIZE + 1] in many files und truncated like arr[JACK_CLIENT_NAME_SIZE].

Probable reason for 63: ':' is part of the client name and implicitely added later.
Name used by caller does not include ':' thus jack_client_open() will allow only JACK_CLIENT_NAME_SIZE - 1 printable chars.

This line in common/JackConstants.h gives a hint that ':' might be counted in for JACK_CLIENT_NAME_SIZE
#define REAL_JACK_PORT_NAME_SIZE JACK_CLIENT_NAME_SIZE + JACK_PORT_NAME_SIZE // full name like "client_name:short_port_name"

Currently many char arguments are described like
@param client_name of at most jack_client_name_size() characters

This can be confusing in two ways:
-jack_client_name_size() does include the NULL so it's one less 'payload' character
-if the returned size is used exactly as described for function jack_client_name_size() including NULL,
it won't work with jack_client_open() or jack_port_register() etc. because of another reduction (eventually for the ":").

!! This needs to be verified and documentation needs to be reviewed. !!
2019-01-26 04:26:10 +01:00
Thomas Brand 667e06890e Fix off-by-one NULL termination in array
Note: the client name length test still fails, this is a different issue.
2019-01-26 03:54:00 +01:00
falkTX 7dfdbe133a
Cleanup some warnings
Signed-off-by: falkTX <falktx@gmail.com>
2018-11-13 23:01:23 +01:00
Karl Linden f5f22c6bef
Revert "Fix unused{,-but-set}-variable compiler warnings."
This reverts commit dde9f29a8e.

The commit introduced the following compiler error:

[100/255] Compiling posix/JackNetUnixSocket.cpp
../posix/JackNetUnixSocket.cpp: In member function 'int Jack::JackNetUnixSocket::NewSocket()':
../posix/JackNetUnixSocket.cpp:126:32: error: 'tos' was not declared in this scope
         socklen_t len = sizeof(tos);
2018-10-06 13:15:11 +02:00
Karl Linden dde9f29a8e Fix unused{,-but-set}-variable compiler warnings. 2018-10-06 12:57:32 +02:00
Adrian Knoth 6ccfdc1058 Mass-fix spelling errors
Flagged by the Debian QA tool.

Mostly automatic search-n-replace of the mistakes flagged.
2018-02-25 18:47:52 +01:00
Kjetil Matheussen f7bccdca65 Tests: Fix compilation with gcc7 2017-07-15 13:21:59 +02:00
Karl Linden c21c774855
waf: Nitpick styling for consistency. Fixes #172. 2017-06-16 16:47:22 +02:00
Adrian Knoth 0ca2539f5c Merge pull request #229 from rahul-bedarkar/fix-build-with-glibc
tests: define __STDC_LIMIT_MACROS
2017-03-12 20:24:24 +01:00
Adrian Knoth e0281d82c2 Merge pull request #190 from jackaudio/waf-macosx-fixes
Waf macosx fixes
2017-02-28 11:21:04 +01:00
Rahul Bedarkar 1dc83fd7de tests: define __STDC_LIMIT_MACROS
With glibc 2.16, we get following build error when building jack2:

  [193/247] cxx: tests/iodelay.cpp -> build/tests/iodelay.cpp.4.o
  ../tests/iodelay.cpp:171:43: error: 'UINT32_MAX' was not declared in this scope
  ../tests/iodelay.cpp:171:55: error: 'UINT32_MAX' was not declared in this scope
  ../tests/iodelay.cpp:172:44: error: 'UINT32_MAX' was not declared in this scope
  ../tests/iodelay.cpp:172:56: error: 'UINT32_MAX' was not declared in this scope

In glibc 2.17 or older version, Header <stdint.h> defines these macros
for C++ only if explicitly requested by defining __STDC_LIMIT_MACROS.

We can't use <cstdint> since it requires C++11 standard.

This build issue found by Buildroot autobuilder.
http://autobuild.buildroot.net/results/369/369ce208ffea43dad75ba0a13469159b341e3bf5/

Signed-off-by: Rahul Bedarkar <rahul.bedarkar@imgtec.com>
2016-08-27 23:02:07 +05:30
Adrian Knoth ff1ed2c452 Fix initialization in test/iodelay.cpp
jack_latency_range_t is

struct _jack_latency_range {
    jack_nframes_t min;
    jack_nframes_t max;
};

and jack_nframes_t is

typedef uint32_t        jack_nframes_t;

so it's unsigned. Initialising it with -1 is invalid (at least in C++14). We cannot use {0, 0}, because latency_cb has

   jack_latency_range_t range;
   range.min = range.max = 0;
   if ((range.min != capture_latency.min) || (range.max !=
       capture_latency.max)) {
       capture_latency = range;
   }

so we must not have {0, 0}, otherwise the condition would never be true.

Using UINT32_MAX should be equivalent to the previous -1.
2016-06-11 09:16:47 +02:00
Karl Linden af99165ef6
Drop problematic CPPFLAGS for MacOSX. 2015-12-13 20:50:59 +01:00
falkTX 05216197b4 Make JackPortRenameCallback return void, to match JACK1 API
JACK2 added this function first, but the int return has been always wrong.
When JACK1 added JackPortRenameCallback it used the proper return.

Now that JACK1 supports port renames, devs will start to use it.
(previously it didn't work properly because of the missing jack_client_t* arg)

Some code might be broken because of this, but it's a very simple change,
and existing code would have been broken when changing JACK1 to JACK2.

Finally, JACK2 code never uses the int return value of this callback.
So there's no real reason to NOT change this.
2015-07-19 18:49:06 +02:00
Stephane Letz 76491d3bc5 Add more tests for client registration code in test.cpp. 2013-01-26 19:04:15 +01:00
Stephane Letz bebd4d3d69 Make API test more robust. 2013-01-24 18:42:50 +01:00
Stephane Letz e4730c6c97 Fix some incoherency with strings. 2013-01-14 16:29:53 +01:00
Stephane Letz 4ab01b7c94 Correct jack_test for jack_port_name_size. 2013-01-14 14:53:36 +01:00
Stephane Letz 07223bc460 Add tests to check jack_client_name_size and jack_port_name_size API. 2013-01-12 14:16:37 +01:00
Stephane Letz 67ac44402f merge new MTDM code from Fons' latest release. 2012-11-08 15:07:45 +01:00
Stephane Letz 6483c0d5eb New jack_get_cycle_times() implementation from Fons Adriennsen. 2012-03-21 10:21:21 +01:00
Stephane Letz 94cb2ee9a1 Compiles again on Windows. 2012-03-20 18:40:59 +01:00
Stephane Letz 4a289f48d9 Correct JackMessageBuffer::SetInitCallback. 2012-03-20 18:17:57 +01:00
Nedko Arnaudov cc271ca187 Merge branch 'master' into python3-waf-upgrade 2012-03-18 01:00:31 +02:00
Stephane Letz 4f0474f334 Correct debug targets on Windows, use jack_free in test.cpp. 2012-02-22 18:16:27 +01:00
Nedko Arnaudov 329d83c92b swtich from uselib/uselib_local to use 2012-02-15 21:36:44 +02:00
Nedko Arnaudov 971b1656d5 switch from bld.new_task_gen() to bld()
jackdbus needs explicit index because device reservation code
is shared with jackd and waf cannot autodetect this.
2012-02-15 21:30:55 +02:00
Adrian Knoth e689393daa wscript: fix indentation error 2012-02-12 14:15:22 +01:00
Adrian Knoth 58036bc80f Run 2to3 on all wscript files.
Automatically upgrading to python3 syntax, where possible.
2012-02-09 18:13:53 +01:00
sletz 9f4df15abb Factorize code the server/client request.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4684 0c269be4-1314-0410-8aa9-9f06e86f4224
2012-01-11 12:51:53 +00:00
sletz 85df85f520 Fix for compilation on Solaris.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4670 0c269be4-1314-0410-8aa9-9f06e86f4224
2012-01-06 09:50:43 +00:00
sletz f0a9512dd7 Improve some of example-clients, cleanup.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4610 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-11-25 15:53:25 +00:00
Stephane Letz 734e450924 NetJack2 code cleanup. 2011-11-04 14:47:54 +01:00
sletz 6faac69942 Use jack_free instead of free.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4548 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-10-11 18:27:05 +00:00
sletz b1185fcc9f Fix compilation of iodelay.cpp.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4489 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-07-15 12:25:26 +00:00
sletz 885a6b7cf2 Make the printed output of jack_iodelay more useful to actual users.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4488 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-07-13 17:54:40 +00:00
sletz f601a06930 Merge remote-tracking branch 'cz/wscript_mac_fixes'
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4367 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-05-02 07:00:50 +00:00
nedko 08876bd6eb fix compile warnings
gcc (Gentoo 4.4.5 p1.2, pie-0.4.5) 4.4.5

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4363 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-04-30 08:05:09 +00:00
Nedko Arnaudov c420e6508e wscript: on macos build for x86_64 as well 2011-04-23 04:30:31 +03:00
sletz f942ca2284 Correct linking issues.
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@4288 0c269be4-1314-0410-8aa9-9f06e86f4224
2011-04-08 11:30:59 +00:00