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
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. !!
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);
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>
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.
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.