Video frame rate in Ubuntu

Psychtoolbox aficionados:

 

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

 

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

 

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.

 

But when I run

 

  Matlab > SetResolution(1, 800, 600, 120)

 

on Linux the result is

 

  Error using SetResolution (line 105)

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

 

See below for system details.

 

Any ideas?

 

Regards,

 

Alan Freeman.

 

 

SYSTEM SETTINGS

 

Processor: Intel Xeon

Operating system: Ubuntu 16.04 LTS

 

TERMINAL

 

alan@alan-MacPro:~$ sudo lshw

[sudo] password for alan:

alan-macpro              

    description: Tower Computer

    product: MacPro5,1 (System SKU#)

    vendor: Apple Inc.

    version: 0.0

    serial: YM142008EUG

    width: 64 bits

    capabilities: smbios-2.4 dmi-2.4 vsyscall32

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

  *-core

       description: Motherboard

       product: Mac-F221BEC8

       vendor: Apple Inc.

       physical id: 0

       serial: J5138018SCZJC

       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

   1280x1024     60.02*+  75.02 

   1280x960      75.04    70.03    60.00 

   1152x864      75.00    69.97    59.97 

   1024x768      75.03    70.07    60.00 

   832x624       74.55 

   800x600       72.19    75.00    60.32    56.25 

   640x480       75.00    72.81    66.67    59.94 

   720x400       70.08 

 

MATLAB

 

>> version

 

ans =

 

9.1.0.441655 (R2016b)

 

>> Screen('version')

 

ans =

 

  struct with fields:

 

     version: '3.0.14.464087083'

       major: 3

       minor: 0

       point: 14

       build: 464087083

        date: 'Jun  8 2017'

        time: '09:04:43'

      module: 'Screen'

     project: 'OpenGL Psychtoolbox'

          os: 'GNU/Linux X11'

    language: 'Matlab 64-Bit'

     authors: [1×7 struct]

 

>> Screen('screens')

 

ans =

 

     0     1

 

>> ResolutionTest(1)

 

SCREEN 1: CURRENT COMBINED RESOLUTION:

        width: 1920

       height: 1440

    pixelSize: 24

           hz: 60

 

 

SCREEN 1 - Output 0: CURRENT RESOLUTION:

              width: 1920

             height: 1440

          pixelSize: 24

                 hz: 60

             xStart: 0

             yStart: 0

               name: 'DVI-0'

     displayWidthMM: 360

    displayHeightMM: 270

 

 

 

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

 

SCREEN 1: AVAILABLE COMBINED DETAILED RESOLUTIONS:

1920 x 1440    60 Hz 24 bits

1600 x 1200    70 Hz 24 bits

1280 x 1024    85 Hz 24 bits

1280 x 1024    75 Hz 24 bits

1152 x  864    75 Hz 24 bits

1024 x  768    85 Hz 24 bits

1024 x  768    75 Hz 24 bits

1024 x  768    70 Hz 24 bits

1024 x  768    60 Hz 24 bits

832 x  624    75 Hz 24 bits

800 x  600    85 Hz 24 bits

800 x  600    72 Hz 24 bits

800 x  600    75 Hz 24 bits

800 x  600    60 Hz 24 bits

640 x  480    85 Hz 24 bits

640 x  480    75 Hz 24 bits

640 x  480    73 Hz 24 bits

640 x  480    60 Hz 24 bits

720 x  400    70 Hz 24 bits

 

 

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

1920 x 1440    60 Hz 32 bits

1600 x 1200    70 Hz 32 bits

1280 x 1024    85 Hz 32 bits

1280 x 1024    75 Hz 32 bits

1152 x  864    75 Hz 32 bits

1024 x  768    85 Hz 32 bits

1024 x  768    75 Hz 32 bits

1024 x  768    70 Hz 32 bits

1024 x  768    60 Hz 32 bits

832 x  624    75 Hz 32 bits

800 x  600    85 Hz 32 bits

800 x  600    72 Hz 32 bits

800 x  600    75 Hz 32 bits

800 x  600    60 Hz 32 bits

640 x  480    85 Hz 32 bits

640 x  480    75 Hz 32 bits

640 x  480    73 Hz 32 bits

640 x  480    60 Hz 32 bits

720 x  400    70 Hz 32 bits

 

 

>>

 

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

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

  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.

 




---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

  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:


  # 800x600 @ 120.00 Hz (GTF) hsync: 77.16 kHz; pclk: 83.95 MHz
  Modeline "800x600_120.00"  83.95  800 856 944 1088  600 601 604 643  -HSync +Vsync


% Add to database of supported modes:

> xrandr --screen 1 --newmode "800x600_120.00"  83.95  800 856 944 1088  600 601 604 643  -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.

 

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.