processing / processing-sound-archive

Archived Sound Library for Processing
125 stars 62 forks source link

RtAudio error when opening device #74

Open dhowe opened 8 years ago

dhowe commented 8 years ago

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: RtApiCore::probeDeviceOpen: the device (4) does not support the requested channel count. Could not run the sketch (Target VM failed to initialize). For more information, read revisions.txt and Help → Troubleshooting.

Same error occurs on any examples I have tried...

Processing 3.02, OS X 10.10.5 (14F1605), MacBook Pro (Retina, 13-inch, Mid 2014), default sound devices

screen shot 2016-03-23 at 1 16 32 pm

dhowe commented 8 years ago

any fix or workaround for this?

kaoskorobase commented 8 years ago

Could you download this program, execute it in a terminal and post the output? It's the RtAudio audioprobe test (alternatively compile it yourself from source).

@wirsing I've updated the version of RtAudio to 4.1.2 in Methcla (on the processing-sound/develop branch), maybe we could ship another bugfix release candidate to see if this helps?

dhowe commented 8 years ago

probe.sh: error: '/Users/me/Desktop/.libs/audioprobe' does not exist

you mean compile RtAudio.. ?

kaoskorobase commented 8 years ago

Ah. Please download http://www.music.mcgill.ca/~gary/rtaudio/release/rtaudio-4.1.2.tar.gz, unpack, ./configure && make, then post the output of ./tests/audioprobe. Thanks!

dhowe commented 8 years ago

https://gist.github.com/dhowe/a2b2c038bcb239bbd20e7bb8653641fa

kaoskorobase commented 8 years ago

Could you try changing the default input device to "Built-in Microphone" in the system sound settings and see if it works?

dhowe commented 8 years ago

Ah that did the trick. When I did the tests I made sure that output was set to default, but not input (as I wasn't using it)... thanks!

dhowe commented 8 years ago

Though I do get the following error when I try to quit the AmplitudeRMS example:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x0000000000400020, pid=20109, tid=122371
#
# JRE version: Java(TM) SE Runtime Environment (8.0_74-b02) (build 1.8.0_74-b02)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.74-b02 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  0x0000000000400020
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/me/hs_err_pid20109.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.java.com/bugreport/crash.jsp
#
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help → Troubleshooting.
kaoskorobase commented 8 years ago

There seems to be a problem with duplex devices that have a different input/output channel count, like the one you had selected before:

Device Name = Apple Inc.: Display Audio
Probe Status = Successful
Output Channels = 2
Input Channels = 1
Duplex Channels = 1
This is NOT the default output device.
This is the default input device.
Natively supported data formats:
  32-bit float
Supported sample rates = 44100 48000 

This is probably a bug in how RtAudio detects default devices, possibly fixed with the upgrade of RtAudio to version 4.1.2.

Regarding the crash with AmplitudeRMS, could you please post the contents of /Users/me/hs_err_pid20109.log? This seems to be a separate issue.

kaoskorobase commented 8 years ago

Or probably rather related to how Methcla's audio driver is initialized by processing-sound.

@wirsing Is there a reason that audioDriver.numInputs is set to 2 explicitly? AFAICS, this overrides the channel count reported by the device and fails to open the device if it doesn't have two channels.

This line could be commented out to see if it fixes the problem reported by @dhowe.

In any case the device configuration performed by Methcla should be a little smarter (e.g. it will fail if the device doesn't support a sample rate of 44100Hz), I'll create a corresponding issue in our bug tracker.

kaoskorobase commented 8 years ago

Created an issue here.

jeremydouglass commented 8 years ago

I'm also experiencing this issue with any use of processing-sound on Processing 3.2.1, OS X 10.10.5, Mac mini Server (Mid 2010) default sound devices.

libc++abi.dylib: terminating with uncaught exception of type std::runtime_error: RtApiCore::probeDeviceOpen: the device (2) does not support the requested channel count.

Others are reporting the same error on the Processing forums:

  1. https://forum.processing.org/two/discussion/18116/could-not-run-the-sketch-target-vm-failed-to-initialize-error
  2. https://forum.processing.org/two/discussion/17626/std-runtime-error-rtapicore-probedeviceopen-the-device-2-does-not-support-the-requested-channe