Commit graph

33 commits

Author SHA1 Message Date
Paul Davis
eff61bde32 JACK: accomodate MSVC in DEBUG_TRACE stmts involving pthread_self 2023-09-14 06:59:29 -06:00
Paul Davis
3c857a78c6 JACK backend: serialize all jack server calls with a mutex
As was noted in 88ee3af3ea it is unsafe/undefined behavior if two threads
sleep on the JACK request file descriptor, since there is no way to control
which one will wake and process the request. Since each thread may have
sent a different request, this can lead to a thread misinterpreting the
response because it is reading the wrong response.

This may (or may not) solve some subtle problems with JACK, but was
revealed by having a control surface (LaunchPad Pro) that registers
three ports from the butler thread at about the same as the GUI
thread is registering the auditioner. One thread read the wrong
response, and because of some slightly weird code/design, it attempts
to rename the port from within the response handler, which in JACK1
leads to deadlock (and later, zombification).
2023-09-13 09:20:41 -06:00
Paul Davis
88ee3af3ea JACK backend: add a mutex to serialize per-thread port register requests to server
Without this, two threads can both sleep on the same communication channel, and the wake order
is non-determinate, so the wrong thread may process the response to the other thread's request.
2023-09-12 22:41:26 -06:00
Robin Gareus
295dbd8e1e
Make RCU reader return a const pointer (omnibus commit) 2023-04-08 00:15:37 +02:00
Paul Davis
b35518e212 switch from boost::{shared,weak}_ptr to std::{shared,weak}_ptr
This is mostly a simple lexical search+replace but the absence of operator< for
std::weak_ptr<T> leads to some complications, particularly with Evoral::Sequence
and ExportPortChannel.
2023-03-24 14:19:15 -06:00
Paul Davis
1eaaf4303b jack backend: catch some possible errors in ::get_port_name() 2022-10-29 09:37:17 -06:00
Robin Gareus
83225886a1
Fix gcc4 builds ('EEXIST' was not declared in this scope) 2021-11-15 19:12:00 +01:00
Robin Gareus
79330f909e
Work around connection loss when re-starting JACK backend
If connecting ports using the port-engine fails,
ardour forgets the connection.

Internal backends only produced an error if a port was already
connected, when using ::connect (handle, other), but
ignore already existing connection when using port-names.

Various ports are connected twice when the engine connects
at session load. This worked fine for as long as the engine
was never stopped (saving the session asks the port-engine),
but failed when the engine went away and internal representation
is used.
2021-11-01 23:11:41 +01:00
Paul Davis
95215ff405 JACK backend: avoid deadlock if a port is unregistered that is not known to Ardour 2021-06-13 07:59:14 -06:00
Paul Davis
a67a475480 dramtically improve performance of ::get_port_by_name() for JACK backend 2021-06-11 10:41:41 -06:00
Robin Gareus
0c81ba33d2
JACK latency compensation for newly created tracks #8472
Ardour native backends trigger a latency-callback when ports_changed.
This was lost for JACK when the shared port engine was implemented.
2021-01-14 03:22:25 +01:00
Paul Davis
70f13a3ff3 use RCU to manage JACK backend's container of ports 2020-04-08 19:56:33 -06:00
Paul Davis
ede8b9995a fix another explicit return val for ::get_port_by_name() if JACK has died 2020-04-07 18:57:24 -06:00
Paul Davis
2591c81c1a fix explicit return val for ::get_port_by_name() if JACK has died 2020-04-07 18:54:57 -06:00
Paul Davis
d827f3fdae fix up shared_ptr<> use in JACK backend 2020-04-07 13:23:49 -06:00
Paul Davis
b9cb306e8b use shared_ptr to manage backend port lifetimes (Pulse,ALSA,Dummy,JACK)
JACK is not yet finished.

Changes also include minor reformatting and a spelling correction (latecies to latencies)
2020-04-07 13:23:49 -06:00
Robin Gareus
47a62b2850
Update backend GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Paul Davis
e047b01aa2 add new API for retrieving port flags from backend 2018-10-17 14:11:37 -04:00
Robin Gareus
94e2bce740 Add & implement PortEngine::externally_connected() API 2017-10-30 19:41:42 +01:00
Robin Gareus
2b7c585dba Update backend API: read-only MIDI input buffers 2017-08-05 15:36:36 +02:00
Paul Davis
d29d93f4cd fix retrieval of port properties (metadata) when the value has no type 2016-10-18 16:46:33 -04:00
Robin Gareus
cdcccd8101 handle edge-case where jack-meta-data may be NULL, but the call succeeds
this fixes #6968
2016-08-19 14:38:37 +02:00
Paul Davis
cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
Robin Gareus
9840a11537 implement metadata-set for remaining backends 2016-04-18 00:35:51 +02:00
Robin Gareus
22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis
4dc63966f0 globally remove all trailing whitespace from ardour code base.
Paul Davis was responsible for introducing almost all of this.
2015-10-04 14:51:05 -04:00
Paul Davis
aaab192436 add conditional use of jack_port_rename(), a newly added public API for JACK 2015-07-02 14:02:07 -04:00
Paul Davis
f755185825 add a real check for functioning JACK metadata API; remove configure time option for this 2015-04-23 09:29:45 -04:00
Robin Gareus
20cd14cf36 add backend support for port properties (jack) 2015-03-08 19:02:31 +01:00
Robin Gareus
f3ff1b9669 weak/runtime jack linking: load libjack dynamically at runtime 2014-10-23 16:53:13 +02:00
Paul Davis
7fec991077 fix thinko in declaration of ARDOUR::PortEngine::get_port_by_name() 2013-10-28 09:46:59 -04:00
Paul Davis
83a826095d update JACK backend to use new inheritance structure for AudioBackend 2013-09-13 11:21:43 -04:00
Paul Davis
f4cf283f26 move JACK audio backend to its own folder and adjust build system to reflect that (installed version may now work) 2013-09-07 11:03:57 -04:00
Renamed from libs/ardour/jack_portengine.cc (Browse further)