IOPort/Unix: Declutter output at verbosity 4.

At verbosity 4 (default level) no longer output handshake
status and baudrates. Only do it at verbosity > 4.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2464 f5efbe48-b203-0410-9429-fc5e098e5a54
IOPort/Unix: Proof-of-concept code for async triggerbyte emission.

IOPort('ConfigureSerialPort', phandle, 'JLFireTrigger=xxx');

Schedules write of a 0xff trigger byte over serial port phandle
at system time xxx. A background thread will be spawned to wait
until time xxx then do a single byte serial port write.

This is just for prototyping and testing, not for public
use - therefore not documented, and will be removed in a
future IOPort version.

-> IOPort.mexmaci for Matlab on OS/X IntelMac rebuilt.

[This gimmick dedicated to JL]



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2465 f5efbe48-b203-0410-9429-fc5e098e5a54
SetupPsychtoolbox.m: Minor mod to regexp() to not match null string paths

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2466 f5efbe48-b203-0410-9429-fc5e098e5a54
VIEWPixx: Datapixx mex files updated to support VPixx Technologies VIEWPixx display and data acquisition system.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2467 f5efbe48-b203-0410-9429-fc5e098e5a54
DATAPixx: Added 64-bit MATLAB support

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2468 f5efbe48-b203-0410-9429-fc5e098e5a54
Quest: Small useability improvements. No algorithmic changes.

* Clean up M-Lint warnings for Matlab V7.4 and later,
  fix argument checking for modern Matlabs along the way.

* QuestRecompute() can plot the used initial psychometric
  function on request, QuestCreate() can pass the parameter
  for visualization along.

* QuestSimulate(): Can perform plotting of the psychometric
  function of the simulated observer, the distribution of
  past trials (intensities and responses) and the placement
  and simulated response of the current trial. This if optional
  'plotit' parameter is set to non-zero value, off by default.

  This is meant as a nice way to visualize Quests working and
  sample placement.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2469 f5efbe48-b203-0410-9429-fc5e098e5a54
PsychHID/OSX: Rebuilt for IntelMac Matlab & Octave.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2470 f5efbe48-b203-0410-9429-fc5e098e5a54
Linux: Add example XOrg Joystick configuration file.

The file 52-MyLinuxJoystick.conf is an example of
a configuration file for setup of Joysticks or
Gamepads for use with Linux. It contains setup
instructions in the comments at its top.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2471 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen: Improve handling of crtc->output mappings.

Improve some warning messages to point the user to
the new help file 'help DisplayOutputMappings' with
explanations and troubleshooting instructions.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2472 f5efbe48-b203-0410-9429-fc5e098e5a54
Gamepad(): Add setup instructions and info for Linux and Windows.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2473 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen: Small optimization to frame-sequential stereo mode implementation.

In frame-sequential swapper thread we use PsychOSGetSwapCompletionTimestamp()
if possible to wait for swap completion and only fallback to sync-pixel method
if that is unsupported/disabled/failed.

This currently only works on Linux + FOSS DRI2/KMS drivers, as other os'es and
the NVidia/AMD binary blobs on Linux don't support this.

The advantage here is that after swap request submission, we don't need to
submit a pixel draw command packet into the GPU command stream to detect/throttle
on swap completion. Such a packet can get "stuck" in the stream behind a large
number of rendering command packets submitted by other threads or the usercode
on the masterthread. If the rendering load is high, its execution can get deferred
by more than one video refresh cycle, thereby blocking the swapper thread from
submitting the next swapbuffers request in time --> Missed frame-sequential swap
--> Artifacts/Flicker in the stereo display or sync problems with stereo-goggles.

Screen.mexmaci rebuilt for regression testing -> Still works.

--> This is only useful on Linux --> Rebuild pending.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2474 f5efbe48-b203-0410-9429-fc5e098e5a54
Movies: Reencode DualDiscs.mov, cleanup demos.

* Cleanup some movie demos a bit.

* Reencode our standard demo movie DualDiscs.mov from the
  ancient Sorenson-3 video codec into modern H264 + AAC.

  --> 15x smaller filesize at same quality.



git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2475 f5efbe48-b203-0410-9429-fc5e098e5a54
Improvements to realtime priority setup on Linux and OS/X.

* Make sure in PsychSetThreadPriority() that a RT policy is
  not ever combined with a zero priority level. Raise to 1 if
  it would be zero.

  --> Prevents various failure cases to set RT priority for a thread
      properly.

* In Linux: Do no longer use the process RT scheduling/priority API,
  but only the pthread RT scheduling/priority API's. So far Priority()
  and the temporary RT boost during OpenWindow used the process RT
  API's, whereas PsychSetThreadPriority() et al. used pthread API's.

  -> Can cause inconsistencies in handling/reporting of RT setup and
     certain failures, e.g., priority inversion!

* In Linux: Fix a bug in priority boosting which could cause failure
  to revert priority boost at Priority() > 0.

-> Fixes various inconsistencies wrt. RT scheduling setup.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2476 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen: Improve priority setup for async flipper thread.

Make sure at least on Windows and Linux that the priority
of the async flipper thread is really only increased by +2
wrt. baseline priority of master thread, not accidentally
by more in certain funny cases.

This needs checking on OS/X if same fix applies.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2477 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen: Improve async background movie loading - Part I

Use SCHED_FIFO instead of SCHED_OTHER for masterthread
during background movie load, and stick to it after
load completes, to avoid accidentally reverting a
Priority() command executed by usercode before.

-> Screen and IOPort for 32-Bit octave on Linux rebuilt
-> So far tested.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2478 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen/GStreamer: Improve "start" of playback accuracy for problematic movies.

Some movie files have an unfortunate keyframe placement or encoding
which caused playback to start at a small offset - skipping a few
frames at the beginning. Now we perform an explicit precision seek
before start of playback to avoid this problem.

Additionally, for movies with videotracks, we defer actual start
of the playback pipeline until the first invocation of Screen('GetMovieImage'),
so that we don't easily suffer dropped frames anymore if there is
a significant delay between 'PlayMovie' and 'GetMovieImage'. The
pipeline is still immediately started in 'PlayMovie' for movies
without video tracks - sound only.

-> Solves all the issues with lost frames at the beginning of our
   standard DualDiscs.mov movie and with PlayMoviesWithoutGapDemoOSX.m.

-> Screen for 32-bit Octave on Linux rebuilt & tested.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2479 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen/GStreamer: Improve robustness of looped video playback.

A second method of rewinding the movie for looped playback
is now implemented. This one seems to be more robust against
slightly broken movie files, but seems to have a slightly
higher delay for rewinding on some odd movies.

The specific value of the non-zero Screen('PlayMovie', ..., loop, ...);
loop flag now decides on a case by case basis which method to use.

0 = Singleshot, 1 = New method, 2 = Old method, 3 = Both at the
same time for increased robustness or increased chaos.

-> Screen for 32-Bit Octave on Linux rebuilt and tested.
-> Now happily loops DualDiscs.mov, our worst movie.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2480 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen/GStreamer: Improve playback accuracy for resuming playback.

Previous start of playback improvement introduced regression, where
resuming a paused movie would rewind it to beginning, instead of
resuming at current position. --> Fixed.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2481 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen/GStreamer: Fix frameindex-based seeking via Screen('SetTimeIndex')

Now fixed to actually work. Also provides a time-based seek emulation
as fallback for movies which don't allow frame-based seeks, by
translating index into time and using time-based seek as approximation.

Code cleanups and error handling/reporting wrt. seek problems and
status improved.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2482 f5efbe48-b203-0410-9429-fc5e098e5a54
Screen/GStreamer: Improve reverse playback and looped playback.

Yet another method to loop. Now both reverse playback and
looped playback (forward and reverse) work reliably and
smooth.

Of course only on movies that support this. Many formats don't
allow reverse playback and or reverse looping at all.

-> Screen for 32-Bit Octave on Linux rebuilt and tested.

git-svn-id: https://psychtoolbox-3.googlecode.com/svn/trunk@2483 f5efbe48-b203-0410-9429-fc5e098e5a54