From: Free on
Hi

I setup a simple simulink circuit consisting of a sine wave generator, a speaker ('to audio device' - block), a microphone ('from audio device' - block) and a 'To workspace' - block. The purpose is to play the sinus trough my loudspeaker, recording it AT THE SAME TIME with my microphone and then write the recorded signal to the MATLAB workspace. This all goes well but when I plot the recorded signal in MATLAB I get alternating zero - sine wave - zero - sine wave - zero - and so on... This while I expect a continuous (noisy) sine wave...

What could be the problem? I'm working under Linux. Maybe it is because of the linux scheduler which gives both tasks (play & record) alternating some processor time. Has anybody a solution?

Thanks
From: Free on
Finally I found the solution by myself after searching for more then a week. Matlab is using the open source library "portaudio" (http://www.portaudio.com/) for the "to/from audio devices". Originally this library is compiled for the linux "open sound system" (OSS) driver while I was using ALSA. So you have to download the source code for portaudio from the website, compile it and then copy the library into your matlab install directory (matlab_install_dir/bin/glnx86).

Procedure:
- Download and unpack portaudio source code
- In portaudio dir type:
../configure && make
make install
(The driver you are using will automatically be found)
- Copy libportaudio.so to matlab_install_dir/bin/glnx86
From: Free on
Finally I found the solution by myself after searching for more then a week. Matlab is using the open source library "portaudio" (http://www.portaudio.com/) for the "to/from audio devices". Originally this library is compiled for the linux "open sound system" (OSS) driver while I was using ALSA. So you have to download the source code for portaudio from the website, compile it and then copy the library into your matlab install directory (matlab_install_dir/bin/glnx86).

Procedure:
- Download and unpack portaudio source code
- In portaudio dir type:
../configure && make
make install
(The driver you are using will automatically be found)
- Copy libportaudio.so to matlab_install_dir/bin/glnx86