Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jack2 iodelay.cpp #25

Merged
merged 15 commits into from
Dec 31, 2021
Merged

Jack2 iodelay.cpp #25

merged 15 commits into from
Dec 31, 2021

Conversation

dvzrv
Copy link
Collaborator

@dvzrv dvzrv commented Dec 12, 2021

Add jack2 variant of tools/iodelay.c, iodelay.cpp, which had been
imported to a different location with additional modifications, which
makes a simple rebase impossible.
Adapt meson build file to rename of tools/iodelay.c to
tools/iodelay.cpp.

Relates to #9

tools/iodelay.c:
Remove the original iodelay.c as the jack2 variant had been imported to
another location (with added modifications and shifting names), making a
rebase impossible.
@dvzrv dvzrv added the enhancement New feature or request label Dec 12, 2021
@dvzrv dvzrv requested a review from falkTX December 12, 2021 18:32
@dvzrv dvzrv self-assigned this Dec 12, 2021
sletz and others added 14 commits December 13, 2021 21:32
git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@1205 0c269be4-1314-0410-8aa9-9f06e86f4224
…if clients are actually realtime, that is have setup any of the RT callback.

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2279 0c269be4-1314-0410-8aa9-9f06e86f4224
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.
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>
tools/meson.build:
Adapt meson build file to rename of tools/iodelay.c to
tools/iodelay.cpp.
@falkTX falkTX merged commit a2a4988 into main Dec 31, 2021
@falkTX falkTX deleted the jack2_iodelay branch December 31, 2021 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants