Use muliti displays with PTB
[!CAUTION] Displayport splitter (so you can have a subject + mirror display) must support mirror mode. Most DP splitters work with extend mode which is incompatible with the mirror mode needed for PTB.
How to set up TWO (or THREE with Splitter) displays for PTB + Ubuntu
PTB uses and optimised display mode where X-Windows is set up so MATLAB occupies one X-screen and PTB can fully control another X-screen (it is not used by Ubuntu GUI at all). The important point is that this system uses X11 config files, and so you should first ensure that X!! doesn’t have lots of other config files that may interfere. The config files are stored in /etc/X11/
and /etc/X11/xorg.conf.d/
. Check to see if the is an xorg.cong
file in /etc/X11/
or files in /etc/X11/xorg.conf.d/
. PTB’s config file is called /etc/X11/xorg.conf.d/90-ptbxorg.conf
when it is installed, see below.
Make sure you have properly installed MATLAB + PTB:
- Don’t use
sudo
to install MATLAB, which means don’t select the option to install executable shortcuts in the installer. - After MATLAB is installed, make sure you run
sudo apt-get install matlab-support
and follow instructions, and replace the C++ libraries. - Get PTB (I prefer to use
git
so I can keep PTB up-to-date). Make sure it is installed in a~/
home folder (I use~/Code/Psychtoolbox
). cd
to the PTB folder and runSetupPsychtoolbox.m
— make sure it runs properly and you see no errors.
Once installed and tested (see if VBLSyncTest.m
runs etc.), make sure your TWO monitors are plugged in and working (Ubuntu extends the display by default):
- Run
XOrgConfCreator
and select the multi-monitor option. - Unless you know what you are doing, don’t change any advanced settings yet.
- Save the config using the default options (PTB names the files for you and puts them in the right place).
XOrgConfSelector.m
to choose that file.- Log out and log back in to “activate” this configuration file.
You can also use XOrgConfSelector.m
to remove the config file (select 0 as an option). Or you can manually delete the file yourself if Ubuntu cannot login porperly then you need to use a console to manually delete the file:
- Type CTRL+ALT+F3 to enter a terminal session.
- log in with user name and password.
- Type
sudo rm /etc/X11/xorg.conf.d/90-ptbxorg.conf
- Try CTRL+ALT+F1 to switch back to the GUI, or reboot otherwise.