Problem with ASIO4ALL and Terratec Soundcards

Hello,
I have 3 Terratec Soundcards installed in my computer, with 6 soundchannels each. They all work properly. To use them in Matlab, I installed PsychToolBox and PsychPortAudio.
When I type:

d=PsychPortAudio('GetDevices', 3);
d;

I get the information that the ID is 34 and has 18 Soundchannels.

Then I start this code and Matlab crashes (no error message, nothing):

repetitions = 1;
wavfilename = [ PsychtoolboxRoot 'PsychDemos' filesep 'SoundFiles' filesep 'funk.wav'];
[y, freq] = wavread(wavfilename);
wavedata = y';
nrchannels = size(wavedata,1); % Number of rows == number of channels.
d=PsychPortAudio('GetDevices', 3);
d
pahandle = PsychPortAudio('Open', 4, [], 0, freq, 1,[],[],1);
PsychPortAudio('FillBuffer', pahandle, wavedata);
t1 = PsychPortAudio('Start', pahandle, repetitions, 0, 1);
WaitSecs(2);

% Stop playback:
PsychPortAudio('Stop', pahandle);

% Close the audio device:
PsychPortAudio('Close', pahandle);

What my mistake?

And by the way:
1. How do I get a list of ALL soundcards that can be used (with their ID)?
2. How do I reference a specific soundchannel of a soundcard?
It looks very confing to me to see 18 channels in ONE device instead of having 3 devices with 6 channels each. I don´t really get that concept..
Best,
Ralf





--- In psychtoolbox@yahoogroups.com, Ralf Sürig <ralf.suerig@...> wrote:
>
> Hello,
> I have 3 Terratec Soundcards installed in my computer, with 6
> soundchannels each. They all work properly. To use them in Matlab, I
> installed PsychToolBox and PsychPortAudio.
> When I type:
>
> d=PsychPortAudio('GetDevices', 3);
> d;
>
> I get the information that the ID is 34 and has 18 Soundchannels.
>
> Then I start this code and Matlab crashes (no error message, nothing):
>
> repetitions = 1;
> wavfilename = [ PsychtoolboxRoot 'PsychDemos' filesep 'SoundFiles'
> filesep 'funk.wav'];
> [y, freq] = wavread(wavfilename);
> wavedata = y';
> nrchannels = size(wavedata,1); % Number of rows == number of channels.
> d=PsychPortAudio('GetDevices', 3);
> d
> pahandle = PsychPortAudio('Open', 4, [], 0, freq, 1,[],[],1);
> PsychPortAudio('FillBuffer', pahandle, wavedata);
> t1 = PsychPortAudio('Start', pahandle, repetitions, 0, 1);
> WaitSecs(2);
>
> % Stop playback:
> PsychPortAudio('Stop', pahandle);
>
> % Close the audio device:
> PsychPortAudio('Close', pahandle);
>
> What my mistake?
>

Apparently not reading any kind of manuals or help texts or demos, neither what we provide, nor what comes with ASIO4ALL, and just trying random code that makes no sense for your purpose or setup? Or doing a search on the forum.

> And by the way:
> 1. How do I get a list of ALL soundcards that can be used (with their ID)?
> 2. How do I reference a specific soundchannel of a soundcard?
> It looks very confing to me to see 18 channels in ONE device instead of
> having 3 devices with 6 channels each. I don?t really get that concept..

Yes, these are puzzling question if one doesn't read before one writes or tries.

good luck,
-mario