Commit Graph

196 Commits

Author SHA1 Message Date
Florian Walpen 886b35c3bd JackPosixProcessSync: Fix mutex owner on TimedWait() timeout.
Per POSIX definition, pthread_cond_timedwait() re-acquires the mutex
when a timeout occurs and ETIMEDOUT is returned. In that case also
mark the waiting thread as owner again, for consistency.
Otherwise subsequent attempts to unlock the mutex will fail, leaving
the mutex locked forever.
2023-12-09 20:32:37 +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
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
Goran Mekić 25e09df3a6 It compiles 2022-01-15 15:09:55 +00:00
Greg V 92e9596aa5 Put the clock_gettime based time impl into posix/ 2022-01-15 15:09:55 +00:00
Greg V 155d6ea3f9 Do not use O_RDWR on semaphores on FreeBSD
This is forbidden (returns EINVAL)
2022-01-15 15:09:55 +00:00
Greg V e5b5ee7bc9 Start semaphore names with a slash on FreeBSD 2022-01-15 15:09:55 +00:00
ihsinme ffdb275081 Update JackNetUnixSocket.cpp 2022-01-15 15:09:55 +00:00
Timo Wischer dd24ce3210 posix: fifo: use right prototype
Change-Id: Ia6aee61aa7059a70d2014f7de66a41cbaca8c7ed
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-09-13 01:31:44 +02:00
Timo Wischer c95bd9631f posix: socket: Add missing time header include
Change-Id: I1cab18816980f704b6ae73a37960c1421e46ed9b
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-06-30 11:52:13 +02:00
Adam Miartus 259a5ebc91 posix: remove frequent log in verbose mode
debug log with no additional informational benefit spams
output in verbose mode, therefore remove

Change-Id: Ifee01914a82a132a837e5e2caf6b7259700bda57
Signed-off-by: Adam Miartus <external.Adam.Miartus@de.bosch.com>
(cherry picked from commit 0b307cfca2cd072f6427b383fc7ea821fc46763a)
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-06-10 22:36:43 +02:00
Laxmi Devi c2e301703e JackFifo: Fix the fifo name in the jack_error log
Change-Id: I7a15b1b215c1e7c3fea3f59d4d54bc10565aee4d
Signed-off-by: Laxmi Devi <Laxmi.Devi@in.bosch.com>
Signed-off-by: Timo Wischer <twischer@de.adit-jv.com>
2020-06-10 22:32:56 +02:00
Henry Hu 6e94c67d0a use feature test macro correctly 2020-05-14 04:33:32 +01:00
Adam Miartus c1409c88ec jack: remove unnecessary GPL include from LGPL code
in this case LGPL code is compiled into one library with GPL code, but
the include is not necessary and may cause problems in case
these files are separated into their own library

Change-Id: I9fc2499d60d8f25a8714c7c39b7b36206d5c5cf5
Signed-off-by: Adam Miartus <external.adam.miartus@de.bosch.com>
2020-05-11 16:01:34 +01:00
Juuso Alasuutari 0ee218826b If pthread_setschedparam() in JackPosixThread::AcquireRealTimeImp() fails
try again with the SCHED_RESET_ON_FORK flag before giving up. This fixes
PulseAudio's JACK modules not being granted real-time scheduling.

Signed-off-by: Juuso Alasuutari <juuso.alasuutari@gmail.com>
2019-09-18 21:40:17 +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
Joseph A. Yasi dad4b57027 Set fSocket to -1 after close on an error to prevent a double close.
Signed-off-by: Joe Yasi <joe.yasi@gmail.com>
2019-06-19 12:40:43 +02:00
falkTX cbe17f4210 Merge branch 'master' into develop 2019-03-22 12:33:53 +01:00
Stephane Letz e298b4409d Correct GPL licence to LGPL for header files needed to build libjack. 2019-03-22 12:26:54 +01:00
Filipe Coelho 59550f67ee
Fix client UUID gen, and some warnings (#440)
* Fix generation of client uuid

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

* Remove all client properties when removed; Cleanup a few things

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

* Make all uuid function arguments use jack_uuid_t type; Fix warnings

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

* Rework uuids to never be int, more cleanup

Signed-off-by: falkTX <falktx@falktx.com>
2019-03-18 08:33:50 +01:00
falkTX d851fada46 Fix OSX build 2018-11-24 14:29:58 +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
Alba Mendez 63269497fd Set ToS octet on netjack packets 2018-07-20 10:24:04 +02:00
James Thomas d80de6c81a Use PTHREAD_EXPLICIT_SCHED for non RT threads
This prevents jack control threads from inheriting RT priorities from
other applications that may be using this in another RT thread
2018-07-20 09:56:47 +02:00
Cédric Schieli d4f925c2ea Secure promiscuous mode for posix semaphores
Adjusts the permissions of posix semaphores when promiscuous mode is enabled.

Note that changing permissions of semaphores is only supported on linux by
using the /dev/shm filesystem. As of now, linux does not use posix semaphores
anymore so this code is currently unsed.
2017-03-18 14:27:37 +01:00
Cédric Schieli bb7faafd1c Secure promiscuous mode for unix sockets
Adjusts the permissions of unix sockets when promiscuous mode is enabled.
2017-03-18 14:27:29 +01:00
James Thomas 05f87555df Remove unused JackPosixSemaphore::Wait() function
This doesn't seem necessary since it is implmented below
2017-03-02 14:09:08 +00:00
James Thomas d9918c3d29 Fix a crash in JackPosixSemaphore::Wait()
Crash was observed in this function when fSemaphore was NULL, this patch
copies the NULL pointer check from the commented function above into
Wait()
2017-03-02 14:07:23 +00:00
Stephane Letz 364159f821 Fix for JackNetUnixSocket::SendTo. 2016-09-13 18:00:22 +02:00
Adrian Knoth 43efc94ebd Fix C++14 warning
Space required before macro. No functional changes.
2016-06-11 09:16:47 +02:00
falkTX 394537687c Missing return in JackPosixSemaphore::ConnectInput 2015-10-22 10:27:10 +02:00
Stephane Letz 3a6d6b32fc Framework moved in /Library again, using posing semaphores. 2015-10-08 10:52:28 +02:00
Stephane Letz 008872fc16 Possible fix in JackPosixSemaphore::ConnectInput, cleanup. 2015-09-03 10:52:11 +02:00
Robin Gareus 886a64e02a support [unescaped] double-quotes in jackdrc
allow autostart of jackd on OSX where device-names can
contain spaces.
2015-01-13 22:41:00 +01:00
Stephane Letz ae81d3cb41 Cleanup. 2014-04-29 10:38:54 +02:00
Stephane Letz 75a43e5f2e Improve error reporting in NetJack2. 2014-03-09 20:32:45 +01:00
Stephane Letz c0f3d47280 More debug code in NetJack2. 2014-03-08 23:09:59 +01:00
Stephane Letz f19cd3c1dd Uli Franke patch for start_server_classic. 2014-02-26 15:53:30 +01:00
Adrian Knoth 84c1952786 Fix promiscuous mode
Original patch by

 Luciano Montanaro <luciano.montanaro@magnetimarelli.com>
2013-05-24 14:58:11 +02:00
Stephane Letz a4e319b753 Correctly pass code parameter in InfoShutdown callback. 2013-04-22 19:09:23 +02:00
Stephane Letz e7239f0925 Cleanup netjack2 code (in progress). 2013-03-25 15:13:27 +01:00
Stephane Letz 94ff6adbe4 Correct JackPosixSemaphore::Allocate and JackPosixSemaphore::ConnectInput. 2013-02-28 14:48:48 +01:00
Stephane Letz 7ec46dbb46 Better handling of shutdown state in client side. 2013-01-31 13:01:17 +01:00
Adrian Knoth 4d3595ebe5 Fix FTBFS introduced by ddb61e60 2013-01-27 14:15:59 +01:00
Stephane Letz ddb61e607b Correct JackClient::OnShutdown. 2013-01-26 20:51:57 +01:00
Stephane Letz 7849b9279e John Emmas patch for Windows. 2013-01-26 11:25:25 +01:00
Stephane Letz e32b0cd318 Improve server shutdown and stop. 2013-01-25 13:51:56 +01:00
Stephane Letz 3e63ef6ebb Correct JackServerSocket::Bind. 2013-01-15 08:07:14 +01:00
Stephane Letz fbfebdcdd7 Fix some incoherency with strings (2). 2013-01-15 07:55:27 +01:00