Discussion:
[Portaudio] multi-thread support with portaudio/ASIO on windows
Frédéric RUGET
2004-11-09 00:21:01 UTC
Permalink
Hello,

First thanks a lot for the great easy-to-use portaudio library.

I'm the author of a portaudio output module for VLC (an open source
multimedia player). Using portaudio/ASIO enables to drive audio cards
that provide only ASIO and no WMME support (such as EMU 1820M in
multichannel mode). __Very__ useful :-)

1. MY PROBLEM

I'm using portaudio v19 on windows XP, compiled with cygwin/gcc,
and linked with steinberg ASIO sdk (also compiled with cygwin/gcc).

In this configuration,
it seems all interactions between the application and the library have
to be invoked from the same and unique thread. Even after a =
Pa_CloseStream,
the next Pa_OpenStream must be invoked from the same thread.
Failing to do so results in a popup message :

title: ASIO Multimedia
message: 'ASIOMME.DLL' is already running !

One possible workaround when you are dealing with an application
that was originally designed with multithreading in mind (such as VLC),
is to have all interactions with the portaudio library to be
performed by a single dedicated thread, that is driven via message
passing from the other threads; it works (this is the current
implementation in VLC) but it is rather ugly and unpractical.

2. MY QUESTION

Apparently (VLC team tells me), this problem only occurs with
portaudio/cygwin/ASIO and in particular does not occur with
portaudio/linux.

=3D=3D> Would it be possible to modify the win32/ASIO implementation
so that multithreaded applications are supported ?
(or maybe I did miss something and multithread is already
supported??)

Thanks a lot for your answers,

Frederic RUGET
Ross Bencina
2004-11-09 01:09:02 UTC
Permalink
Hi Frederic

I think ASIOMME.DLL is the Steinberg ASIO DLL. The best solution I can
suggest is that you uninstall it. But perhaps this points to a deeper
problem, I'm not sure.

Ross.

----- Original Message -----
From: "Frédéric RUGET" <***@free.fr>
To: <***@music.columbia.edu>
Sent: Tuesday, November 09, 2004 12:19 AM
Subject: [Portaudio] multi-thread support with portaudio/ASIO on windows


Hello,

First thanks a lot for the great easy-to-use portaudio library.

I'm the author of a portaudio output module for VLC (an open source
multimedia player). Using portaudio/ASIO enables to drive audio cards
that provide only ASIO and no WMME support (such as EMU 1820M in
multichannel mode). __Very__ useful :-)

1. MY PROBLEM

I'm using portaudio v19 on windows XP, compiled with cygwin/gcc,
and linked with steinberg ASIO sdk (also compiled with cygwin/gcc).

In this configuration,
it seems all interactions between the application and the library have
to be invoked from the same and unique thread. Even after a Pa_CloseStream,
the next Pa_OpenStream must be invoked from the same thread.
Failing to do so results in a popup message :

title: ASIO Multimedia
message: 'ASIOMME.DLL' is already running !

One possible workaround when you are dealing with an application
that was originally designed with multithreading in mind (such as VLC),
is to have all interactions with the portaudio library to be
performed by a single dedicated thread, that is driven via message
passing from the other threads; it works (this is the current
implementation in VLC) but it is rather ugly and unpractical.

2. MY QUESTION

Apparently (VLC team tells me), this problem only occurs with
portaudio/cygwin/ASIO and in particular does not occur with
portaudio/linux.

==> Would it be possible to modify the win32/ASIO implementation
so that multithreaded applications are supported ?
(or maybe I did miss something and multithread is already
supported??)

Thanks a lot for your answers,

Frederic RUGET
Frédéric RUGET
2004-11-12 02:01:01 UTC
Permalink
Hi Ross,

Actually I have not yet tried to uninstall the steinbergs
apps...

But still the strange thing is : when all calls to
portaudio are done from the same thread, my application
works perfectly ; when the calls are done from two different
threads (for example tread 1 calls open, thread 2 calls
close) my application breaks and I get the ASIOMME popup.

Do you confirm portaudio for cygwin/ASIO supports multithread ??

Regards,

Frederic

----------------------------------------------------
From: "Ross Bencina" <***@iprimus.com.au>
To: "Portaudio List" <***@music.columbia.edu>
Subject: Re: [Portaudio] multi-thread support with portaudio/ASIO on windows
Date: Tue, 9 Nov 2004 01:06:53 +0100

Hi Frederic

I think ASIOMME.DLL is the Steinberg ASIO DLL. The best solution I can
suggest is that you uninstall it. But perhaps this points to a deeper
problem, I'm not sure.

Ross.
Ross Bencina
2004-11-12 09:00:01 UTC
Permalink
Frederic

A few thoughts:

As i said before asiomme.dll is the steinberg emulation driver -- if it's
popping up, it's probably because of it, not portaudio. either that or
portaudio (in other words the ASIO SDK) is not properly unloading it from
the first thread. Try calling Pa_Terminate() from the first thread and
Pa_Initialize() in the second.
Post by Frédéric RUGET
Do you confirm portaudio for cygwin/ASIO supports multithread ??
PortAudio does not "support" multithreadded operation, in the sense that it
is not threadsafe. However there is no reason why it shouldn't work so long
as you don't use it from multiple threads simultaneously. I know nothing
about using ASIO with gcc or cygwin. I suggest that you try to build your
application with the free Microsoft (or Borland for that matter) toolchain
and see if you get the same results.

Best wishes

Ross.




----- Original Message -----
From: "Frédéric RUGET" <***@free.fr>
To: <***@music.columbia.edu>
Sent: Friday, November 12, 2004 2:00 AM
Subject: Re: [Portaudio] multi-thread support with portaudio/ASIO on windows
Post by Frédéric RUGET
Hi Ross,
Actually I have not yet tried to uninstall the steinbergs
apps...
But still the strange thing is : when all calls to
portaudio are done from the same thread, my application
works perfectly ; when the calls are done from two different
threads (for example tread 1 calls open, thread 2 calls
close) my application breaks and I get the ASIOMME popup.
Do you confirm portaudio for cygwin/ASIO supports multithread ??
Regards,
Frederic
----------------------------------------------------
Subject: Re: [Portaudio] multi-thread support with portaudio/ASIO on windows
Date: Tue, 9 Nov 2004 01:06:53 +0100
Hi Frederic
I think ASIOMME.DLL is the Steinberg ASIO DLL. The best solution I can
suggest is that you uninstall it. But perhaps this points to a deeper
problem, I'm not sure.
Ross.
_______________________________________________
Portaudio mailing list
http://music.columbia.edu/mailman/listinfo/portaudio
Loading...