Small new bits in PTB beta: Bug fixes, sound output...

Beta has been updated with some bits for OS/X IntelMac+Matlab
and Windows+pre 2007a Matlabs. Updates for the other platforms
will follow in a couple of days.

New stuff for all platforms:

* BalanceFactors.m -- Balances a set of factors given the factor levels.
Contributed by David Fencsik, well tested according to him. Thanks!

* Small fix to Ask() -- Doesn't crash anymore on empty 'message' strings.

* Small fixes to moglmorpher('RenderMesh') subfunction.

* Some info in "help KbCheck" about how to prevent keypresses from
cluttering the Matlab window.

* Initial implementaiton of a convenient setup routine for imaging pipeline
(OS/X Intel and Windows pre2007a only for now): PsychImaging.m
This is very early stuff, currently only supports left-right and upside down
flipping of visual stimuli.

* The usual batch of workarounds for the most broken OS in existence:

- (Hopefully) improved code for detection of broken beamposition queries
to work around broken drivers on Windows. PTB should detect more
problematic cases at runtime and fall back to lower precision timestamping.

- Screen('Preference', 'ConserveVRAM', 8); disables OpenGL context
isolation when using OpenGL for Matlab, to work around completely
broken drivers on Windows.

- Default text size increased, default text style is now "bold" on MS-Windows
to provide better readable text to compensate for its broken text renderer.

* Initial alpha release of our new sound driver: PsychPortAudio()
The driver is only provided for OS/X IntelMac and Windows pre-2007a Matlab,
releases for other platforms will follow after a bit more beta testing.

This driver is supposed to be more robust and reliable, more flexible and
capable and much lower latency and better timing precision than the old
SND() function and all the Matlab based sound drivers.

Initial testing on OS/X looks very good, initial testing on Window shows
results between "very good" for some setups and "as poor as everything else"
on some other setups. Especially Windows development will rely on
feedback from you.

Try "BasicSoundOutputDemo" as a starter. "help InitializePsychSound" and
"help PsychPortAudio" may be of interest.

This is early alpha code, so don't be disappointed if it doesn't work well,
but give feedback.

Happy testing,
-mario
sorry mario, i'm dumb for not seeing that. works great on windows!
can you send me the low latency driver?
e_flister AT yahoo.com

i just tried it on my kickin new macbookpro and got:
>> BasicSoundOutputDemo
PsychPortAudio initialized. Will use CoreAudio for output.
??? Invalid MEX-file
'/Applications/Psychtoolbox/PsychBasic/PsychPortAudio.mexmaci':
dlopen(/Applications/Psychtoolbox/PsychBasic/PsychPortAudio.mexmaci,
1): Library not loaded: /usr/local/lib/libportaudio.0.0.19.dylib
Referenced from:
/Applications/Psychtoolbox/PsychBasic/PsychPortAudio.mexmaci
Reason: image not found.

Error in ==> BasicSoundOutputDemo at 80
pahandle = PsychPortAudio('Open', [], [], 0, freq, nrchannels);

that mexmaci does exist. am i missing something obvious again?
:)
-e


--- In psychtoolbox@yahoogroups.com, "Mario Kleiner"
<mario.kleiner@...> wrote:
>
> Update to the latest beta. Try the BasicSoundOutputDemo as a
> basic test and intro on how to use it.
>
> You need to call InitializePsychSound before first use of
PsychPortAudio,
> due to some mixture of technical (==Windows braindamage) and legal
> reasons, otherwise you'll get an error.
>
> Also, the driver as shipped with PTB doesn't provide the lowest possible
> latency and highest accuracy on Windows, only pretty ok on good
> hardware. You'll need to contact me for some special plugin for lowest
> latency. We cannot distribute that with PTB for legal reasons, at least
> not unless i have some clarification about some licensing issues.
>
> -mario
>
> --- In psychtoolbox@yahoogroups.com, "e_flister" <e_flister@> wrote:
> >
> > > * Initial alpha release of our new sound driver: PsychPortAudio()
> > > The driver is only provided for OS/X IntelMac and Windows
pre-2007a
> >
> > whatup mario? great idea for reliable audio, nice job! just tried
> > playing with it, but:
> >
> > >> PsychPortAudio
> > ??? Invalid MEX-file
> > 'C:\psychtoolbox\Psychtoolbox\PsychBasic\MatlabWindowsFilesR11
> \PsychPortAudio.dll':
> > The specified module could not be found.
> >
> >
> > i checked and the dll in question does exist.
> >
> > here's my info:
> >
>
----------------------------------------------------------------------------
> ---------
> > MATLAB Version 7.3.0.267 (R2006b)
> > MATLAB License Number: 206168
> > Operating System: Microsoft Windows XP Version 5.1 (Build 2600:
> > Service Pack 2)
> > Java VM Version: Java 1.5.0 with Sun Microsystems Inc. Java
> > HotSpot(TM) Client VM mixed mode
> >
>
----------------------------------------------------------------------------
> ---------
> >
> > screen('version'):
> > version: '3.0.8.142531153'
> >
> >
> > i tried on 3 windows computers with pretty different setups (but same
> > OS/matlab version/latest ptb). same results on all.
> > -e
> >
>
No, you're not missing something obvious (except that it obviously
doesn't work), it should work on OS/X IntelMac. Its just that i managed
to make the same mistake twice on two different systems. The OS/X
distribution is missing a crucial plugin library, so it can't work on any
machine except my own development machine :(

I'll need to fix this in the next beta update, next time after really
careful testing of this beast on independent hardware - and enough
sleep beforehand ;-)

For the low latency plugin for Windows, send me a e-mail and i'll
send you the driver plugin. You will need sound hardware with
native ASIO drivers or, failing that, special open source ASIO
emulation drivers. ("ASIO is a registered trademark and Software
of Steinberg Media Technologies GmbH").

<http://en.wikipedia.org/wiki/Audio_stream_input_output>

best,
-mario



--- In psychtoolbox@yahoogroups.com, "e_flister" <e_flister@...> wrote:
>
> > Error in ==> BasicSoundOutputDemo at 80
> > pahandle = PsychPortAudio('Open', [], [], 0, freq, nrchannels);
> >
> > that mexmaci does exist. am i missing something obvious again?
>
>
> aha, indeed i was. i see that you said it's not ready for 2007a,
> which is what's on my mac. sorry!
> still interested in that low latency driver tho... ;)
> -e
>