chuck icon indicating copy to clipboard operation
chuck copied to clipboard

ZoomAudioDevice.driver causes ChucK to crash on macOS 10.14.4

Open joshlewis opened this issue 5 years ago • 9 comments

I have uninstalled and re-installed to no avail.

$ chuck /Users/joshlewis/Documents/ChucK-songs/demo0.ck 
[chuck]: system error: (kAudioHardwareIllegalOperationError) setting sample rate for device (4)...

demo0.ck is this: https://gist.github.com/joshlewis/882fddbcf91900403b9bec2c5b83c86c

Not sure what to do to fix this. The crash happens regardless of what .ck file I attempt to run. I'm just providing that as an example.

joshlewis avatar Apr 15 '19 17:04 joshlewis

What input / output devices are you using in System Preferences > Sound ?

What is the output of chuck --probe?

lathertonj avatar Apr 15 '19 17:04 lathertonj

I've found a workaround. I have Zoom installed on this Mac, and this driver was at this path:

Library/Audio/Plug-Ins/HAL/ZoomAudioDevice.driver

When I remove that driver and reboot, ChucK works just fine. So there's some incompatibility between Zoom's driver and ChucK.

joshlewis avatar Apr 15 '19 17:04 joshlewis

In case it's helpful, my System Information app's Audio tab looked like this with ZoomAudioDevice.driver installed:

System Information app's Audio tab with ZoomAudioDevice.driver installed

joshlewis avatar Apr 15 '19 20:04 joshlewis

I just pushed a potential fix to this issue: 6458ec8

This issue happens when 1) the default audio input device shows only one channel (e.g., on MacOS Mojave), 2) we are requesting the default stereo input, 3) there is a secondary audio input device (e.g., ZoomAudioDevice) with sufficient channels BUT not the request sample rate. This results in an error when opening the device.

Implemented a workaround: detect the special case the default audio input device has only one channel when we request two. stereo will be simulated in this case using mono input.

gewang avatar Nov 06 '19 07:11 gewang

@gewang this issue is happening to me as well. How can I go about using the new version with this bug fix?

kbruccoleri avatar Jan 09 '20 21:01 kbruccoleri

this getting this issue

MaxBittker avatar Dec 06 '21 17:12 MaxBittker

Hi @gewang,

same problem here:

When trying to start the virtual machine - or to run the hello world example - I get the following error:

[chuck]: system error: (kAudioHardwareIllegalOperationError) setting sample rate for device (3)...

I suppose that the problem is that I have "Reincubate" installed, which uses a fixed sample rate of 48,000 Hz...

Anything I can do - beyond deinstalling Reincubate?

Thanks for your help, Dietrich

-- chuck --version

chuck version: 1.4.1.1 (numchucks) macOS : 64-bit [universal binary] http://chuck.cs.princeton.edu/ http://chuck.stanford.edu/

newskylabs avatar Jul 30 '22 18:07 newskylabs

[Answering to my own comment]

Actually it works when setting the sample rate in the Preferences of the miniAudicle to 48000 Hz or when using the option --srate:48000 on the command line:

$ chuck hello-sine.ck

[chuck]: system error: (kAudioHardwareIllegalOperationError) setting sample rate for device (3)...

$ chuck --srate:48000 hello-sine.ck

"Hello Sine!" : (string)

The audio device "Reincubate" is the only one with only 48000 Hz available. All other listed audio devises allow different sample rates - 48000 Hz between them. Probably chuck tries to set the sample rate on all available devices. How about querying first the current device and setting the sample rate only for this one?

In my case:

$ SwitchAudioSource -c

External Headphones

So setting the sample rate for "External Headphones" only should solve the problem.

Probably querying the sample rate of the active audio device first and using it for chuck might be another option :)

newskylabs avatar Jul 30 '22 18:07 newskylabs

The audio subsystem in ChucK (CLI and miniAudicle) have been reworked as of the latest major release (chuck-1.5.x.x), with improved support for different drivers (ASIO/WASAPI/DS on Windows, now ALSA/Pulse/JACK can be compiled into the same Linux executable and selected at runtime) and we have added additional support with more audio device configurations including Bluetooth headsets and allowing for more flexible sample rates (which should help with the ZoomAudioDevice).

If you'd like, give the latest a whirl or compilie the bleeding edge 🙏

Also, we have a ChucK Community Discord server that can further facilitate tracking issues, support, and development.

Please let us know if things have improved! Thanks all @joshlewis @kbruccoleri @MaxBittker @newskylabs

gewang avatar Aug 31 '23 04:08 gewang