13
0
Commit Graph

854 Commits

Author SHA1 Message Date
09aa0a3d1a
Consolidate code using pthread_attr_setstacksize
This also adds some stack constraint to rt and fallback threads
that didn't have those before (ALSA MIDI for example)
2020-06-06 18:35:44 +02:00
ae3c8b19c6
Tweak PulseAudio re-initialization
This fixes an issue with pulse disconnecting after freewheeling,
and possibly also address #8193
2020-06-05 04:24:09 +02:00
b46a7d43c2
Dummy Backend: add a MIDI Clock generator 2020-05-27 23:40:06 +02:00
feaf87d200
Dummy Backend: remove hardcoded MTC sequence 2020-05-12 01:49:45 +02:00
7c15ad099f
Dummy Backend: add a MTC generator 2020-05-12 01:49:41 +02:00
88fc77b4c0
Double dummy MTC sequence duration 2020-05-11 21:35:22 +02:00
4ff6fbe6b8
ALSA: Use same period for in+out #8075
Since the input is never flushed, capture latency is still
only one cycle.
2020-05-10 22:28:40 +02:00
abe23b5885
ALSA backend: ignore idempotent latency settings 2020-05-09 01:22:18 +02:00
c75b2355c1
Fix potential malloc(0) issue 2020-05-05 17:13:18 +02:00
27f26f5cfd
Cont'd work on ALSA nperiods (amend 2326fb163) 2020-05-03 00:19:56 +02:00
2326fb1638
ALSA: only read/clear user-requested nperiods before snd_pcm_start
This should fix excessive latency with the RayDay that
has a fixed buffersize of 16384 samples.
2020-05-01 23:17:31 +02:00
8fa0049d28
ALSA: set start threshold to zero 2020-04-30 04:16:17 +02:00
11f68a02cd
Another step towards nperiod fixes for the RayDay 2020-04-30 02:05:14 +02:00
3a6a9cfa6c
Tweak ALSA nperiod setting, fallback to nearest
This is mainly for RME RayDAT that has a fixed buffersize of 16k:

  dev_name : hw:HDSPMxc2f6c5,0
  channels : 36
  min_rate : 32000
  max_rate : 192000
  min_bufz : 16384
  max_bufz : 16384
  min_nper : 4
  max_nper : 512

However nperiod configuration determines the effective latency
regardless.

This is similar to https://github.com/jackaudio/jack1/blob/master/drivers/alsa/alsa_driver.c#L476-L486
2020-04-29 23:56:24 +02:00
47bb331bfa
Allow to refresh ALSA device list - #8051 2020-04-29 02:19:38 +02:00
8e482ef0fb
Con't work on ALSA nperiod selection (see also d3d120fa) 2020-04-28 17:56:17 +02:00
d3d120fa28
Prepare to allow using ALSA backend with nperiods > 3
This will still need an update for Alsa_pcmi::set_hwpar() capture
channel (which is fixed at 2, unless FRAG_NEAR is used).
2020-04-28 03:28:34 +02:00
13ed8da2bc
Add flag to allow ALSA backend to fall back to nearest avail. nperiods 2020-04-28 02:51:20 +02:00
3d166c7789
Consolidate stack-size and priority of rt-threads 2020-04-23 01:28:58 +02:00
daf9fe2550
Tweak engine startup, shorten initial silence timeout
see also 23baeee829
2020-04-16 16:47:08 +02:00
1e996ca45f add port connect/add/remove callbacks to CoreAudio backend 2020-04-10 10:01:04 -06:00
2a80832243 add port connect/add/remove callbacks to the ALSA backend
This fixes issues with new ports not (always) appearing in port matrices (and presumably
elsewhere too)
2020-04-10 09:53:44 -06:00
b943cec756
ALSA: allow to select different I/O devices
This adds a basic support to use multiple sound-cards, currently
limited to two devices: In/Out with shared settings.

Advanced setups still have to resort to using the ARDOUR_ALSA_EXT
environment variable
2020-04-10 05:01:33 +02:00
e8efd45c05
Fix ALSA slave-device half-duplex mode 2020-04-10 05:01:30 +02:00
62e2ec49ce
ALSA: ignore systemic MIDI latencies during measurement 2020-04-10 01:43:11 +02:00
69b4c5108b ALSA backend: fix incorrect pointer cast (fixes #7998) 2020-04-09 15:40:23 -06:00
70f13a3ff3 use RCU to manage JACK backend's container of ports 2020-04-08 19:56:33 -06:00
3188fe00aa fix return value 2020-04-08 18:13:13 -06:00
f32245c156 add required ::clear_ports() call to Dummy backend destructor 2020-04-08 14:55:31 -06:00
78a66b7180 improved port cleanup as backend is destroyed 2020-04-07 23:26:51 -06:00
ede8b9995a fix another explicit return val for ::get_port_by_name() if JACK has died 2020-04-07 18:57:24 -06:00
2591c81c1a fix explicit return val for ::get_port_by_name() if JACK has died 2020-04-07 18:54:57 -06:00
32734ce53c fix portaudio backend to use shared_ptr 2020-04-07 16:00:22 -06:00
ff41232d16 fix CoreAudio backend to use shared_ptr 2020-04-07 13:52:35 -06:00
d827f3fdae fix up shared_ptr<> use in JACK backend 2020-04-07 13:23:49 -06:00
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
6a6b3f2703 fix another iterator type 2020-04-02 19:45:31 -06:00
cb4997f4a4 fix iterator type 2020-04-02 19:45:31 -06:00
af69ac1285 use clear_ports() 2020-04-02 19:45:31 -06:00
6cdc245967 fix header name 2020-04-02 19:45:31 -06:00
7fc5a6c971 initial try (not compiled) of PortAudio backend using PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
e5507f7072 use PortEngineSharedImpl with PulseAudio backend 2020-04-02 19:45:31 -06:00
04551c39f6 use PortEngineSharedImpl with DummyAudioBackend 2020-04-02 19:45:31 -06:00
30766c75e8 buildable version of CoreAudio backend using PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
a31d3689bf tentative changes to extend port engine shared impl to coreaudio 2020-04-02 19:45:31 -06:00
6c2e30b790 use new PortEngineSharedImpl in AlsaAudioBackend 2020-04-02 19:45:31 -06:00
9ac0d5b60f add RCU to manage _ports and _portmap in AlsaAudioBackend
This is intended to prevent crashes when unregister_port() modifies the contents of these
two members at the same time that something else is iterating over them.
2020-04-02 19:45:31 -06:00
a8ff35accb
Reset DSP load on backend re-start and after freewheeling 2020-03-30 16:58:55 +02:00
f866ed6305
Remove duplicate calls 2020-03-30 15:20:54 +02:00
23baeee829
Tweak engine startup, initial silence
This can help when running with very low latency and the
initial process callback is [indirectly] expensive.

E.g. load a heavy session the a RPi4, initial setup can pull
in a lot of data, which blocks the bus.

In particular with the ALSA backend this can lead to poll timeout
which effectively stops the backend.
2020-03-30 15:20:54 +02:00
c365c6cdb2
Set thread-names (libs) 2020-03-29 14:56:22 +02:00
eea697b260
ALSA backend: try to recover from poll errors
When recover() successfully re-initializes the device,
processing can continue just like after an x-run.

This can happen during initial session load of "expensive"
sessions (in particular on slow systems, e.g. Raspberry Pi)
usually with synths. Worker thread pulls in many external
files in the background which blocks the bus for a long time.
resulting in a poll-timeout.
2020-03-28 22:06:12 +01:00
nia
74ef32ec31 Only show the Sun driver on NetBSD and sun-ish systems. 2020-03-26 09:58:34 -06:00
nia
5a1514de33 Add Sun backend option for JACK 2020-03-26 09:58:34 -06:00
140a3f4a10 Fix Coreaudio buffersize changes 2020-03-06 05:52:55 +01:00
a9c75f9760
Fix CoreAudio systemic latency, implement hw latency report 2020-02-24 04:24:50 +01:00
7c381dab6e
Downgrade "using all channels" warning to info - part 2 2020-01-25 04:17:53 +01:00
06b2eb1c27
Explicitly use OSX
Previously this was inherited via PBD.

On MacOS/X,  this adds
  "-undefined dynamic_lookup -flat_namespace"
and various "-framework .." options to linkflags

Without this flag, .dylibs fail to link usually because
of missing `-lintl` (Undefined symbols: "_libintl_dgettext")

On other systems this is a NO-OP:
CFLAGS_OSX, CXXFLAGS_OSX and LINKFLAGS_OSX
are only set on the darwin platform.
2020-01-25 04:07:41 +01:00
f9e7f10695
Downgrade "using all channels" warning to info message 2020-01-24 21:16:40 +01:00
bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
c87bec07cd
Fix thinko in eee01188 (engine pulse spacing) 2020-01-12 00:16:19 +01:00
eee01188b4
Dummy: Engine-Pulse audio/midi generators
This produces synchronous events on Audio and MIDI ports.
One rvent per second, exactly at every second since engine-start.

MIDI: C-4 Note-on/off (1 sample long)
Audio: +1/-1 transition:
       +1 in sync with Note-on,
       -1 in sync with Note-off
2020-01-06 22:43:30 +01:00
0b52ea7a9c add a bit of debugging to JACK transport code 2019-11-15 16:06:04 -07:00
c69227fd8d eliminate hacky design for being able to deliver the correct time as JACK timebase master 2019-11-15 16:04:58 -07:00
e0d5c1426c
NO-OP: fix some Wimplicit-fallthrough
gcc can recognize various regexps in comments. Since C++17 provides
[[fallthrough]], using /* fallthrough */ consistently seems
appropriate until we switch to C++17.

see also https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
2019-09-18 17:37:54 +02:00
45cf29b7c5
Use preferred pa_context_new_with_proplist API 2019-09-01 19:01:18 +02:00
69688d24c4
Another fix for input only ALSA-slave devices 2019-08-24 00:15:10 +02:00
e5927d689c
Fix for half-duplex ALSA-slave devices 2019-08-23 04:39:51 +02:00
8fadf44978
Fix possible segfault when ALSA MIDI port registration fails 2019-08-23 04:39:12 +02:00
47a62b2850
Update backend GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
8a969b56c9
PA-backend: Flush buffer and wake up main thread at stop 2019-07-26 21:38:40 +02:00
78fc6d6651
Prefix all env variable with "ARDOUR_"
In particular "CONCURRENCY" can be problematic. But in general
it's good practice to use a namespace prefix for app-specifics.
2019-07-26 16:44:29 +02:00
b759fb883e
Launch pavucontrol as PA's control app 2019-07-26 04:43:56 +02:00
d7454714ab
Fix PA: unlock mainloop on abort 2019-07-25 21:24:36 +02:00
384c97e12d
Puls der Zeit
Prototype a basic stereo-playback only pulseaudio backend.
2019-07-25 17:49:42 +02:00
771f2d2499
ALSA backend: fix play/capture device param detection 2019-07-24 16:40:40 +02:00
00e226e3c6
Fix ALSA MIDI latency update call (playback/capture direction mismatch) 2019-05-06 00:14:27 +02:00
ddd1cda260
Remove outdated comment 2019-05-05 18:07:21 +02:00
c5346f5c15
Fix add/remove ALSA-MIDI ports bug 2019-05-05 18:06:37 +02:00
2f91bdfa53
NO-OP: <tab> after <space> fixes in libs 2019-04-13 19:19:29 +02:00
46f0b75e12
Undo more incorrect sample/frame replacements 2019-04-08 04:10:04 +02:00
ce961d73f3
Use unique midi-port names for Ardour's Dummy backend 2019-03-06 23:48:07 +01:00
8ccc45d44d
Ardour/ALSA allow multiple MIDI devices with the same name 2019-03-06 23:41:15 +01:00
e1ffe7857f
Use enum for exec stderr parameter (1/2) 2019-03-05 22:49:15 +01:00
8b71967be9
ALSA: add locks to safely add/remove MIDI devices
Theoretically this could be lock-free by using a queue of device
ports to be added/remove in sync in the process-callback, but
realistically adding/removing devices doesn't have to be rt-safe.
2019-01-14 22:33:31 +01:00
86a78dc100
Fix a -Wunused-but-set-variable 2019-01-02 18:59:03 +01:00
d50d8b9d33
C++98 compatible map erase 2018-12-27 12:45:36 +01:00
517b5f091f
Use same has for ALSA-seq and ALSA-raw devices 2018-12-23 21:58:56 +01:00
79e247e00a
Dynamic ALSA MIDI I/O device discovery and re/connect 2018-12-23 21:58:56 +01:00
217ef4d365
Use hash for ALSA-MIDI device name/ID 2018-12-23 21:58:55 +01:00
076e9fddd4
Remove ambiguous API implementation
* PortEngine::available() implementation
* AudioEngine::connected() wrapper

Eventually we may re-introduce PortEngine::available along
with a libardour internal port-engine.
2018-11-28 15:32:40 +01:00
4e4c6e7d1e Fix an edge-case in Dummy backend's random generator
INT_MAX == 2^31 is not a valid random seed for this LCG.
2018-10-22 15:46:59 +02:00
070f370e40 Fix copy/edit in e047b01aa2 2018-10-18 15:07:45 +02:00
e047b01aa2 add new API for retrieving port flags from backend 2018-10-17 14:11:37 -04:00
8ed33f1bc7 remove use of hardcoded -fPIC compiler flag, and use compiler flag dict instead 2018-10-14 22:06:11 -04:00
94e6164bc3 Add API to query backend realtime thread priority 2018-10-11 15:29:40 +02:00
b519434744 Adapt our remaining MSVC projects for 'boost::atomic' (in case it later gets extended to the other libs)
Stage 2 of 3 (more to follow)
2018-09-30 09:06:25 +01:00
79f01bc889 Initial changes needed for building Mixbus (with MSVC) as version 5
(Mixbus itself will probably need extra changes)
2018-09-10 07:14:59 +01:00
46175b6b60 Increase alsa-backend timeout
Following discussion (https://community.ardour.org/node/15805 and
#ardour IRC) test initial disconnect due to timeout after a cold-boot.
2018-08-29 19:23:53 +02:00
37a9803542 avoid compiler warning on at least some linux versions 2018-05-04 08:25:04 -04:00