Problem:
#set two properties for UUID 4294967296
$ jack_property -s 4294967296 "a" 1
$ jack_property -s 4294967296 b "2"
#-l lists them
$ jack_property -l
4294967296
key: b value: 2
key: a value: 1
#-l for UUID doesn't list them <<<<<<
$ jack_property -l 4294967296
$ jack_property -l 4294967296 a
Value not found for a of 4294967296
$ jack_property -l 4294967296 b
Value not found for b of 4294967296
#it seems that 3 chars is the minimum length for value when querying for UUID
$ jack_property -s 4294967296 a 123
$ jack_property -l 4294967296
key: a value: 123
$ jack_property -l 4294967296 a
123
In example-clients/property.c:
/* list all properties for a given UUID */
if ((cnt = jack_get_properties (uuid, &description)) < 0) {
fprintf (stderr, "could not retrieve properties for %s\n", subject);
exit (1);
}
cnt is always 0 for values < 3 chars. Why?
In common/JackMetadata.cpp:
int JackMetadata::GetProperty(jack_uuid_t subject, const char* key, char** value, char** type)
int JackMetadata::GetProperties(jack_uuid_t subject, jack_description_t* desc)
This loop gets results:
while ((ret = cursor->get (cursor, &key, &data, DB_NEXT)) == 0) {
but are dropped because of this check:
/* result must have at least 2 chars plus 2 nulls to be valid
if (data.size < 4) {
This rule isn't understood. Explanations are welcome!
Reducing the check to 2 (1 char + null) will consider single char values.
This makes listing properties for a given UUID the same keys as when listing all UUIDs and keys.
No side-effects of lowering the value has been detected (yet).
Note: there is no problem getting "short" values in this method:
int JackMetadata::GetAllProperties(jack_description_t** descriptions)
(as used by jack_property -l without UUID)
jack_property output after change to (data.size < 2):
$ jack_property -s 4294967296 "a" 1
$ jack_property -s 4294967296 b "2"
$ jack_property -l
4294967296
key: b value: 2
key: a value: 1
$ jack_property -l 4294967296
key: b value: 2
key: a value: 1
$ jack_property -l 4294967296 a
1
$ jack_property -l 4294967296 b
2
Note: This change should be considered also for JACK1 (libjack/metadata.c)
to keep implementations in sync.
Due to inlining and enabled optimization the compiler will not create
machine instructions for the if-clauses and left shift for
sample_move_dS_s32s() and sample_move_dS_s32().
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
Due to the optimization of the compiler this commit does not introduce any
differences in the machine instructions.
Tested with GCC version 6.2.0 on ARM64 and x86_64.
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
ALSA expects right-aligned samples (0x00******) as mentioned in the
source code for SND_PCM_FORMAT_S24_LE:
Signed 24 bit Little Endian using low three bytes in 32-bit word
See http://git.alsa-project.org/?p=alsa-
lib.git;a=blob;f=include/pcm.h;h=5b0782315585de1d5ab82c9f2036b62c168f5a48;hb=HEAD#l140
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
ALSA expects right-aligned samples (0x00******) as mentioned in the
source code for SND_PCM_FORMAT_S24_LE:
Signed 24 bit Little Endian using low three bytes in 32-bit word
See http://git.alsa-project.org/?p=alsa-
lib.git;a=blob;f=include/pcm.h;h=5b0782315585de1d5ab82c9f2036b62c168f5a48;hb=HEAD#l140
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
GCC defines __ARM_NEON__ for asimd on ARMv7 and __ARM_NEON for simd on
ARMv8. Therefore also check for __ARM_NEON.
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
When building with MXE, the macro expansion of PRIu64 fails:
../common/JackAPI.cpp: In function 'int jack_uuid_parse(const char*, jack_uuid_t*)':
../common/JackAPI.cpp:2119:24: error: expected ')' before 'PRIu64'
if (sscanf (b, "%" PRIu64, u) == 1) {
^
../common/JackAPI.cpp:2119:33: warning: spurious trailing '%' in format [-Wformat=]
if (sscanf (b, "%" PRIu64, u) == 1) {
^
../common/JackAPI.cpp:2119:33: warning: too many arguments for format [-Wformat-extra-args]
../common/JackAPI.cpp: In function 'void jack_uuid_unparse(jack_uuid_t, char*)':
../common/JackAPI.cpp:2134:45: error: expected ')' before 'PRIu64'
snprintf (b, JACK_UUID_STRING_SIZE, "%" PRIu64, u);
^
../common/JackAPI.cpp:2134:54: warning: spurious trailing '%' in format [-Wformat=]
snprintf (b, JACK_UUID_STRING_SIZE, "%" PRIu64, u);
^
../common/JackAPI.cpp:2134:54: warning: too many arguments for format [-Wformat-extra-args]
This could be resolved by adding those two lines:
#define __STDC_FORMAT_MACROS 1
#include <inttypes.h>
References:
https://stackoverflow.com/questions/14535556/why-doesnt-priu64-work-in-this-codehttps://stackoverflow.com/questions/8132399/how-to-printf-uint64-t-fails-with-spurious-trailing-in-format
* [metadata] Metadata properties implementation.
* [metadata] Fixed for shared server metadata-base accessor; alsofixed coding/naming style.
* [metadata] Fixed a tab for space.
* [metadata] Use of Berkeley DB is now truly optional on configure time.
* [metadata] Fixed tabs for spaces, again.
* [metadata] Fixed for shared metadata-base initialization and external clients.
* [metadata] Blind-fix for windows codebase.
* [metadata] Metadata API moved into client-side library only.
* [metadata] Fixed jack_port_uuid() stubbiness, now returning a proper UUID from port index.
* [metadata] Uniform method names.
* [metadata] Fixed PropertyChangeNotify through server async call.
This adds missing includes for alloca. The man page of alloca(3) states
that alloca.h should be #include'd to use alloca.
Also work around missing alloca.h header on Windows by adding a
compatibility module.
Closes: #197
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 this patch it is possibly to start the JACK daemon with a systemd
service file of type notify. The following provides an example service
file:
[Service]
Type=notify
ExecStart=/usr/bin/jackd -d alsa
[Install]
WantedBy=multi-user.target
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
The jack_group2gid() function does a thread-safe lookup of a unix gid from a
unix group name.
The jack_promiscuous_perms() function adjusts the permissions of a shared
resource (socket, semaphore, shm segment, ...) referenced by a fd and/or a
path so it can be used by any member of the provided unix group.
By using those functions it will be possible to enable a secure promiscuous
mode. 'Secure' meaning here that one is not forced to launch every clients
with a (way) too permissive 0000 umask.
* detect version option before all other oprion parsing
jackd now checks its arguments for "-V" and "--version" before all other
option parsing happens.
* remove some dead code from option parsing
Version options are detected before optparse runs, the removed code
paths thus became obsolete.
* remove rest of version option from optparse
Detection of the version option is now handled outside of optparse, thus
left over stings and variables are removed.
* switch to string comparison for detection version option
Demanding an exact match for the option strings reflects the original
behavior more closely than a search for substrings.
If configured with --clients=512 (translates to CLIENT_NUM), we exceed
the maximum stack size. CLIENT_NUM==500 still works, but let's allocate
the matrix on the heap to be safe.
Kudos to Markus Seeber for the initial bug triage.
Fixes#212