Problem with ofSoundStream and JACK api - win 10

hi, im using jack as the audio api so i can route audio from another software to of. im using ofSoundStramSettings and setApi():

void ofApp::setup(){

	ofSoundStreamSettings settings;
	settings.setApi(ofSoundDevice::Api::JACK);
	auto devices = soundStream.getDeviceList();
	settings.setInDevice(devices[1]);
	settings.setInListener(this);
	settings.sampleRate = sampleRate;
	settings.bufferSize = bufferSize;
	settings.numInputChannels = 2;
	settings.numOutputChannels = 0;
	soundStream.setup(settings);

}

it works, but not all the time… sometimes the app starts and crashes.
once it starts with no problems, everything works fine…
any idea what can be causing this problem? when it crashed i get this error:

C:\Users\fonse\Documents\of\apps\myApps\nzfs_live\bin\nzfs_live.exe (process 24740) exited with code -1073740940. Press any key to close this window . . .

thanks!

I’m not on windows at the moment, but you might want to see if the devices[1] is being picked up:

Something along the lines of :

for ( int i  = 0; i < devices.size(); i++){
    std::cout << "devices[" << ofToString(i) << "] = " << ofToString(devices[i]) << std::endl;
}

Not sure this is the problem though **.

the device is being picked up. in connections on the Jack Control app the oF app always appears when it starts, and then sometimes it crashes and sometimes not, and i don’t have any idea why…