User Tutorial:Testing AV Playback Tutorial
Introduction
This tutorial gives you an overview how to make sure that your computer system is able to fulfill the requirements of auditory and visual stimulus playback using BCI2000.
BCI2000 comes with an AVTest application module that produces video and audio suited to detect playback glitches. This is intended help you adjust system preferences in order to eliminate or minimize such glitches.
Running AVTest
To run the AVTest application module with the SignalGenerator source module, simply double-click on the AVTest_SignalGenerator batch file in the BCI2000 batch directory. Click Config to open the parameter config dialog, and navigate to the Application->Window section. There, enter your second monitor's left and top coordinate, and height and width (for more information about how to configure a dual monitor setup for use with BCI2000, see this description.
Video Quality Test
Then, after closing the parameter config dialog, click SetConfig. A rotating wheel will appear on the secondary monitor. The wheel is designed to move smoothly into the left direction. Any flicker or tearing will be clearly visible against the background of this movement. Also, in the lower part of the image, text is shown that indicates some data about the visual display. Of special interest is the field "frames lost" which represents the total number of frames for which BCI2000 has missed its rendering deadline. A small number of lost frames is ok, but if the number is rapidly increasing this indicates an issue with Vertical Blank Synchronization (see below).
If Vertical Blank Synchronization is not the cause of tearing and lost frames, it is possible that your machine's computing power is not sufficient to produce an image of the requested size within the duration of a frame. Especially, this may be the case with modern 4k displays and high frame rates. Try reducing frame rate and/or resolution of the second monitor.
Audio Quality Test
Once you have inspected the rotating wheel, you may progress to a simple audio playback test. The test consists of a 1kHz permanent sine tone. It should be clearly audible, without any crackling or stuttering. Click Start to enable the audio test, and Suspend to disable it again. If you experience crackling or stuttering, open the parameter config dialog, and locate the Application->Audio Playback section. There, edit the AudioBufferDuration parameter and enter 50ms. Close the parameter config dialog, click SetConfig and Start, and listen to the permanent sine tone again. Crackling and/or stuttering should be gone. You may now try and reduce the AudioBufferDuration parameter to find an optimal setting where latency is smaller but artifacts are still absent.
Take note of the AudioBufferDuration parameter and add it to your own parameter setup or batch file.
Vertical Blank Synchronization (Vsync)
To avoid tearing and flicker, BCI2000 uses Vertical Blank Synchronization, i.e. it synchronizes its rendering loop with the graphic card's monitor frame rate. This way, it ensures that frames are fully rendered before being displayed on screen.
Many graphic cards come with configuration tools that allow to disable Vertical Blank Synchronization. This is not a desired setting for use with BCI2000. If you experience tearing but have difficulties locating the Vsync setting, you may also try to "roll back" your graphics card driver to a previous version:
- Right-click the start menu,
- Choose "Device Manager",
- Open the "Display Adapters" section,
- Double-click your graphics card,
- Choose the "Driver" tab,
- Click "Roll Back Driver" and confirm any prompts.
See also
User Tutorial:P300 BCI Tutorial, User Tutorial:Mu Rhythm BCI Tutorial