Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Hardware: Audio Devices
For many studies in the area of audio perception and audio-visual integration it is important to be able to play back sound signals with a low onset latency and/or at precisely defined points in time, e.g., in exact synchrony to the onset of a visual or tactile stimulus.
Standard sound drivers and output functions as provided by Matlab (e.g.,
SND) as well as the sound
drivers of many other psychophysics toolkits are not really well suited
for low latency sound playback with high timing precision, because they
don't provide mechanisms for timed sound onset, timing control or low
latency operation. Their sole purpose is to make it simple to playback a
sound, without any special emphasis on high efficiency or precise
timing. Apart from that, Matlabs sound drivers have been the cause of
many sound playback problems and crashes due to some significant bugs
and design flaws in their implementation.
PTB-3's new sound driver
PsychPortAudio tries to address this issues
and to provide a sound driver specifically designed for the needs of
psychophysics. Currently the driver can play back multi-channel sound
(on multi-channel sound hardware), and it supports audio recording and
simultaneous recording and playback (full duplex mode), also from
multiple channels on multi-channel hardware.
The current driver (as shipped with PTB-3
beta) supports Microsoft
Windows 2000 to Windows 10,
MacOS/X (tested with Tiger 10.4.9 to 10.13 on
PowerPC), as well as
GNU/Linux (tested with
Ubuntu 7.1 on a MacBookPro with the ALSA sound system and on Ubuntu 14.04,
14.10,15.04,15.10,16.04 on a variety of systems).
The current driver provides two different classes of sound output,
normal playback mode and low-latency, high precision mode.
Normal mode is the default mode of operation. It should allow for
reliable, glitch free sound playback with low processor load on the
widest possible variety of sound hardware. Low latency, high
precision mode is optimized for low sound onset latencies and high
precision of sound onset at requested times, prioritizing that goals
over any other goals (e.g., low system load). While this high precision
mode works very well out of the box on standard Macintosh computers with
OS/X, as well as on standard PC's under
GNU/Linux, it needs
special hardware drivers on the Windows platform, so called ASIO drivers
to get similar performance on that operating system.
Disclaimer: "ASIO is a trademark and software of Steinberg Media Technologies GmbH."
MS-Windows built-in sound subsystems are pretty much incapable by design
of providing well defined timing in the auditory domain and are
sub-standard in many other areas as well. As a way around that
limitation, the German company Steinberg, vendor of well-known
professional sound applications and equipment for Windows PC's, designed
an alternative sound subsystem called ASIO ("Audio streaming input
output") specifically for the needs of professional sound production.
Today, all high end soundcards ship with special ASIO drivers - device
drivers that implement that interface in addition to the standard sound
interfaces of MS-Windows, and professional level sound applications do
use that ASIO interface to control sound hardware, bypassing the Windows
sound system entirely. Our
PsychPortAudio driver can take advantage of
ASIO if you install a special ASIO enabled portaudio DLL file, provided by
Mario Kleiner under the following download link. The DLL is not part of
the standard Psychtoolbox distribution due to licensing restrictions wrt.
ASIO. The DLL contained in the following download link is for personal
research use only. Redistribution to third partys is forbidden.
The license file, contained in the downloadable zip file, grants you a non-exclusive,
royalty free right to copy and use the above linked DLL file for the purpose of using it
PsychPortAudio driver on Microsoft Windows operating systems,
directly given to you by Mario Kleiner, the copyright holder of that driver
file, as long as you comply to the license terms. Redistribution to third partys
without Mario Kleiner's explicit permission is forbidden.
Tested configurations of OS & Sound hardware: Optimal parameter settings with measured results
|Operating System||Sound card and Driver||ASIO type||PsychPortAudio('Open') parameters||Onset latency (ms)||Onset accuracy (stddev from mean in ms)||Misc comments||Who?|
|OS/X 10.4.9||Intel MacBookPro 2.33Ghz, Intel HDA onboard sound||Not needed||Pa('Open', , , 2, 96000, 2 [, 64])||5.49 ms||0.022 ms||Just works :-)||M. di Luca and M. Kleiner|
|WinXP-SP2||Dell computer with M-Audio Delta 1010-LT multichannel card||native||('Open', , , 2, 96000, 2 [, 64])||5.87 ms||0.018 ms||Just works :-)||M. di Luca and M. Kleiner|
|WinXP-SP2||Computer with Creative Labs Audigy 4 card||native||('Open', , , 2, 96000, 2 [, 64])||4 ms||better than 0.1 ms||1 ms bias without latency bias set||Ken Roberts - Duke univ.|