PlayrecForMatlab / playrec

A Matlab and Octave utility (MEX file) that provides simple yet versatile access to soundcards using PortAudio
http://www.playrec.co.uk/
Other
25 stars 15 forks source link

PortAudio Error [-9999]: Unanticipated host error #11

Open goesjon opened 3 years ago

goesjon commented 3 years ago

Hello,

I complied playrec for Octave v6.3.0 and Windows 10 with portaudio v19.7.0 and ASIO SDK v2.3.3. The compilation was successful (I got the playrec.mex file). I have the following devices available (result of the playrec('getDevices') command):

deviceID = 0, name = ASIO4ALL v2, hostAPI = ASIO deviceID = 1, name = Realtek ASIO, hostAPI = ASIO

When I run the following command for initialization:

playrec('init',48000,1,-1)

I get the following error message:

error: playrec: Init failed to open PortAudio stream {PortAudio Error [-9999]: Unanticipated host error}

When I ignore this error message and just run the initialization command again, I do not get the error again and I successfully initialize the device. The device after that works perfectly fine. I seriously do not understand why???

Can somebody please help me? How can I resolve this error?

Thank you very much.

Best regards

goesjon commented 3 years ago

I found a workaround (unfortunately not a real solution):

try playrec('init',48000,1,-1) catch playrec('init',48000,1,-1) end_try_catch

"If it looks stupid but it works, it ain't stupid"