RtAudio Problems in Win 8.1 in of-0.8.0 (Fixed)

I need to use the Snowball iCE for a project of mine that just uses sound input to trigger video effects. I have done simple applications like this before and never had any problems but now that I have plugged the microphone into my computer the only audio device that comes up is ASIO for C-Media USB DAC Device

I also get an error:

RtApiAsio::getDeviceInfo: error (Hardware input or output is not present or available.) initializing driver (ASIO for C-Media USB DAC Device)

I tried uninstalling the driver but that has made no difference. It does not matter if the device is plugged in or not. I saw a similar forum topic on the matter but is there not a better solution than recompiling rtAudio to ignore ASIO?

Windows 8.1 OF-0.8.0 VS-2012

Edit: I tested in in OF-0.7.4 and it works though oddly enough it also broke MaxMSP 5.19, I have contacted C-Media about this hopefully they will have a solution.

Edit: C-Media was of no help, trick was I was always using direct sound and the blue snowball made my audio change to ASIO which only had the one device on it. Seems like one could get away without having to recompile the RtAudio lib if one flags they are using direct sound but it turned out to be beneficial in the long run. RtAudio would crash if the device got unplugged while the application was running. Problem seems to be sorted out now.

in rtAudio at lines 4892 and 4924 respectively you will find this code. The RtError System Error causes the program to crash but just commenting it out and telling it to stop the stream prevented crashing.

    if ( FAILED( result ) ) {
      errorStream_ << "RtApiDs::callbackEvent: error (" << getErrorString( result ) << ") getting current read position!";
      errorText_ = errorStream_.str();
      //error( RtError::SYSTEM_ERROR );

Hello DomAmato,

I am experiencing the same issue, however, with win7. Since plug-ing my Snowball blue All my sound project do not work anymore and soundStream.listDevices(); return

RtApiAsio::getDeviceInfo: error (Hardware input or output is not present or available.) initializing driver (ASIO for C-Media USB DAC Device)

I see that you have managed to fix your issue, but I am unable to comprehend the solution, sorry I bit of a noob i guess…:slight_smile:

You have to recompile the RTAudio library. They recently updated to support WASAPI too which is nice. I have an updated library that I will link in this comment. I have it compiled for WASAPI but I forget if I did it for DirectSound or ASIO. Download the files and place them in the respective folder.

unzip these and put them in the libs/rtaudio/include

unzip and put them in libs/rtaudio/lib/vs

Thanks for the quick reply.

Unfortunately, replacing the library does not work. I get a linking error. I’ll try to compile the library and see from there.

any pointers for compiling?

did you compile at build time with VS or pre-compile a static lib using the cmd, then move the files in the OF file structure…sorry just a bit confuse for the process

really thanks for your time.

Yeah it has to be a statically compiled. What kind of linking error do you get specifically? What are you using, Visual Studio 2012?

heres the enumerator that handles what API is included in the compilation

  //! Audio API specifier arguments.
enum Api {
    UNSPECIFIED,    /*!< Search for a working compiled API. */
    LINUX_ALSA,     /*!< The Advanced Linux Sound Architecture API. */
    LINUX_PULSE,    /*!< The Linux PulseAudio API. */
    LINUX_OSS,      /*!< The Linux Open Sound System API. */
    UNIX_JACK,      /*!< The Jack Low-Latency Audio Server API. */
    MACOSX_CORE,    /*!< Macintosh OS-X Core Audio API. */
    WINDOWS_WASAPI, /*!< The Microsoft WASAPI API. */
    WINDOWS_ASIO,   /*!< The Steinberg Audio Stream I/O API. */
    WINDOWS_DS,     /*!< The Microsoft Direct Sound API. */
    RTAUDIO_DUMMY   /*!< A compilable but non-functional API. */

I would compile the WASAPI and DS API’s since ASIO is the one giving you problems. You can pass along the API flags before you compile and it will include those API’s when it makes the static lib.

I should probably review how I did it since it was awhile ago and I’m going off of memory. But it was pretty easy getting a project setup to compile. I will include a link for a zip of the VS project files as they are on my desktop machine at home.

Thanks DomAmato,

sorry for the late reply been sick


your compiled library works !! Big Thanks.

However, if it`s not to much to ask my I know how you compile the rtaudio lib. I am reading on how to create static library but I am still confuse haha. Did you create object files per needed cpp file then combined them to create the “rtAudio.lib” and “rtAudioD.lib” if so which files goes in which library…

Thanks for you time


Sorry I intended to attach the project while I was at it but this tutorial on MSDN is really how you should do it: https://msdn.microsoft.com/en-us/library/vstudio/ms235627(v=vs.110).aspx

Just make sure to include all the files that come with the rtAudio download and that you tell the compiler which libraries you want to be precompiled by using #define _ WINDOWS_WASAPI__ and so on. Sorry for being a bit short on the details. I setup the static library to compile with over a year ago and have just changed the files when they update the rtAudio lib. I do remember it being quite easy though. Just make sure you use the right compiler for whatever version of visual studio you are using.

Hey @DomAmato - same issue here, but with a Digidesign ASIO driver. Thanks for the discussion. Any way to get those links put back up?


actually rtaudio has a “flexible” error handling mechanism, so this can also be fixed without changing the rtaudio lib files.

edit libs\openFrameworks\sound\ofRtAudioSoundStream.cpp

	audio->openStream((settings.numOutputChannels > 0) ? &outputParameters : nullptr, (settings.numInputChannels > 0) ? &inputParameters : nullptr, RTAUDIO_FLOAT32,
		settings.sampleRate, &bufferSize, &rtAudioCallback, this, &options, 
		// add this to change the error handling mechanism from throwing exceptions
		// to ignoring the errors: 
		[](RtAudioError::Type type, const std::string &errorText) {}

interestingly the error handling itself is a bit broken too, so when you unplug the device this won’t get called (at least not on my computer). however, at least it doesn’t crash, and you don’t have to fiddle with the dlls.