# PTB sync problems at 160 H, in ubuntu

**URL:** <https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85>\
**Category:** Uncategorized\
**Created:** [August 15, 2017, 2:12pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85 "2017-08-15T14:12:32Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Allen\_Ingling](https://avatars.discourse-cdn.com/v4/letter/a/a183cd/32.png) [@Allen\_Ingling](https://psychtoolbox.discourse.group/u/Allen_Ingling)\
**Post date:** [August 15, 2017, 2:12pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/1 "2017-08-15T14:12:32Z")

</div>

To achieve fast frame rate, we are running our experiments on a DELL (Precision Tower 5810) with a NVidiaG96GL (Quadro FX 580) graphic card using a Ubuntu 64-bit OS, in Psychtoolbox-3 for GNU/Linux X11 (version 3.0.13), under MATLAB R2017a (64 bit) with a dual monitor setup: for stimulus display, we use a Barco monitor connected to the HDMI port (using a HDMI to VGA converter), and for control a regular monitor plugged into a DVI port.

We managed to achieve a refresh rate of 160 frames per second, but 1-2 % of the frames are skipped. A screentest reveals poor synchronization; one of the psychtoolbox warning messages recommends installation of the most recent graphic card driver, and another one suggest that the problems are caused because the program runs into a virtual machine (which is, to my knowledge, not the case). Unfortunately, updating the Nvidia driver added a problem instead of solving one, because the Nvidia control panel now only recognizes both monitors when they are in mirror mode (as opposed to extended mode). Although the problem is mentioned on Ubuntu forums, I couldn’t find a solution that works; neither did reinstalling older versions of the Nvidia driver. Any advice is greatly appreciated!

&nbsp;

Thanks, Nic

&nbsp;

  

* * *
  
The contents of this email message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, for the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify sender by reply email or by (718) 270-HELP.

---

<div class="post-metadata">

**Author:** ![dcnieho](https://avatars.discourse-cdn.com/v4/letter/d/779978/32.png) [@dcnieho](https://psychtoolbox.discourse.group/u/dcnieho)\
**Post date:** [August 16, 2017, 11:00am UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/2 "2017-08-16T11:00:54Z")

</div>

Hi Nicolas,
  

Are you fully up to date? UpdatePsychtoolbox()

What version of ubuntu exactly?

When starting psychtoolbox, it gives some info about graphics card and driver, etc. Can you post that?

  

All the best,

Dee

  

> On Tue, Aug 15, 2017 at 4:12 PM, Nicolas Brunet [Nicolas.Brunet@...](mailto:Nicolas.Brunet@...) [PSYCHTOOLBOX] \<[PSYCHTOOLBOX@yahoogroups.com](mailto:PSYCHTOOLBOX@yahoogroups.com)\> wrote:  
> 
> > To achieve fast frame rate, we are running our experiments on a DELL (Precision Tower 5810) with a NVidiaG96GL (Quadro FX 580) graphic card using a Ubuntu 64-bit OS, in Psychtoolbox-3 for GNU/Linux X11 (version 3.0.13), under MATLAB R2017a (64 bit) with a dual monitor setup: for stimulus display, we use a Barco monitor connected to the HDMI port (using a HDMI to VGA converter), and for control a regular monitor plugged into a DVI port.
> > 
> > We managed to achieve a refresh rate of 160 frames per second, but 1-2 % of the frames are skipped. A screentest reveals poor synchronization; one of the psychtoolbox warning messages recommends installation of the most recent graphic card driver, and another one suggest that the problems are caused because the program runs into a virtual machine (which is, to my knowledge, not the case). Unfortunately, updating the Nvidia driver added a problem instead of solving one, because the Nvidia control panel now only recognizes both monitors when they are in mirror mode (as opposed to extended mode). Although the problem is mentioned on Ubuntu forums, I couldn’t find a solution that works; neither did reinstalling older versions of the Nvidia driver. Any advice is greatly appreciated!
> > 
> > Thanks, Nic
> > 
> >   
> > 
> > * * *
> >   
> > The contents of this email message and any attachments are confidential and are intended solely for the addressee. The information may also be legally privileged. This transmission is sent in trust, for the sole purpose of delivery to the intended recipient. If you have received this transmission in error, any use, reproduction or dissemination of this transmission is strictly prohibited. If you are not the intended recipient, please immediately notify sender by reply email or by (718) 270-HELP.

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [August 17, 2017, 4:46pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/3 "2017-08-17T16:46:04Z")

</div>

Nope, don't upgrade.  
  
Instead provide the full output of Psychtoolbox to the Matlab console ("diary on" makes this easy -\> help diary), after setting Screen('Preference','Verbosity', 10); run some standard test like PerceptualVBLSyncTest. How exactly does your xorg.conf file look?  
  
Other things:  
  
1. Your PTB is outdated, update it to the recent version 3.0.14.  
  
2. If this is a installation from NeuroDebian, did you run PsychLinuxConfiguration manually, as our setup instructions told you?  
  
3. If this is a installation via DownloadPsychtoolbox, did you (sudo apt install matlab-support) install the matlab-support package as our instructions told you, to work around Matlab's brokeness?  
  
If PTB claims it is running in a virtual machine then it is not using the hardware graphics at all, which could be caused, e.g., by Matlab's brokenness if steps 2 and 3 weren't properly executed to work around that.  
  
However, not knowing the complexity of your stimuli or how your code is written, it doesn't sound unreasonable to me that those 1-2% of skipped frames are just due to suboptimal programming, or caused by lack of performance, given that your graphics card is a rather old and low-performance model by todays standards.  
  
-mario

---

<div class="post-metadata">

**Author:** ![nb0011](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@nb0011](https://psychtoolbox.discourse.group/u/nb0011)\
**Post date:** [August 17, 2017, 7:37pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/4 "2017-08-17T19:37:50Z")

</div>

Update: everything is now working and running flawless! I ran a test displaying \> 100,000 stimuli @ 160 Hz, and not a single skipped frame!  
  
The winning combination:  
Ubuntu 16.04  
MATLAB R2017a (64 bit)  
PTB 3.0.13  
Graphic card: NVidiaG96GL (Quadro FX 580)  
Driver: Nvidia 340.102  
Display manager: lightdm  
Desktop environment: Unity.  
  
Thanks everybody for the advice and feedback!

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [August 17, 2017, 8:17pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/5 "2017-08-17T20:17:07Z")

</div>

So what fixed it?  
-mario

---

<div class="post-metadata">

**Author:** ![nb0011](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@nb0011](https://psychtoolbox.discourse.group/u/nb0011)\
**Post date:** [August 21, 2017, 8:02pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/6 "2017-08-21T20:02:53Z")

</div>

Mario: when I switched the desktop environment to Unity, everything suddenly worked.&nbsp;

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [August 21, 2017, 8:46pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/7 "2017-08-21T20:46:45Z")

</div>

What did you use before? Is this now a setup with separate x-screens, as it should be for trustworthy timing? screen 0 for the GUI, screen 1 for the stimulation?  
  
-mario

---

<div class="post-metadata">

**Author:** ![nb0011](https://avatars.discourse-cdn.com/v4/letter/n/d2c977/32.png) [@nb0011](https://psychtoolbox.discourse.group/u/nb0011)\
**Post date:** [August 22, 2017, 6:36pm UTC](https://psychtoolbox.discourse.group/t/ptb-sync-problems-at-160-h-in-ubuntu/85/8 "2017-08-22T18:36:43Z")

</div>

This is a bit bizarre:  
First I had a setup with separate X-screens but unreliable timing  
After upgrading the graphic card, NVidia didn't recognize my xorg.conf file anymore and the NVidia GUI didn't allow me to setup two separate X-screens.  
Then I started to changing the driver, display manager, and desktop environment without success. Finally. after trying many combinations. I switched (back) to Unity, and when I opened the NVidia GUI, it suddenly "recognized" my xorg.conf file and assigned separate X-screens to each of my two monitors; Unlike before, the timing (displaying stimuli at 160 Hz) was perfect. I have no idea why it didn't work before and why it does now.
