# Video frame rate in Ubuntu

**URL:** <https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69>\
**Category:** Uncategorized\
**Created:** [November 24, 2017, 4:40am UTC](https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69 "2017-11-24T04:40:23Z")\
**Posts on this page:** 5\
**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:** [November 24, 2017, 4:40am UTC](https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69/1 "2017-11-24T04:40:23Z")

</div>

Psychtoolbox aficionados:

&nbsp;

I’m converting from Mac OSX to Linux, and cannot obtain the required video frame rate.

&nbsp;

My system is dual-boot with Mac OSX on one side and Ubuntu on the other.

&nbsp;

I can obtain 800 pixels x 600 pixels x 120 Hz on the Mac side, and I’ve confirmed the frame rate with a photometer. So I know that the hardware can support 120 Hz.

&nbsp;

But when I run

&nbsp;

&nbsp; Matlab \> SetResolution(1, 800, 600, 120)

&nbsp;

on Linux the result is

&nbsp;

&nbsp; Error using SetResolution (line 105)

&nbsp; Can't find a resolution of 800 x 600 x 120 Hz. Resolution remains unchanged.

&nbsp;

See below for system details.

&nbsp;

Any ideas?

&nbsp;

Regards,

&nbsp;

Alan Freeman.

&nbsp;

&nbsp;

SYSTEM SETTINGS

&nbsp;

Processor: Intel Xeon

Operating system: Ubuntu 16.04 LTS

&nbsp;

TERMINAL

&nbsp;

alan@alan-MacPro:~$ sudo lshw

[sudo] password for alan:

alan-macpro&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp;description: Tower Computer

&nbsp;&nbsp;&nbsp; product: MacPro5,1 (System SKU#)

&nbsp;&nbsp;&nbsp; vendor: Apple Inc.

&nbsp;&nbsp;&nbsp; version: 0.0

&nbsp;&nbsp;&nbsp; serial: YM142008EUG

&nbsp;&nbsp;&nbsp; width: 64 bits

&nbsp;&nbsp;&nbsp; capabilities: smbios-2.4 dmi-2.4 vsyscall32

&nbsp;&nbsp;&nbsp; configuration: boot=normal chassis=tower family=MacPro sku=System SKU# uuid=84F78D82-FB6A-AC5F-BE13-3CF105E5DC37

&nbsp; \*-core

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; description: Motherboard

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; product: Mac-F221BEC8

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; vendor: Apple Inc.

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; physical id: 0

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; serial: J5138018SCZJC

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; slot: Part Component

...

alan@alan-MacPro:~$ xrandr

Screen 0: minimum 320 x 200, current 1280 x 1024, maximum 8192 x 8192

DisplayPort-0 connected primary 1280x1024+0+0 (normal left inverted right x axis y axis) 338mm x 270mm

&nbsp;&nbsp; 1280x1024&nbsp;&nbsp;&nbsp;&nbsp; 60.02\*+&nbsp; 75.02&nbsp;

&nbsp;&nbsp;&nbsp;1280x960&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 75.04&nbsp;&nbsp;&nbsp; 70.03&nbsp;&nbsp;&nbsp; 60.00&nbsp;

&nbsp;&nbsp;&nbsp;1152x864&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 75.00&nbsp;&nbsp;&nbsp; 69.97&nbsp;&nbsp;&nbsp; 59.97&nbsp;

&nbsp;&nbsp;&nbsp;1024x768&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 75.03&nbsp;&nbsp;&nbsp; 70.07&nbsp;&nbsp;&nbsp; 60.00&nbsp;

&nbsp;&nbsp;&nbsp;832x624&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 74.55&nbsp;

&nbsp;&nbsp;&nbsp;800x600&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 72.19&nbsp;&nbsp;&nbsp; 75.00&nbsp;&nbsp;&nbsp; 60.32&nbsp;&nbsp;&nbsp; 56.25&nbsp;

&nbsp;&nbsp;&nbsp;640x480&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 75.00&nbsp;&nbsp;&nbsp; 72.81&nbsp;&nbsp;&nbsp; 66.67&nbsp;&nbsp;&nbsp; 59.94&nbsp;

&nbsp;&nbsp;&nbsp;720x400&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 70.08&nbsp;

&nbsp;

MATLAB

&nbsp;

> \>\> version

&nbsp;

ans =

&nbsp;

9.1.0.441655 (R2016b)

&nbsp;

> \>\> Screen('version')

&nbsp;

ans =

&nbsp;

&nbsp; struct with fields:

&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp; version: '3.0.14.464087083'

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; major: 3

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; minor: 0

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; point: 14

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; build: 464087083

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; date: 'Jun&nbsp; 8 2017'

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; time: '09:04:43'

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; module: 'Screen'

&nbsp;&nbsp;&nbsp;&nbsp; project: 'OpenGL Psychtoolbox'

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; os: 'GNU/Linux X11'

&nbsp;&nbsp;&nbsp; language: 'Matlab 64-Bit'

&nbsp;&nbsp;&nbsp;&nbsp; authors: [1×7 struct]

&nbsp;

> \>\> Screen('screens')

&nbsp;

ans =

&nbsp;

&nbsp;&nbsp;&nbsp;&nbsp; 0&nbsp;&nbsp;&nbsp;&nbsp; 1

&nbsp;

> \>\> ResolutionTest(1)

&nbsp;

SCREEN 1: CURRENT COMBINED RESOLUTION:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 1920

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height: 1440

&nbsp;&nbsp;&nbsp; pixelSize: 24

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hz: 60

&nbsp;

&nbsp;

SCREEN 1 - Output 0: CURRENT RESOLUTION:

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; width: 1920

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; height: 1440

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pixelSize: 24

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; hz: 60

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xStart: 0

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yStart: 0

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name: 'DVI-0'

&nbsp;&nbsp;&nbsp;&nbsp; displayWidthMM: 360

&nbsp;&nbsp;&nbsp; displayHeightMM: 270

&nbsp;

&nbsp;

&nbsp;

SCREEN 1: AVAILABLE COMBINED RESOLUTIONS:

1920 x 1440

1600 x 1200

1280 x 1024

1152 x 864

1024 x 768

832 x 624

800 x 600

640 x 480

720 x 400

&nbsp;

SCREEN 1: AVAILABLE COMBINED DETAILED RESOLUTIONS:

1920 x 1440&nbsp;&nbsp;&nbsp; 60 Hz 24 bits

1600 x 1200&nbsp;&nbsp;&nbsp; 70 Hz 24 bits

1280 x 1024&nbsp;&nbsp;&nbsp; 85 Hz 24 bits

1280 x 1024&nbsp;&nbsp;&nbsp; 75 Hz 24 bits

1152 x&nbsp; 864&nbsp;&nbsp;&nbsp; 75 Hz 24 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 85 Hz 24 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 75 Hz 24 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 70 Hz 24 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 60 Hz 24 bits

832 x&nbsp; 624&nbsp;&nbsp;&nbsp; 75 Hz 24 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 85 Hz 24 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 72 Hz 24 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 75 Hz 24 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 60 Hz 24 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 85 Hz 24 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 75 Hz 24 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 73 Hz 24 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 60 Hz 24 bits

720 x&nbsp; 400&nbsp;&nbsp;&nbsp; 70 Hz 24 bits

&nbsp;

&nbsp;

SCREEN 1 - OUTPUT 0: AVAILABLE PER OUTPUT DETAILED RESOLUTIONS:

1920 x 1440&nbsp;&nbsp;&nbsp; 60 Hz 32 bits

1600 x 1200&nbsp;&nbsp;&nbsp; 70 Hz 32 bits

1280 x 1024&nbsp;&nbsp;&nbsp; 85 Hz 32 bits

1280 x 1024&nbsp;&nbsp;&nbsp; 75 Hz 32 bits

1152 x&nbsp; 864&nbsp;&nbsp;&nbsp; 75 Hz 32 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 85 Hz 32 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 75 Hz 32 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 70 Hz 32 bits

1024 x&nbsp; 768&nbsp;&nbsp;&nbsp; 60 Hz 32 bits

832 x&nbsp; 624&nbsp;&nbsp;&nbsp; 75 Hz 32 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 85 Hz 32 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 72 Hz 32 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 75 Hz 32 bits

800 x&nbsp; 600&nbsp;&nbsp;&nbsp; 60 Hz 32 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 85 Hz 32 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 75 Hz 32 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 73 Hz 32 bits

640 x&nbsp; 480&nbsp;&nbsp;&nbsp; 60 Hz 32 bits

720 x&nbsp; 400&nbsp;&nbsp;&nbsp; 70 Hz 32 bits

&nbsp;

&nbsp;

> \>\>

&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:** [November 28, 2017, 7:02pm UTC](https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69/2 "2017-11-28T19:02:23Z")

</div>

Alan,  
  
has this been resolved via Uli's pointers?  
  
I wonder if it might make sense to add a little helper function to PTB to automate this process.  
-mario

---

<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:** [November 28, 2017, 11:02pm UTC](https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69/3 "2017-11-28T23:02:41Z")

</div>

Mario, Uli:

> \> has this been resolved via Uli's pointers?

I have two monitors attached to a single video card, with one monitor for command and the other for stimulation.

The stimulus monitor is dark until I use Screen to open a window on it. Xrandr reports only on the command monitor, presumably because the stimulus monitor is inactive. I am therefore having trouble running

&nbsp; xrandr --addmode name “800x600\_120”

because I can’t find the name of the stimulus monitor.

How do I activate a second monitor?

> \> I wonder if it might make sense to add a little helper function to PTB to automate this process.

I speak Linux poorly, so any help is welcome!

Regards,

Alan.

&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:** [November 28, 2017, 11:53pm UTC](https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69/4 "2017-11-28T23:53:39Z")

</div>

---In PSYCHTOOLBOX@yahoogroups.com, \<alan.freeman@...\> wrote :  
  

Mario, Uli:

> > \> has this been resolved via Uli's pointers?
> 
> I have two monitors attached to a single video card, with one monitor for command and the other for stimulation.
> 
> The stimulus monitor is dark until I use Screen to open a window on it. Xrandr reports only on the command monitor, presumably because the stimulus monitor is inactive. I am therefore having trouble running
> 
> &nbsp; xrandr --addmode name “800x600\_120”
> 
> because I can’t find the name of the stimulus monitor.
> 
> How do I activate a second monitor?
> 
> -\> So xrandr only shows X-Screen 0 (=your desktop GUI display) by default in multi-x-screen mode: Prefixing --screen 1 selects X-Screen 1, the stimulation screen, instead:
> 
> In your case:
> 
> \> xrandr --screen 1
> 
> would show the output named DVI-0 as assigned to that screen, and its parameters.
> 
> % Generate video timing modeline for 800x600 at 120 Hz:
> 
> \> gtf 800 600 120
> 
> Gives as output:
> 
> &nbsp; # 800x600 @ 120.00 Hz (GTF) hsync: 77.16 kHz; pclk: 83.95 MHz  
> &nbsp; Modeline "800x600\_120.00"&nbsp; 83.95&nbsp; 800 856 944 1088&nbsp; 600 601 604 643&nbsp; -HSync +Vsync
> 
> % Add to database of supported modes:
> 
> \> xrandr --screen 1 --newmode "800x600\_120.00"&nbsp; 83.95&nbsp; 800 856 944 1088&nbsp; 600 601 604 643&nbsp; -HSync +Vsync
> 
> % Add to list of supported modes for video output "DVI-0" on X-Screen 1:
> 
> xrandr --screen 1 --addmode DVI-0 "800x600\_120.00"
> 
> From now on you can either use SetResolution(1, 800, 600, 120) in PTB, or do it also from a terminal:
> 
> xrandr --screen 1 --output DVI-0 --mode 800x600\_120.00
> 
> You could put these commands into a shell script to execute, or you could also put it into a little Matlab script, which executes them via the system() command.
> 
> One could also put such additional mode definitions into the xorg.conf files generated by XOrgConfCreator, that might be a worthwhile new feature for XOrgConfCreator() for a future PTB beta.
> 
> -mario
> 
> > \> I wonder if it might make sense to add a little helper function to PTB to automate this process.
> 
> I speak Linux poorly, so any help is welcome!
> 
> Regards,
> 
> Alan.
> 
> &nbsp;

---

<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:** [November 30, 2017, 6:09am UTC](https://psychtoolbox.discourse.group/t/video-frame-rate-in-ubuntu/69/5 "2017-11-30T06:09:58Z")

</div>

Mario, Uli:

xrandr --screen 1 --addmode DVI-0 "800x600\_120.00"

Wow, it works!

One could also put such additional mode definitions into the xorg.conf files generated by XOrgConfCreator, that might be a worthwhile new feature for XOrgConfCreator() for a future PTB beta.

Good idea.

Thanks for your help,

Alan.

&nbsp;
