Commit Graph

964 Commits

Author SHA1 Message Date
Paul Davis 7fc5a6c971 initial try (not compiled) of PortAudio backend using PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
Paul Davis e5507f7072 use PortEngineSharedImpl with PulseAudio backend 2020-04-02 19:45:31 -06:00
Paul Davis 04551c39f6 use PortEngineSharedImpl with DummyAudioBackend 2020-04-02 19:45:31 -06:00
Paul Davis 30766c75e8 buildable version of CoreAudio backend using PortEngineSharedImpl 2020-04-02 19:45:31 -06:00
Paul Davis a31d3689bf tentative changes to extend port engine shared impl to coreaudio 2020-04-02 19:45:31 -06:00
Paul Davis 6c2e30b790 use new PortEngineSharedImpl in AlsaAudioBackend 2020-04-02 19:45:31 -06:00
Paul Davis 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
Robin Gareus a8ff35accb
Reset DSP load on backend re-start and after freewheeling 2020-03-30 16:58:55 +02:00
Robin Gareus f866ed6305
Remove duplicate calls 2020-03-30 15:20:54 +02:00
Robin Gareus 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
Robin Gareus c365c6cdb2
Set thread-names (libs) 2020-03-29 14:56:22 +02:00
Robin Gareus 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
Robin Gareus 140a3f4a10 Fix Coreaudio buffersize changes 2020-03-06 05:52:55 +01:00
Robin Gareus a9c75f9760
Fix CoreAudio systemic latency, implement hw latency report 2020-02-24 04:24:50 +01:00
Robin Gareus 7c381dab6e
Downgrade "using all channels" warning to info - part 2 2020-01-25 04:17:53 +01:00
Robin Gareus 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
Robin Gareus f9e7f10695
Downgrade "using all channels" warning to info message 2020-01-24 21:16:40 +01:00
Robin Gareus bca825e515
NO-OP: whitespace 2020-01-14 00:52:24 +01:00
Robin Gareus c87bec07cd
Fix thinko in eee01188 (engine pulse spacing) 2020-01-12 00:16:19 +01:00
Robin Gareus 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
Paul Davis 0b52ea7a9c add a bit of debugging to JACK transport code 2019-11-15 16:06:04 -07:00
Paul Davis c69227fd8d eliminate hacky design for being able to deliver the correct time as JACK timebase master 2019-11-15 16:04:58 -07:00
Robin Gareus 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
Robin Gareus 45cf29b7c5
Use preferred pa_context_new_with_proplist API 2019-09-01 19:01:18 +02:00
Robin Gareus 69688d24c4
Another fix for input only ALSA-slave devices 2019-08-24 00:15:10 +02:00
Robin Gareus e5927d689c
Fix for half-duplex ALSA-slave devices 2019-08-23 04:39:51 +02:00
Robin Gareus 8fadf44978
Fix possible segfault when ALSA MIDI port registration fails 2019-08-23 04:39:12 +02:00
Robin Gareus 47a62b2850
Update backend GPL boilerplate and (C) from git log 2019-08-03 15:53:16 +02:00
Robin Gareus 8a969b56c9
PA-backend: Flush buffer and wake up main thread at stop 2019-07-26 21:38:40 +02:00
Robin Gareus 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
Robin Gareus b759fb883e
Launch pavucontrol as PA's control app 2019-07-26 04:43:56 +02:00
Robin Gareus d7454714ab
Fix PA: unlock mainloop on abort 2019-07-25 21:24:36 +02:00
Robin Gareus 384c97e12d
Puls der Zeit
Prototype a basic stereo-playback only pulseaudio backend.
2019-07-25 17:49:42 +02:00
Robin Gareus 771f2d2499
ALSA backend: fix play/capture device param detection 2019-07-24 16:40:40 +02:00
Robin Gareus 00e226e3c6
Fix ALSA MIDI latency update call (playback/capture direction mismatch) 2019-05-06 00:14:27 +02:00
Robin Gareus ddd1cda260
Remove outdated comment 2019-05-05 18:07:21 +02:00
Robin Gareus c5346f5c15
Fix add/remove ALSA-MIDI ports bug 2019-05-05 18:06:37 +02:00
Robin Gareus 2f91bdfa53
NO-OP: <tab> after <space> fixes in libs 2019-04-13 19:19:29 +02:00
Robin Gareus 46f0b75e12
Undo more incorrect sample/frame replacements 2019-04-08 04:10:04 +02:00
Robin Gareus ce961d73f3
Use unique midi-port names for Ardour's Dummy backend 2019-03-06 23:48:07 +01:00
Robin Gareus 8ccc45d44d
Ardour/ALSA allow multiple MIDI devices with the same name 2019-03-06 23:41:15 +01:00
Robin Gareus e1ffe7857f
Use enum for exec stderr parameter (1/2) 2019-03-05 22:49:15 +01:00
Robin Gareus 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
Robin Gareus 86a78dc100
Fix a -Wunused-but-set-variable 2019-01-02 18:59:03 +01:00
Robin Gareus d50d8b9d33
C++98 compatible map erase 2018-12-27 12:45:36 +01:00
Robin Gareus 517b5f091f
Use same has for ALSA-seq and ALSA-raw devices 2018-12-23 21:58:56 +01:00
Robin Gareus 79e247e00a
Dynamic ALSA MIDI I/O device discovery and re/connect 2018-12-23 21:58:56 +01:00
Robin Gareus 217ef4d365
Use hash for ALSA-MIDI device name/ID 2018-12-23 21:58:55 +01:00
Robin Gareus 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
Robin Gareus 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
Robin Gareus 070f370e40 Fix copy/edit in e047b01aa2 2018-10-18 15:07:45 +02:00
Paul Davis e047b01aa2 add new API for retrieving port flags from backend 2018-10-17 14:11:37 -04:00
Paul Davis 8ed33f1bc7 remove use of hardcoded -fPIC compiler flag, and use compiler flag dict instead 2018-10-14 22:06:11 -04:00
Robin Gareus 94e6164bc3 Add API to query backend realtime thread priority 2018-10-11 15:29:40 +02:00
John Emmas 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
John Emmas 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
Robin Gareus 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
Paul Davis 37a9803542 avoid compiler warning on at least some linux versions 2018-05-04 08:25:04 -04:00
Robin Gareus 37df98d0af CoreAudio/MIDI: add locks for port-registration
CoreMIDI ports are dynamic. When dis/connecting a device CoreAudio's
AudioHardware-PropertyListener triggers a callback which can
add/remove ports.

This can not happen concurrently with processing, but it may happen
concurrently with a user creating tracks using Ardour's UI
and/or session-load/setup.
2018-03-29 18:15:20 +02:00
John Emmas b9c9777b9a When building with MSVC, allow for the fact that Mixbus and Ardour can be using different versions of the SESSION_FILE format 2018-02-15 09:03:32 +00:00
John Emmas 6f019faaa0 Accommodate the change from libtimecode to libtemporal 2018-02-14 10:02:11 +00:00
Robin Gareus 48c1a24284 Fix some clang warnings (argument with 'nonnull' attribute passed null) 2018-01-26 18:07:23 +01:00
Robin Gareus 7671268bc3 strlen is not a member of std. 2018-01-03 18:06:55 +01:00
Robin Gareus 4ebcef53f8 Relax max MIDI msg size to 256 (for long sysex)
(win-mme already used 256, CoreMIDI can handle up to 256 as can ALSA)
2017-12-19 17:41:57 +01:00
Robin Gareus 0c3531efe7 Fix gcc4 builds "GCC diagnostic not allowed inside functions" 2017-12-16 17:08:36 +01:00
Robin Gareus ca979ee606 Sync weakjack with upstream https://github.com/x42/weakjack/ 2017-12-15 21:56:46 +01:00
Robin Gareus 332a7e56ca Increase ALSA max MIDI msg size to 128 bytes (same as OSX) for long sysex 2017-12-05 16:09:46 +01:00
Robin Gareus 94e2bce740 Add & implement PortEngine::externally_connected() API 2017-10-30 19:41:42 +01:00
Robin Gareus 16b4535281 Add missing header (-Wmissing-prototypes) 2017-10-30 19:39:42 +01:00
Robin Gareus 7adb1297cd Add weak linked symbol for "jack_port_is_mine" 2017-10-30 19:39:10 +01:00
Robin Gareus c0dbe8eaaf Move coreaudio_set_realtime_policy into libpbd 2017-10-30 16:31:38 +01:00
Robin Gareus c0f27be59e Fix/update alsa backend build recipe (statically link zresampler) 2017-10-29 20:03:51 +01:00
Robin Gareus 7512692e79 Fix initial cycle noise with dummy-loopback 2017-10-28 15:45:08 +02:00
Paul Davis 79374df84e fix preprocessor error on some/many systems 2017-10-26 15:44:09 -04:00
Robin Gareus 7e2c002ef6 Propagate Latency to backend/system ports (Dummy backend)
amend ab3889ff (which implements this for other backends)
2017-09-28 13:14:11 +02:00
Robin Gareus e39a8b90d9 amend ab3889ff: portaudio backend uses a vector for connections 2017-09-23 01:06:10 +02:00
Robin Gareus ab3889fff8 Propagate Latency to backend/system ports
Set accumulated capture-latency for physical-outputs
and accumulated playback-latency for physical-inputs
after Ardour is done setting all non-physical port latencies.

This will be needed for latency-compensation of the complete graph.
2017-09-23 00:34:01 +02:00
Robin Gareus 59ccf91eea Revert some more frame/sample API issues 2017-09-19 18:40:29 +02:00
Robin Gareus 666aa5a557 More Coreaudio SDK fixes, after 30b087ab3 2017-09-19 05:20:05 +02:00
Robin Gareus 1ec471c961 partially revert 30b087ab3, CoreAudio SDK uses "Frames" 2017-09-19 04:47:10 +02:00
Paul Davis 30b087ab3d globally change all use of "frame" to refer to audio into "sample".
Generated by tools/f2s. Some hand-editing will be required in a few places to fix up comments related to timecode
and video in order to keep the legible
2017-09-18 12:39:17 -04:00
Robin Gareus 8337982766 Prototype using additional ALSA devices (w/resampling). 2017-09-18 16:13:55 +02:00
Robin Gareus 128a985361 ALSA Backend: Separate Device Reservation into its own class 2017-09-18 14:50:31 +02:00
Robin Gareus 7258c6334d Namespace PBD::RingBuffer
class RingBuffer<> is a very generic name and should not pollute the
global namespace.
2017-09-16 16:37:29 +02:00
John Emmas 14fcf86f03 MSVC uses a slightly smaller value for HUGE 2017-09-11 19:25:13 +01:00
John Emmas 35fcb622bc Accommodate recently removed source(s) in our MSVC project (portaudio_audiobackend) 2017-08-30 09:53:33 +01:00
Robin Gareus 467c801ce8 Abstract definition of rt-scheduler policy
pthread-w32 does not support pthread_setschedparam() with
SCHED_FIFO and bails out. While pthread_create() simply ignores the policy
and sets the priority regadless.

This only affects ctrl-surface event-loops & AutomationWatch on Windows.
2017-08-29 20:35:36 +02:00
Robin Gareus df659e91f1 Consolidate _realtime_pthread_create() into libpbd. 2017-08-29 17:25:23 +02:00
Robin Gareus 2961db3b6f Use literal for compatibility 2017-08-23 12:43:48 +02:00
Stefan Müller-Klieser 587a2dee55 backends: jack: display playback only devices
When starting ardour using the jack backend, playback only devices
currently do not get displayed. Mixing and Mastering only workspaces
with e.g. a single USB Dac should be a common use case. Take this use
case into account by adding them to the device list. Tested on Linux
with jack-alsa.
2017-08-23 02:17:51 +02:00
Robin Gareus e0a83a758e Redesign Session+Route Template Meta Script API
Remove special-cased script types. Allow Action-Scripts to be re-used
for session-setup or route-templates.
2017-08-18 20:42:55 +02:00
Robin Gareus 26dc287c00 Fix non-buffered PA backend. Wait for backend to become active
This hopefully fixes an issue with port-registration (new session)
being skipped because PortAudioBackend::available() still false
until the first callback.
2017-08-07 23:23:39 +02:00
Robin Gareus fd6377a5af PortAudio: skip process callbacks until ports are established 2017-08-07 19:27:37 +02:00
Robin Gareus fde07d4f4f amend bc46a7e2e9; fix blind coding typos 2017-08-05 16:17:31 +02:00
Robin Gareus 8c61c7f14a amend f4c76f89d3a; fix blind coding typos 2017-08-05 16:06:15 +02:00
Robin Gareus bc46a7e2e9 PortAudio backend RT-safe MIDI buffer allocation 2017-08-05 15:36:36 +02:00
Robin Gareus f4c76f89d3 Coreaudio backend RT-safe MIDI buffer allocation 2017-08-05 15:36:36 +02:00
Robin Gareus 59a63a08f9 ALSA backend RT-safe MIDI buffer allocation 2017-08-05 15:36:36 +02:00
Robin Gareus 2b7c585dba Update backend API: read-only MIDI input buffers 2017-08-05 15:36:36 +02:00
Robin Gareus c125cd2647 Reduce DSP thread priority (main-i/o > midi i/o > computation) 2017-08-05 01:28:11 +02:00
Robin Gareus 38c5e9de6d CoreAudio: Set MachThread RT Priority 2017-08-04 06:25:23 +02:00
Robin Gareus 4ec72b5c76 DummyBackend: allow changing SPP 2017-08-04 03:53:51 +02:00
Robin Gareus 6b5d374352 Some more assert() debugging 2017-08-03 23:46:05 +02:00
Robin Gareus 660096b037 Fix typo 2017-07-31 19:54:23 +02:00
John Emmas 80ecac672f Modify our MSVC project to add libltc as a dependency of 'dummy_backend' (which now needs to link to it) 2017-07-29 10:46:53 +01:00
John Emmas 7f03c9a664 Fix an ambiguous call to 'floor()'
MSVC complains, so let's specify which override we want.
2017-07-29 10:44:00 +01:00
Robin Gareus 7b7cc9ea6d Add a LTC generator to the dummy backend 2017-07-28 17:47:36 +02:00
Robin Gareus e511985ad9 Report Dummy as not available if not running
This fixes an issue with port-connections being polled from the backend
even when it's not running.
2017-06-25 20:53:47 +02:00
Robin Gareus 0d668b9beb ALSA backend: always register ports with systemic latency
and allow re-start to un/set reporting latency.
2017-04-27 20:59:15 +02:00
Robin Gareus d7d86a99d2 Re-nice ALSA MIDI port names 2017-04-21 10:43:22 +02:00
Tim Mayberry bf5864aaca Use PBD::to_string() from pbd/string_convert.h in JACK utils
Use pbd/string_convert.h API instead of std::ostream for numeric formatting to
remain locale independent and not have to use a LocaleGuard.
2017-04-19 09:37:00 +10:00
Robin Gareus 6968c9f909 Drain ALSA raw-midi buffers after 64 bytes
Very long sequence of *concurrent* events may otherwise be truncated
because the backend requests a buffer-size of 64 bytes via
snd_rawmidi_params_set_buffer_size().
2017-04-09 05:03:19 +02:00
Robin Gareus f9db9bf5fd Retain order of concurrent MIDI events
This fixes an issue with FaderPort8 (and maybe other surfaces or synths).
2017-04-08 23:43:50 +02:00
John Emmas 9a45e0fde9 Add a missing #define to our MSVC project (portaudio_backend) 2017-02-20 09:16:51 +00:00
Robin Gareus 9bf4f339b9 revert 335debfa for the PA backend
The same device may have different names for input + output
2016-11-27 00:42:08 +01:00
Robin Gareus 335debfa2f Add API to enforce valid device selection. 2016-11-26 15:31:21 +01:00
Tim Mayberry d10913e2de Fix intermittent hang when stopping PortaudioBackend
This issue is not always reproducible but when it does occur it happens
somewhat consistently on both 32bit and 64bit builds(Tested on Windows 7).

The midiOutReset call does not return (or it takes so long that it might as
well be indefinite) and as it is not strictly necessary just remove it.

Resolves: http://tracker.ardour.org/view.php?id=7095
2016-11-15 09:36:52 +10:00
Robin Gareus 43bd7f5db1 fix const-cast 2016-11-12 16:20:43 +01:00
nick_m 33e95a1577 rename Tempo _beats_per_minute to _note_types_per_minute, provide pulse helpers.
- adds quarter_notes_per_minute(), note_divisions_per_minute (double)
	  pulses_per_minute() and frames_per_quarter_note()

	- this should be a no-op except for the use of tempo by
	  the vst callback which definitely uses quarter notes per minute.

	- the XML node for TempoSection named 'beats-per-minute'
	  has been renamed.
2016-11-11 03:37:08 +11:00
Tim Mayberry 8b5fad0cf9 Use better debug output in PortaudioBackend
When failing to open audio stream in callback mode
2016-11-10 15:23:43 +10:00
Robin Gareus 56711b99c9 Work around OSX MIDI devices that send no timestamps 2016-10-19 19:45:53 +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
Paul Davis 69cbcb84a6 spelling corrections from Jaromír Mikeš <mira.mikes@seznam.cz>
Corresponds to https://anonscm.debian.org/cgit/pkg-multimedia/ardour.git/tree/debian/patches/0070-spelling.patch
2016-10-17 17:57:39 -04:00
Kamil Rytarowski 1ac7dad84e NetBSD ships with pollts(2) similar to Linux specific ppoll() 2016-10-04 22:17:49 +02:00
Kamil Rytarowski f69776e5b7 NetBSD ships with <sys/endian.h> not <endian.h> 2016-10-04 22:17:12 +02:00
John Emmas 0ff233d234 Update our MSVC project files to generate the most recent Ardour session file format (ver 5) rather than the older v3 format 2016-08-30 07:15:00 +01:00
Robin Gareus 355fa64c79 fix Coreaudio Aggregate for separate devices with identical names 2016-08-28 13:44:30 +02:00
Robin Gareus 957f59f351 print a warning if CoreAudio falls back to non realtime priority 2016-08-22 17:38:45 +02: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
Robin Gareus a76607486c kilo is a lower-case 'k' 2016-07-24 16:54:08 +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 8444837b71 properly sort port-names 2016-07-14 16:52:43 +02:00
Robin Gareus b65cb37d24 add a MTC/sysex test sequence 2016-07-11 16:58:53 +02:00
Robin Gareus ac923be7af fix port-sort order for good.
TODO find out how to make std::set::find() work with custom sort order,
as std::find may only be O(N) and not O(log (N)).
2016-07-08 21:37:42 +02:00
Robin Gareus f84a7605d8 pre-sort port-names 2016-07-08 20:44:21 +02:00
Robin Gareus 0ae634cb1e fix jack_port_rename() detection 2016-07-01 19:08:52 +02:00
Robin Gareus 60200bf923 bump max number of possible ALSA backend channels 2016-05-29 20:36:32 +02:00
nick_m 34c9ac9dd7 Tempo ramps - rename bbt_time() -> bbt_at_frame(), frame_time() -> frame_at_bbt() 2016-05-27 23:38:17 +10:00
nick_m 7fc3b0c34c Initial stab at tempo ramps.
Replaces the list of points in TempoMap with TempoSection functions, which
compute tempo-at or tick-at time relative to tempo section start.
TempoMap consults them additively to determine things like bbt_time(),
frame_time() get_grid() etc.
This has a marked effect on scrolling speed along with the code simplification
in the places it has been attempted.

Several things are broken here.
Currently every ramp except the last one is an exponential ramp. this may
be simple to fix :).
Mouse-over midi grid doesn't match mouse click grid. should also be simple.

Many things seem to work, but their accuracy should be in question until
each area has been addressed.
2016-05-27 23:38:09 +10:00
Robin Gareus 94187e66a2 add a test-sequence for polyphonic pressure 2016-05-27 12:12:00 +02:00
Robin Gareus afc1186759 NO-OP indent 2016-05-22 19:36:54 +02:00
John Emmas 39ba60aaef Make sure MSVC knows which version of 'floor()' we want 2016-05-22 15:53:16 +01:00
Robin Gareus 9ad096b611 Dummy Backend evolution
- pretty port-names for Dummy generators: show frequency
- add 1/3 Octave spaced sine-wave generator
2016-05-21 22:38:39 +02:00
John Emmas b0200b23f2 Accommodate the fact that 'msvc_resources.rc.in' got moved to a new path 2016-05-21 10:33:18 +01:00
Robin Gareus d8ac5eddf7 add missing include 2016-05-06 21:25:21 +02:00
Robin Gareus 514da9881d convert WinMME Device names to UTF-8 2016-05-06 20:59:24 +02:00
John Emmas dc1a2fbca7 MSVC won't compile 'const float _demolition[]' because it uses 'divide by zero' while initializing
Hopefully we can use INFINITY and NAN for the relevant initializers ?
2016-05-03 17:30:58 +01:00
Robin Gareus 69bd02bd25 remove skeleton backend (superseded by portaudio) 2016-04-29 16:43:09 +02:00
Robin Gareus 69f99ee184 I wanna be nasty, I wanna be cruel,..
Somme disastrous signal generators for QA.
2016-04-29 16:10:09 +02:00
Robin Gareus 43e620504a port 93eac8b0 to ALSA and CoreAudio 2016-04-26 18:19:48 +02:00
John Emmas 7f8c7d8647 #define HAVE_JACK_PORT_RENAME when building with MSVC
This means needing to build against libjack v1.9.11 (or later) although that's probably not a bad thing.
2016-04-26 15:02:20 +01:00
John Emmas 93eac8b068 Use 'const_iterator' to prevent MSVC from complaining 2016-04-26 14:58:16 +01:00
Robin Gareus 2169de3975 keep portmap & portindex in sync when renaming ports
Fixes crash on session re-load (introduced in 800c8182 and fde99e68)
2016-04-26 02:26:20 +02:00
Robin Gareus fde99e68f7 ..and CoreAudio. 2016-04-24 20:45:50 +02:00
Robin Gareus 800c8182c6 O(log(n)) port and connection lookup for ALSA 2016-04-24 20:45:37 +02:00
Robin Gareus ce052ba20a now with C++98 compat 2016-04-24 18:34:31 +02:00
Robin Gareus d1874d4685 optimize port lookup, adding/removing/reconnecting routes
xxxAudioBackend::connected_to() is called O(N^2) when building the graph.
Mitigate this by using an O(log(N)) lookup.

This duplicates the storage (both set and map and both are kept in sync.
Changing this to a boost:bidirectional might be nice, before updating
other backends.
2016-04-24 18:26:39 +02:00
Robin Gareus 9840a11537 implement metadata-set for remaining backends 2016-04-18 00:35:51 +02:00
Robin Gareus 10140a8e68 implement pretty-name set-property for ALSA and Dummy 2016-04-17 18:22:21 +02:00
John Emmas 40aa4cfe06 Modify our MSVC projects to build liblua as a DLL rather than a static lib 2016-04-04 16:40:20 +01:00
Paul Davis 5dbfca9953 Fix build on El Capitan
In which Apple once again changed the name of the MIDI kit from CoreMidi to CoreMIDI, something
they did for the Lion release of OS X
2016-03-01 12:20:59 -05:00
Robin Gareus ba78359129 prepare for update to waf 1.8
uselib is no longer implicit (inherited by .use). This is still incomplete,
some uselibs for non-linux variants may be missing.

bld.is_defined("HAVE_XXX") also no longer works and will have to be
changed (I think to bld.env["HAVE_XXX"]) in countless places.
2016-02-28 21:16:44 +01:00
John Emmas d3634c5779 Accommodate 'lua' search paths in various projects where they're needed
(i.e. so that MSVC can find header files from lua).
2016-02-27 16:29:55 +00:00
Robin Gareus 9472200727 fix hang at exit (after freewheeling) with PA-nonblocking backend 2016-02-27 00:50:02 +01:00
John Emmas fcf757139f Accommodate newly introduced source(s) in our MSVC project (portaudio_backend) 2016-02-12 12:31:23 +00:00
Tim Mayberry 148f2ab8e5 Add debugging output for WinMME midi device names 2016-02-11 12:15:07 +10:00
Tim Mayberry 1499cd8670 Only build one version of the Portaudio backend that supports both blocking and callback API 2016-02-11 12:15:07 +10:00
Tim Mayberry 830db39585 Implement new AudioBackend API in PA backend to choose between callback and blocking API 2016-02-11 12:15:07 +10:00
Tim Mayberry d50a821374 Add a missing include from portaudio WINMME source file
Apparently this is now required by my version of gcc/mingw
2016-02-11 12:15:07 +10:00
Tim Mayberry b2cf028fcb Implement MIDI device enumeration and latency offset/calibration in portaudio backend 2016-02-11 12:15:07 +10:00
Paul Davis 90c4985604 remove wavesaudio backend 2016-01-12 08:06:47 -05:00
Robin Gareus cf6a3afcaa name ALSA midi ports after device 2016-01-11 11:46:10 +01:00
Robin Gareus 0fc06b4a1b fix warning message typo 2016-01-11 11:45:44 +01:00
Paul Davis a9995c59cc coremidi: do not clear port buffer for every call to parse_events()
This was limiting the data flow to 1 MIDI event per process cycle.
2016-01-10 17:46:36 -05:00
Paul Davis 36fb8c44c1 add explanatory comment regarding coremidi data flow 2016-01-09 14:45:38 -05:00
Paul Davis 4a99727dea coremidi: be sure to mark _event._pending false after queueing, so that it doesn't get queued up again later 2016-01-09 13:53:17 -05:00
Paul Davis ef45a6c84b coreaudio: remove debug output 2016-01-08 09:43:33 -05:00
Paul Davis 63cbe11c67 coreaudio: remove debug output 2016-01-08 09:39:55 -05:00
Paul Davis cae2f82278 NOOP: fix whitespace/indendentation in coreaudio backend code 2016-01-08 09:39:00 -05:00
Paul Davis 3d5e345800 coreaudio: reset MIDI parsers when entering and leaving freewheeling 2016-01-08 09:23:05 -05:00
Paul Davis 9d3cbe44a3 coreaudio: correctly clear MIDI port buffers 2016-01-07 18:11:45 -05:00
Paul Davis c615e26f3c coreaudio: factor out common code for stuffing MIDI data into a CoreMidiPort buffer 2016-01-07 18:11:45 -05:00
Paul Davis 6e71d3b445 coreaudio: per-port parser for incoming MIDI, copied from ALSA Raw MIDI support 2016-01-07 16:42:34 -05:00
Robin Gareus b7e06693be nitpick 2016-01-07 20:44:59 +01:00
Paul Davis d735145969 fix missing symbol on OS X 2016-01-07 10:40:08 -05:00
John Emmas 8649c1759e #define BACKEND_NAME when building with MSVC (portaudio_backend)
N.B. We aren't yet building the blocking PortAudio backend but that can be added quite easily, if needed.
2015-12-23 15:09:18 +00:00
Robin Gareus b67892833b ship both blocking and callback PA backends (for debug purposes)
this just works (no symbol conflicts)
2015-12-21 22:12:15 +01:00
Robin Gareus fe0802169c standardize port-names 2015-12-08 15:32:05 +01:00
Robin Gareus 1372407f82 fix previous commit. 2015-12-08 00:52:06 +01:00
Robin Gareus 8781004ca2 portaudio connect & graph-changed callbacks (untested) 2015-12-08 00:36:29 +01:00
Robin Gareus 7ad8ad8823 JACK: expose --nperiods option 2015-12-05 13:56:18 +01:00
Robin Gareus 4dc49ee4fa fix -Wreorder 2015-12-05 02:42:58 +01:00
Robin Gareus a6f27f09a7 update ALSA backend: separate playback/capture periods
fixed: 2 for capture,  configurable 2,3 for playback.
2015-12-05 01:53:13 +01:00
Robin Gareus bfd2cbaa3f ALSA: allow to dynamically add/remove midi devices & update their latency. 2015-12-04 22:19:47 +01:00
Robin Gareus ac075560bd ALSA: allow to measure & set systemic audio latency w/o restart.
(MIDI needs a bit more work)
2015-12-04 17:45:49 +01:00
Robin Gareus 990fd75c5f implement ALSA period/cycle setting 2015-12-04 10:16:19 +01:00
Tim Mayberry e9be313c11 Fix latency compensation for audio data in portaudio backend
For drivers that correctly report latency values(ASIO) this should result a
much closer alignment of audio in a loopback test. Measurement and
adjustment may still be needed, especially for non-ASIO drivers.

Testing with the RME HDSP Multiface and Yamaha AG06 using ASIO drivers results
in maximum offset of a couple of samples.
2015-12-02 10:24:08 +10:00
Tim Mayberry b4fb1d610b Use portaudio callback API by default in portaudio backend 2015-12-02 10:24:07 +10:00
Tim Mayberry 5f267f92bf Rename member variables in Portaudio Backend for consistency 2015-12-02 10:24:07 +10:00
Tim Mayberry 29feb914b9 Rename blocking process function in portaudio backend 2015-12-02 10:24:06 +10:00
Tim Mayberry 3e6b28daca Rename blocking thread function in portaudio backend 2015-12-02 10:24:05 +10:00
Robin Gareus 73d1de3b75 NOOP, remove trailing whitespace, replace tabs in python scripts 2015-11-29 17:54:31 +01:00
Robin Gareus 5bdab24746 add some midi-debug printf() to the dummy backend 2015-11-28 22:54:00 +01:00
Tim Mayberry 07b2518979 Fix windows build when using pthreads-win32 library 2015-11-19 20:54:38 +10:00
Tim Mayberry ac301b998a Use a range of values for ASIO buffer sizes if provided by driver
This has been tested on four devices:

- A RME HDSP Multiface
- A Yamaha AG06
- A Focusrite 2i2
- A built-in soundcard running ASIO4ALL

The HDSP and the AG06 only return one buffer size when queried so the preferred
size is used as before.

The Focusrite returns a min corresponding to the position of the slider in the
control dialog and the max is 1024. The granularity is 1 so this means that the
number of values needs to be reduced for the current UI design with a combo
box so the granularity is increased until there are around 8-9 buffer sizes to
choose from evenly spaced between min and max(but we could easily change this
if the UI changes etc).

The ASIO4ALL driver returns a min of 64 and a max of 2048 and a granularity of
8. So where the minimum buffer size and granularity is a power of 2 use only
buffer sizes that are power of 2.

If the driver returns different values for min and max it is not currently
possible to indicate which is the driver preferred value. A checkbox or other
UI element could be added to the AudioSetup dialog to only use the preferred
value but that is more work and perhaps not necessary.
2015-11-19 10:23:26 +10:00
Tim Mayberry f1b336b01e Add support for callback API to portaudio backend but keep blocking API as default
Don't use the callback API for now until further and wider testing.
2015-11-19 10:23:26 +10:00
Robin Gareus 4b25c80cb9 fix edge-case in Dummy-backend random number generator initialization 2015-11-12 09:49:40 -06:00
Robin Gareus 661ffe7576 fix JACK/windows compilation 2015-10-28 14:11:17 +01:00
Robin Gareus 997f47360d use weak-jack's jack_port_rename wrapper
This avoids "[ERROR]: JACK: jack_port_set_name: deprecated".

if libjack does not have jack_port_rename(), weak_libjack.def provides
a fallback using jack_port_set_name().
2015-10-28 01:21:24 +01:00
Robin Gareus 7c58b4de5f coreaudio: reset freewheeling after export
fixes lively with session-fadeout
2015-10-10 02:42:13 +02:00
Tim Mayberry 5fd4ee3ef1 Fix handling of Sysex messages with WinMME midi driver 2015-10-07 21:48:56 +10:00
Paul Davis 2af78143c1 more debugging for MIDI input via WinMME 2015-10-06 12:42:01 -04:00
Paul Davis 89156be67a add more debugging to portaudio/MME MIDI backend 2015-10-06 11:01:58 -04:00
Tim Mayberry 4ebc6ef0b4 Fix WinMME midi driver shutdown with sysex enabled
midiInReset triggers the sysex callback to tell the application that it has
finished with the buffer. Calling midiInAddBuffer results in an infinite loop
so just return during shutdown.
2015-10-06 13:29:57 +10:00
Tim Mayberry 34d9b2148e Remove an unnecessary boolean argument in jack utils
Specify latency in JackCommandLineOptions instead
2015-10-06 13:29:57 +10:00
Robin Gareus 97bd6db2b7 remove i/ofstream from libardour
except: 
 * audio-unit (ifstream is known to work on OSX)
 * evoral curve algorithm debugger
 * cycle-timer debug code
 * export_handler's CDMarker  -> TODO
2015-10-05 22:15:17 +02:00
Paul Davis eb4c9b022a try enabling windows MME MIDI sysex support 2015-10-05 12:24:15 -04:00
Robin Gareus 22b07e0233 NOOP, remove trailing tabs/whitespace. 2015-10-05 16:17:49 +02:00
Paul Davis 4178db5f63 globally remove all trailing whitespace from .cpp and .hpp files missed by previous commit 2015-10-04 15:11:15 -04: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
Robin Gareus 87c36aba60 use new error-messages 2015-10-02 17:51:17 +02:00
Robin Gareus 3f99c44ff6 improve CoreAudio error reporting 2015-10-02 17:28:28 +02:00
Robin Gareus 6b4e5f1d47 ALSA: update error-codes for HW initialization. 2015-10-01 12:42:05 +02:00
Tim Mayberry dcf327f86a Return meaningful error codes when ALSA backend fails to start
Unfortunately it seems that in zita-alsa-pcmi doesn't set state() correctly in
some cases. Setting an invalid SR doesn't display the correct error message,
first guess would be that set_hwpar is failing and state() is not
representative of the actual error.
2015-10-01 09:10:19 +10:00
Tim Mayberry aa713fcd83 Return meaningful error codes when PortaudioBackend fails to start
So they can be used to give a contextual error message in the GUI
2015-10-01 09:10:19 +10:00
Tim Mayberry f178152114 Use portaudio error codes in the PortaudioIO class.
Having error codes defined in PortaudioIO means it is not dependent on the
ErrorCodes in AudioBackend but it doesn't really make sense to have another
set, so just use the PA ones until they become insufficient.
2015-10-01 09:10:19 +10:00
Robin Gareus bd5b97e964 Dummy: add a CC only test-sequence 2015-09-19 19:00:43 +02:00
John Emmas 44ea59495c MSVC projects - accommodate some modules that recently got moved or removed
(mostly these got moved out of the PortAudio backend and into libpbd)
2015-09-18 10:25:11 +01:00
Robin Gareus 1691e965a5 update reported DSP load for ALSA & Dummy 2015-09-16 18:24:57 +02:00
Robin Gareus 1c43383e92 CoreAudio: use libardour provided DSP load calc. 2015-09-16 18:24:57 +02:00
Tim Mayberry faa38a0d29 Use ARDOUR::DSPLoadCalculator in DummyBackend 2015-09-16 11:22:17 +10:00
Tim Mayberry 305f1d73bb Use PBD::get_microseconds() from pbd/windows_timer_utils.h in DummyBackend 2015-09-16 11:22:17 +10:00
Tim Mayberry 782dbf0e3f Set max time of DSPLoadCalculator in every cycle in ALSA backend 2015-09-16 11:22:17 +10:00
Tim Mayberry ccfe3e1015 Use ARDOUR::DSPLoadCalculator in ALSA Backend 2015-09-16 11:22:17 +10:00
Tim Mayberry d007fc05b1 De/Initialize MMCSS on windows in PBD::init/cleanup instead of in PA Backend 2015-09-16 11:22:16 +10:00
Tim Mayberry 091c4ed3a7 Move Windows MMCSS related utility functions into libpbd 2015-09-16 11:22:16 +10:00
Tim Mayberry d76fe212b7 Move MMCSS related utility functions into PBD namespace
In preparation for moving to libpbd
2015-09-16 11:22:16 +10:00
Tim Mayberry 3f5c01e4eb Move Windows timer utility functions from PA backend into libpbd 2015-09-16 11:22:16 +10:00
Tim Mayberry 4ffe8ffc0f Put Windows timer functions into PBD namespace in preparation for moving them to libpbd
Add functions for get/set the Multimedia timer resolution, although we are
really only interested in the minimum, this will facilitate testing

Put timer utility functions inside nested namespaces as they are platform
specific
2015-09-16 11:22:16 +10:00
Tim Mayberry 4330db1aa7 Update timestamp types in CycleTimer class to be signed 2015-09-16 11:22:16 +10:00
Tim Mayberry b2a7393553 Change types in DSPLoadCalculator to signed integer after change in utils::get_microsecond 2015-09-16 11:22:16 +10:00
Tim Mayberry a974659504 Check return value of windows timer functions and handle errors
Change return type of utils::get_microseconds to signed int and return -1 when
failing to read timer
2015-09-16 11:22:16 +10:00
Paul Davis ec06f2c49f spelling error fixes (notably "overriden" => "overidden") from IOhannes m zmölnig 2015-09-11 09:23:43 -04:00
John Emmas d2e083397c Add support for newly introduced class ARDOUR::DSPLoadCalculator (when building with MSVC) 2015-09-10 10:22:38 +01:00
Tim Mayberry 28803fface Remove DSPLoadCalculator class in portaudio backend source 2015-09-10 12:12:56 +10:00
Tim Mayberry c2e5bdedff Use ARDOUR::DSPLoadCalculator in PortAudioBackend 2015-09-10 12:12:56 +10:00
Robin Gareus d11b15fbca dummy, allow 8k buffer-size. 2015-09-08 15:14:02 +02:00
Robin Gareus 788234e317 fix dummy-backend driver state
When loading previous state, set_driver() is called before
enumerate_drivers(). 
The available driver list must be available early on.
2015-09-06 10:42:29 +02:00