13
0
Commit Graph

113 Commits

Author SHA1 Message Date
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
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
28803fface Remove DSPLoadCalculator class in portaudio backend source 2015-09-10 12:12:56 +10:00
c2e5bdedff Use ARDOUR::DSPLoadCalculator in PortAudioBackend 2015-09-10 12:12:56 +10:00
7521028831 Add debug output for errors when setting MMCSS thread characteristics 2015-09-02 12:07:59 +10:00
3618689103 Use MMCSS utility functions in PortaudioBackend 2015-09-02 12:07:59 +10:00
b288a40220 Add utility functions in PortaudioBackend for re/setting MMCSS thread characteristics 2015-09-02 12:07:59 +10:00
77ce989dfa Pass input and output audio buffers into PortaudioBackend blocking process function
This makes it possible to reuse the method for callback based processing
2015-09-02 12:07:59 +10:00
a6fb71022f Add audio_utils.h header in PortaudioBackend for de/interleaving audio data 2015-09-02 12:07:59 +10:00
23a490c906 Add two utility methods to abstract PortAudioBackend state
These may change as support for callback API is added
2015-09-02 12:07:58 +10:00
f143d76523 Extract MIDI input/output processing in PortAudioBackend into new methods 2015-09-02 12:07:58 +10:00
a65b1ddedc Add a DSPLoadCalculator class to the PortAudioBackend for DSP load calculation
The class uses the same algorithm as in the coreaudio and alsa backends and
should probably go into libardour at some point
2015-09-02 12:07:58 +10:00
cb7bac5599 Fix include style of system header 2015-09-02 12:07:58 +10:00
5448c229d9 Extract main processing section of PortAudioBackend into new method 2015-09-02 12:07:58 +10:00
f27d8e1e23 Extract freewheel processing in PortAudioBackend into new method 2015-09-02 12:07:58 +10:00
cf81caa798 Don't update unused dsp timer variable in freewheel process in PortaudioBackend 2015-09-02 12:07:58 +10:00
7b23f80b03 Refactor port change handling part of PA Backend process function into new method 2015-09-02 12:07:58 +10:00
684701427e Rename variables in PortaudioBackend in preparation for using PA callback API 2015-09-02 12:07:58 +10:00
56b5e04c3b Fix copy and paste error in debug output message in WINMME Midi Output 2015-09-02 12:07:58 +10:00
ac5eac471d Signal WinMME Midi output thread so the thread wakes up and terminates properly 2015-09-02 12:07:15 +10:00
d520b9c878 Stop WINMME midi driver/devices when PortAudio backend is stopped 2015-09-02 12:07:15 +10:00
2dbdaaa8f5 Refactor part of PortAudioBackend::_start/stop into new methods 2015-09-02 12:07:15 +10:00
f58282844d Don't add "None" devices for ASIO driver in PortaudioBackend 2015-09-02 12:07:15 +10:00
0396df963f Implement new AudioBackend API for force updating devices in PortaudioBackend 2015-09-02 12:07:15 +10:00
585930f058 Update devices in PortaudioBackend when setting the driver
Reinitialize portaudio to pick up changes in devices and ASIO buffer settings
2015-09-02 12:07:15 +10:00