-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make HEELP core reliable on Windows #2
Comments
@NothanUmber @TheTechnobear hey guys, if you have any cycles to look at the current HEELP state on Windows, that would be very helpful. I've got too little Windows development experience to really know where to direct the search to. It would be great to have the core reliable on both macOS and Windows before starting to make things more complex. |
@gbevin Will give it a try in the evening. |
Thanks @NothanUmber ! :-) |
Got rid of the insta-crash when switching audio devices: Still at least two issues remaining:
|
@NothanUmber thanks!!! I don't get an instacrash when switching audio devices, so it's great that you found this. I'm wondering, would it have the same effect if you merely do in ChildAudioComponent::Pimpl::releaseResources():
This would remove the need for an additional lock and still leave the memory deallocation for the constructor? |
@NothanUmber I committed some changes that might fix what you have in your commit but without any additional locks, does it fix the instacrash for you? |
@NothanUmber I completely removed the local buffer in ChildAudioComponent, which should solve that first issue you still had. No idea about that deadlock though, I'll try to find a proper Windows audio interface device to test this with, I can't get ASIO to work at all for my internal sound card. |
@NothanUmber @TheTechnobear sadly I'm suspecting that ASIO doesn't actually allow multiple processes to use it and that the first one that grabs it has exclusive access to it. This would mean that the multi-process approach that times off of the audio callback thread can't work on Windows :-/ |
a quick search , indicates exclusive mode can be disabled, but its introduces latency. |
@TheTechnobear my searches indicate that only very few audio interfaces support ASIO in multi-client mode (RME) and that for others you would have to install a dedicated multi client server for that from Steinberg, which seems not really maintained. I would like to avoid one additional buffer of latency for the purposes of this application since it's quite contrary to what you need for live performance. Note that there's already one buffer minimum for the audio generation, another one for the MIDI data collection, and this would be a third. So the multi-process approach really only was acceptable to me if just the busses would require that additional buffer and the dry signals could be output immediately. I think HEELP will have to have a second mode with only RT threads and no sandboxing, which will be the only one available on Windows. As an upside, this might make it possible to not have an additional buffer of latency on the busses. @TheTechnobear have you had a chance to look into the integration of the Eigenharp USB code? |
@gbevin @TheTechnobear Yepp, the release date of that multi driver thing doesn't imply intense testing with Windows 10 :) Geert, your change indeed resolves the "insta-crash". Now I am far enough to say that I also don't get audio with ASIO anymore. (Anymore: ASIO actually worked with the very first version of HEELP I tested) Perhaps it is better anyways if a channel isn't forced to run in an own process on Windows (afaik for older versions of Windows process context switches were by factors more expensive than mere thread context switches. Not sure whether Win10 got better in that regard...). So running 16 channels on 4 cores would require a lot of process switching (and thus cache flushing). |
indeed, I think in the code, there should be concept of channels and components (within channels) and these should be given a context to run from... this might be a 'remote process' context, or a thread context... i.e. the channel doesn't know/care if its communicating with the main process (container) via shared memory, or real memory.... this is an 'implementation detail', and is initialised based on configuration. Ive got guests until Friday, so wont have time till then... |
Found a commercial multi-client capable ASIO driver: http://odeus-audio.com.au/Odeus/AsioLink Also experimented with already setting up the audio manager for the target device in the first place (instead of disabling the default and then switching). Subclassed AudioDeviceManager for that and overwrote createAudioDeviceTypes to enable/disable different device types. Only got WASAPI in non exclusive mode and Direct Sound to run (which are afaik both not meant for low latency audio applications). So no sandboxing it is :) |
Tried to port the Linux JackAudio Juce bindings to Windows (essentially I just replaced dlopen with LoadLibrary and dlsym with GetProcAddress - and a few ifdefs here and there). Tried to understand how Carla works with JackAudio/ASIO on Windows (it also uses Juce) - but occurrently Juce is only used for UI there and they use RtAudio for the audio side... |
Yeah, I would really not want to rely on Jack at all, it has been very flaky over the years and many that have tried to rely on it have been burned and abandoned it. |
I'm going to start working on the multi RT thread version tonight or tomorrow with a way to switch between either. It's a good thing that almost everything for the multi process stuff is already in dedicated classes. |
The current core is very reliable on macOS, you can switch to different audio devices and configurations in a flexible manner and everything works well.
On Windows something is not right, the first startup seems stable and reliable, but switching to different audio devices and configurations afterwards, doesn't hold up even now that the whole audio infrastructure is recreated.
The text was updated successfully, but these errors were encountered: