You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document USB audio interface support via ASIO on Windows #87
21ca5b8 adds support for ASIO devices on Windows (through PortAudio). By default the Sound library will try to stick to JavaSound drivers if possible, so some multi-channel interfaces might only be listed as stereo devices unless PortAudio is loaded explicitly by a call to MultiChannel.usePortAudio() at the beginning of the sketch (see the MultiChannelOutput example for details).
Since output devices can now also be selected by name matching, the following two lines should usually suffice to load the PortAudio interface and select the ASIO device for input/output:
In order to expand the list of supported audio interfaces (as well as latency/buffer configuration caveats) in the README, please report any experiences (positive and negative) with using audio interfaces over the ASIO device in this issue.
Just a note that audio input from WDM-KS devices does also not seem to be supported on the currently bundled PortAudio binaries, and trying to open an AudioInputStream on one even seems to trash the JSyn SynthesisEngine object permanently (see cc2c8c3)
Hi,
I am building spatial audio engine with Processing. Currently I am using ASIO host library but I want to replace it with Processing Sound so it can be cross-platform. However, I am stuck with making the multi channel output work on Windows with ASIO device. ASIO device on Windows is necessary for proper multichannel output so there is no workaround. Below is an example sketch that can be tested even without proper ASIO audio card by using Voicemeeter software - free virtual ASIO interface - I start this interface before running the sketch. Voicemeeter is verified to work and can be seen from other DAW software.
the warning given by the console from the sketch below:
Found a multi-channel device: Voicemeeter Virtual ASIO - ASIO
ASIOCanSampleRate(48000.000000):0
ASIOGetSampleRate:48000.000000
No Need to change SR
PaAsioOpenStream: framesPerHostBuffer :512
asioMessages : 7 , 0
ASIO Output type:19ASIOSTFloat32LSB
PaAsio : ASIO OutputLatency = 1024 (21 ms),
added buffProc:0 (0 ms),
added blocking:896 (18 ms)
Playing back different sine waves on the 8 different channels
WaitForSingleObject() timed out in WriteStream()
java.lang.RuntimeException: Wait timed out
at com.portaudio.BlockingStream.writeFloats(Native Method)
at com.portaudio.BlockingStream.write(BlockingStream.java:112)
at com.jsyn.devices.jportaudio.JPortAudioDevice$JPAOutputStream.write(JPortAudioDevice.java:191)
at com.jsyn.devices.jportaudio.JPortAudioDevice$JPAOutputStream.write(JPortAudioDevice.java:178)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(SynthesisEngine.java:341)
/*
this willl fail on Windows and ASIO Voicemeeter running with warning / console output:
*/
import processing.sound.*;
import com.jsyn.engine.SynthesisEngine;
import com.jsyn.unitgen.ChannelOut;
SinOsc sines[];
int initialised;
float frequency;
void setup() {
size(640, 360);
background(255);
//has to be called BEFORE "MultiChannel.usePortAudio()" - not sure why?
Sound.list();
//has to be set BEFORE "MultiChannel.usePortAudio()" otherwise it will throw
// "RuntimeException: An invalid parameter was passed to a system function."
//not sure why?
Sound.sampleRate(48000);
if (MultiChannel.usePortAudio()) {
// if PortAudio was loaded successfully, the id's and names of the sound
// devices (and possibly their number of input/output channels) will have
// changed!
Sound.list();
}
// the Sound.status() method prints some general information about the current
// memory and CPU usage of the library to the console
Sound.status();
boolean foundMultiChannel = false;
String[] deviceNames = Sound.list();
for (int i = 0; i < deviceNames.length; i++) {
//Voicemeeter AUX Virtual ASIO - ASIO | 8
if (deviceNames[i].contains("Voicemeeter Virtual ASIO") && MultiChannel.availableChannels(i) > 2 ) {
//Sound.sampleRate(48000); //An invalid parameter was passed to a system function. ?
println("Found a multi-channel device: " + deviceNames[i]);
Sound.outputDevice(i); //Invalid sample rate error
foundMultiChannel = true;
break;
}
}
if (!foundMultiChannel) {
println("Did not find any output devices with more than 2 channels!");
}
println("Playing back different sine waves on the " + MultiChannel.availableChannels() + " different channels");
sines = new SinOsc[MultiChannel.availableChannels()];
initialised = 0;
frequency = 100;
textSize(128);
fill(0);
textAlign(CENTER);
}
void draw() {
// loop through all channels and start one sine wave on each
if (initialised < sines.length) {
// add a nice theatrical break
delay(1000);
background(255);
text((initialised + 1) + " of " + sines.length, width/2, height/2);
MultiChannel.activeChannel(initialised);
// create and start the sine oscillator.
sines[initialised] = new SinOsc(this);
sines[initialised].freq(frequency);
sines[initialised].play();
// increase frequency on the next channel by one semitone
frequency = frequency * 1.05946;
initialised = initialised + 1;
return;
}
// as long as the oscillators are not stopped they will 'stick'
// to the channel that they were originally added to, and we can
// change their parameters freely
frequency = map(mouseX, 0, width, 80.0, 1000.0);
for (SinOsc sin : sines) {
sin.freq(frequency);
// increase frequency on the next channel by one semitone (a factor of 2^(1/12))
frequency = frequency * 1.05946;
}
}
Device Tascam 16*08 (https://www.tascam.eu/de/us-16x08) - does not work. I think the overall ASIO support in sound library is not good with combination with jSyn - I suspect that single bad device will trash everything each time.
with ASIO i got:
Using named output device: US-16x08 ASIO - ASIO
ASIOCanSampleRate(44100.000000):0
ASIOGetSampleRate:44100.000000
No Need to change SR
PaAsioOpenStream: framesPerHostBuffer :256
asioMessages : 7 , 0
ASIO Output type:18ASIOSTInt32LSB
PaAsio : ASIO OutputLatency = 702 (15 ms),
added buffProc:0 (0 ms),
added blocking:896 (20 ms)
Using US-16x08 ASIO - ASIO
Pa_StartStream: waveInStart returned = 0x0.
WaitForSingleObject() timed out in WriteStream()
java.lang.RuntimeException: Wait timed out
at com.portaudio.BlockingStream.writeFloats(Native Method)
at com.portaudio.BlockingStream.write(BlockingStream.java:112)
at com.jsyn.devices.jportaudio.JPortAudioDevice$JPAOutputStream.write(JPortAudioDevice.java:191)
at com.jsyn.devices.jportaudio.JPortAudioDevice$JPAOutputStream.write(JPortAudioDevice.java:178)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(SynthesisEngine.java:341)
WaitForSingleObject() timed out in StopStream()
WaitForSingleObject() timed out in StopStream()
java.lang.RuntimeException: Wait timed out
at com.portaudio.BlockingStream.stop(Native Method)
at com.jsyn.devices.jportaudio.JPortAudioDevice$JPAStream.stop(JPortAudioDevice.java:147)
at com.jsyn.engine.SynthesisEngine$EngineThread.run(SynthesisEngine.java:360)
RuntimeException: Wait timed out
With Reproduktory (US-16x08 Audio) - Windows WDM-KS I got this error:
Using named output device: Reproduktory (US-16x08 Audio) - Windows WDM-KS
OpenStream:sampleRate = 44100.000000
OpenStream:framesPerBuffer = 128
Blocking API not supported yet!
RuntimeException: Blocking API not supported yet
RuntimeException: Blocking API not supported yet
RuntimeException: Blocking API not supported yet
RuntimeException: Blocking API not supported yet
With
"Reproduktory (US-16x08) - MME";
I am only getting STEREO output despite outputting to 8 channels.
Activity
kevinstadler commentedon Sep 29, 2023
Just a note that audio input from WDM-KS devices does also not seem to be supported on the currently bundled PortAudio binaries, and trying to open an AudioInputStream on one even seems to trash the JSyn SynthesisEngine object permanently (see cc2c8c3)
Use Windows portaudio dll with ASIO support (refs #87)
[-]Add support for ASIO devices on Windows[/-][+]Document USB audio interface support via ASIO on Windows[/+]trackme518 commentedon Jan 4, 2026
Hi,
I am building spatial audio engine with Processing. Currently I am using ASIO host library but I want to replace it with Processing Sound so it can be cross-platform. However, I am stuck with making the multi channel output work on Windows with ASIO device. ASIO device on Windows is necessary for proper multichannel output so there is no workaround. Below is an example sketch that can be tested even without proper ASIO audio card by using Voicemeeter software - free virtual ASIO interface - I start this interface before running the sketch. Voicemeeter is verified to work and can be seen from other DAW software.
get virtual ASIO card (specifically I have installed Voicemeeter Banana for this test):
https://vb-audio.com/Voicemeeter/index.htm
Processing Sound lib version 2.4.0
the warning given by the console from the sketch below:
trackme518 commentedon Jan 4, 2026
possibly relevant documentation: https://portaudio.com/docs/v19-doxydocs/compile_windows_asio_msvc.html
trackme518 commentedon Jan 4, 2026
It will also fail when instead of using Synth I used SoundFile (just to make sure the Synth is not the problem)
trackme518 commentedon Sep 18, 2026
Device Tascam 16*08 (https://www.tascam.eu/de/us-16x08) - does not work. I think the overall ASIO support in sound library is not good with combination with jSyn - I suspect that single bad device will trash everything each time.
with ASIO i got:
With Reproduktory (US-16x08 Audio) - Windows WDM-KS I got this error:
With
"Reproduktory (US-16x08) - MME";
I am only getting STEREO output despite outputting to 8 channels.