Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable ASIO support? #409

Open
sinosoidal opened this issue Aug 16, 2023 · 4 comments
Open

Unstable ASIO support? #409

sinosoidal opened this issue Aug 16, 2023 · 4 comments

Comments

@sinosoidal
Copy link

sinosoidal commented Aug 16, 2023

I was wondering how much stable is ASIO support? I have been trying to implement a switch between ASIO and WASAPI without having one or another compatibility hard coded.

One problem I have is that when starting the application with the ASIO API driver selected it crashes when starting the DAC stream

asio.cpp line 115

ASIOError ASIOStart(void)
{
	if(!theAsioDriver)
		return ASE_NotPresent;
	return theAsioDriver->start(); // the crash happens here
}

Also, since version 5.X.Y I need to have the folllowing modifications in order to compile the code with ASIO support:

diff --git a/RtAudio.cpp b/RtAudio.cpp
index b13f04e..99c1908 100644
--- a/RtAudio.cpp
+++ b/RtAudio.cpp
@@ -3318,6 +3318,7 @@ bool RtApiJack :: callbackEvent( unsigned long nframes )
 #include "asio.h"
 #include "iasiothiscallresolver.h"
 #include "asiodrivers.h"
+#include "objbase.h"
 #include <cmath>
 static AsioDrivers drivers;
diff --git a/include/iasiodrv.h b/include/iasiodrv.h
index 64d2dbb..5a32adb 100644
--- a/include/iasiodrv.h
+++ b/include/iasiodrv.h
@@ -1,10 +1,12 @@
 #include "asiosys.h"
 #include "asio.h"
+#include "unknwn.h"^M
 /* Forward Declarations */
 #ifndef __ASIODRIVER_FWD_DEFINED__
 #define __ASIODRIVER_FWD_DEFINED__
+#define interface struct^M
 typedef interface IASIO IASIO;
 #endif         /* __ASIODRIVER_FWD_DEFINED__ */

Am I failing something obvious here?

I was really looking forward to have a driver selection mode that could allow selection between ASIO and WASAPI under Windows

@garyscavone
Copy link
Contributor

I use the autogen.sh script and mingw64 to create the Makefiles on Windows and have not had any troubles compiling or running the ASIO API in RtAudio. I do not see why you would need to modify the #includes in those header files but perhaps you are using a different build approach?

@sinosoidal
Copy link
Author

@garyscavone thanks for your reply. I use Visual Studio to compile directly from the source. But apart from that, the biggest problem is that I get crashes when using ASIO. Do you think this might be related with the introduced changes? I want to be able to switch between WASAPI and ASIO if the user intends so. Therefore I need to be able to delete the RtAudio object, and instantiate a new one using the required API. Was RtAudio designed to work this way?

@garyscavone
Copy link
Contributor

RtAudio was definitely designed to allow instances to be deleted and newly instantiated to support a different API, so that should be fine. Exactly why you are having problems with ASIO is not clear. What sort of audio device are you using? Does it have a native ASIO driver?

@sinosoidal
Copy link
Author

sinosoidal commented Sep 18, 2023

@garyscavone I have found the culprit in the mean while. It seems to crash with the "Generic Low Latency ASIO driver" provided with Windows. I have simply decided to ignore that device.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants