13
0
Commit Graph

137 Commits

Author SHA1 Message Date
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
fd6377a5af PortAudio: skip process callbacks until ports are established 2017-08-07 19:27:37 +02:00
fde07d4f4f amend bc46a7e2e9; fix blind coding typos 2017-08-05 16:17:31 +02:00
bc46a7e2e9 PortAudio backend RT-safe MIDI buffer allocation 2017-08-05 15:36:36 +02:00
2b7c585dba Update backend API: read-only MIDI input buffers 2017-08-05 15:36:36 +02:00
c125cd2647 Reduce DSP thread priority (main-i/o > midi i/o > computation) 2017-08-05 01:28:11 +02:00
6b5d374352 Some more assert() debugging 2017-08-03 23:46:05 +02:00
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
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
335debfa2f Add API to enforce valid device selection. 2016-11-26 15:31:21 +01:00
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
8b5fad0cf9 Use better debug output in PortaudioBackend
When failing to open audio stream in callback mode
2016-11-10 15:23:43 +10:00
cf52d6e4b4 enough with umpteen "i18n.h" files. Consolidate on pbd/i18n.h 2016-07-14 14:45:23 -04:00
d8ac5eddf7 add missing include 2016-05-06 21:25:21 +02:00
514da9881d convert WinMME Device names to UTF-8 2016-05-06 20:59:24 +02:00
9840a11537 implement metadata-set for remaining backends 2016-04-18 00:35:51 +02:00
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
9472200727 fix hang at exit (after freewheeling) with PA-nonblocking backend 2016-02-27 00:50:02 +01:00
148f2ab8e5 Add debugging output for WinMME midi device names 2016-02-11 12:15:07 +10:00
1499cd8670 Only build one version of the Portaudio backend that supports both blocking and callback API 2016-02-11 12:15:07 +10:00
830db39585 Implement new AudioBackend API in PA backend to choose between callback and blocking API 2016-02-11 12:15:07 +10:00
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
b2cf028fcb Implement MIDI device enumeration and latency offset/calibration in portaudio backend 2016-02-11 12:15:07 +10:00
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
fe0802169c standardize port-names 2015-12-08 15:32:05 +01:00
1372407f82 fix previous commit. 2015-12-08 00:52:06 +01:00
8781004ca2 portaudio connect & graph-changed callbacks (untested) 2015-12-08 00:36:29 +01:00
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
b4fb1d610b Use portaudio callback API by default in portaudio backend 2015-12-02 10:24:07 +10:00
5f267f92bf Rename member variables in Portaudio Backend for consistency 2015-12-02 10:24:07 +10:00
29feb914b9 Rename blocking process function in portaudio backend 2015-12-02 10:24:06 +10:00
3e6b28daca Rename blocking thread function in portaudio backend 2015-12-02 10:24:05 +10:00
07b2518979 Fix windows build when using pthreads-win32 library 2015-11-19 20:54:38 +10:00
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
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
5fd4ee3ef1 Fix handling of Sysex messages with WinMME midi driver 2015-10-07 21:48:56 +10:00
2af78143c1 more debugging for MIDI input via WinMME 2015-10-06 12:42:01 -04:00
89156be67a add more debugging to portaudio/MME MIDI backend 2015-10-06 11:01:58 -04:00
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
eb4c9b022a try enabling windows MME MIDI sysex support 2015-10-05 12:24:15 -04:00
87c36aba60 use new error-messages 2015-10-02 17:51:17 +02:00
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
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
d007fc05b1 De/Initialize MMCSS on windows in PBD::init/cleanup instead of in PA Backend 2015-09-16 11:22:16 +10:00
091c4ed3a7 Move Windows MMCSS related utility functions into libpbd 2015-09-16 11:22:16 +10:00
d76fe212b7 Move MMCSS related utility functions into PBD namespace
In preparation for moving to libpbd
2015-09-16 11:22:16 +10:00
3f5c01e4eb Move Windows timer utility functions from PA backend into libpbd 2015-09-16 11:22:16 +10:00
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
4330db1aa7 Update timestamp types in CycleTimer class to be signed 2015-09-16 11:22:16 +10:00
b2a7393553 Change types in DSPLoadCalculator to signed integer after change in utils::get_microsecond 2015-09-16 11:22:16 +10:00