-
Notifications
You must be signed in to change notification settings - Fork 24
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
Many xruns when running as lv2 in Ardour #44
Comments
Hello @farvardin
Beta 2 is an old version and contains a plethora of issues. If this doesn't help, are you able to try whether this happens also in -rt kernel configuration ?
I designed the plugin for best prevention of x-runs possible, but there are a few suspects to look at. In particular this synth involves a background task which dynamically reoptimizes allocations of chip channels, not present in a FM synthesizer like Dexed. Does your workflow involve a lot of parameter manipulation ? has it happened also while idle ? |
Problem is identified. It seems because the background worker inherits a realtime priority when it shouldn't. |
@farvardin turns out this is an issue at Juce side and I attempted a fix. Do you mind testing binaries and report whether this solved the issue? at my side no xruns at 2.67ms latency. |
Thanks a lot for your efforts. I haven't done some parameter manipulations, I just load ADLplug and use the default instrument. When idle, there is no xruns, but when a play a note, it happens, for example 3 Xruns in 5 seconds, playing a single note. The lowlatency kernel seems to be a replacement for the -rt kernel. https://wiki.ubuntu.com/RealTime I've tried your beta 4 binary, but I'm afraid, it's the same like before :( (it looks like the binaries were built before your patch) |
It's a similar symptom as I've been able to experience on my own side, which has been resolved after patching Juce.
Can you guarantee me that you have picked latest from releases ? as I linked in my previous message. not beta4 or nightly. If the problem is present, can you experiment this:
|
Revision build be54e95 will be fine. |
Here are the results: ps ax -L -o 'policy,sched,pri,rtprio,args' | grep -i adlplug and ps ax -L -o 'policy,sched,pri,rtprio,args' | grep -i adlplug No problem for running adlplug as standalone or as a plugin in jalv. They sound both the same, and no Xrun at all. It's only with ARDOUR that I got bad experience. I'm sure the plugin doesn't result from a previous install, because when I uninstall your latest binary, the plugin won't show up in Ardour, it's reported as missing (and when it's present it advertise as beta 4, and the default install from kx studio is beta 2). I can't run the previous ps command when adlplug is launched from ardour though, it must be contained somehow else. |
I can add something else, I've tried to record the adlplug in Ardour directly into an audio track (also in Ardour). Then I get a massive amount of Xruns (something like 1800 xruns in 30 seconds). There is not such a problem if I record with an other instrument (dexed for example). |
I have identified the issue : it's a problem of Ardour. Therefore, it's not a thing that I can solve on my side, it's a problem to report to Ardour developers. ADLplug is a plugin which has next to 970 parameters. (because of 16-part duplication) |
I've also tried the lv2 plugin inside LMMS (using Carla Baypatch). It's much better than in Ardour 5, but in some occasion, I still get some xruns. I don't use many other DAW on linux, so I can't tell for the other. I'll definitely write a bug report to Ardour about this: I can understand now why DrumSynth, with more than 2500 parameters, is unusable in Ardour. But maybe it's a technical constrain which can't be fixed. For improving how ADLplug works as LV2 (and maybe VST too), we can wonder if we need all those 970 parameters in ADLplug: because of the 16-parts, if I understand well, there is one part for each midi channel (in LMMS channel 1 was driving part 1, channel 2 part 2 etc). (In ADLmidi beta 2, it was just called Midi Channel) But do we need multiple channels in the LV2, for using as single instrument in DAW? I didn't find how to play several parts together, like in Zynaddsubfx (I don't know if it's possible). So I suppose the 16 parts are from the original code for playing midi files, with 16 different channels. As a quick and dirty workaround, I've just stripped down the 15 extra parts in resources/lv2/ADLplug.lv2/ADLplug.ttl, keeping only the first part, and compiled it as LV2. Now it works perfectly well in Ardour (only 64 parameters instead of 970). What do you think? Is it possible to create an option for having only the first part in some occasion, and more in others (but for what use?), or only 16 parts when using as stand-alone... I suppose as standalone you can input several midi instruments, each one using its own channel. |
This is true in many cases, but there was a rationale behind doing this.
It works out of the box, you can try by sequencing a MIDI file into it.
It's probably a workable short term workaround. On occasion I'll have a look at this Ardour problem myself. It's better this from my point of view, than to introduce such complication into the project. |
This makes me wish that LV2 would have deprecated control ports (as was originally intended). if you have > 900 controls, prefer LV2 Properties, and Patch Set/Get. That scales to millions. Keep in mind that host-exposed control-ports should also be a reasonable number in general. Ideally something that can be mapped to a control-surface for automation (around 8..16). No user is going to dial through 970 controls to find the correct one to automate or MIDI map it. |
Well thanks for the hint about using patch extensions. That would be certainly fine with me if not for some problems.
About Ardour I have tried Ardour 5.12 versus Ardour 6 git.
I'd like to facilitate this by some kind of grouping. Would LV2's port groups do? |
grep for
I don't think so. As far as I can tell, http://lv2plug.in/ns/ext/port-groups/port-groups.html are for audio-channel layouts. However http://lv2plug.in/ns/ext/port-props/port-props.html#displayPriority or http://lv2plug.in/ns/ext/port-props/port-props.html#notOnGUI may help
The most widespread use currently is for host-provided file-browser(s). There are a couple of plugins around e.g.https://github.com/x42/convoLV2 . As for float parameters, have a look at some of the https://github.com/OpenMusicKontrollers plugins e.g. https://github.com/OpenMusicKontrollers/moony.lv2/blob/master/plugin/moony.ttl#L66 |
For future reference: a simple example to use Parameter/Properties: https://github.com/x42/property_example.lv2 On 2nd thought, that would only solve part of the problem. Ardour will still expose all the properties as automatable controls (still slow in 5.12 [1]). They're all passed via a single control-port. So Ardour won't need to iterate over all ports on every [1] a workaround here would be to mark port or parameter as http://lv2plug.in/ns/ext/port-props/port-props.html#notAutomatic or http://lv2plug.in/ns/ext/port-props/port-props.html#causesArtifacts |
Thanks for the example @x42, it is helpful. |
@farvardin update: pleasy try the latest version which has a performance improvement. What has been done: disable most parameters; I kept the general ones, and also volumes of fm operators: the latter can be useful to automate, they have not too bad resolution, and can drive a modulator to produce dynamic variation of timbre. The presets will not make sense now so I'll disable them; use states. |
Great, it works flawlessly now in Ardour, with the latest version, thank you very much! I suppose you prefer to keep all the 16 voices for a restricted set of parameters. I'd prefer to have only one voice with more parameters (such as ADSR), but on the other hand, I'm not sure I'll use the automation in my tracks, and I have no clue what other users would prefer, so it's probably reasonable to do like you did :) For the preset, I noticed in Ardour there was a preset arrow for ADLplug (in the favorites) but it was empty when we expanded it. It's probably better to disable it then. Merci encore ! |
Thanks for confirming, I will publish the beta release 5.
It's not necessarily that useful. First thing, the chip parameters provide some very limited resolution, due to the small width of OPL registers. For example each ADSR value was coded on 4 bits (range 0-15). Second, there already is a decent amount of control implemented in MIDI, where it translates to chip commands. This is a MIDI Implementation Chart. For extended control ability, it can be a possibility to offer this over MIDI or OSC. |
I'm designing some sounds with ADLplug, and now I see a good reason to have more parameters with the generic interface: sometimes it's difficult to get the correct setting from the specific interface, which has no value (or no pop-up value) for control, especially for frequency multiplicator for instance. With the generic interface we get all the values. |
@farvardin then it's a user interface issue? if, so please discuss this topic in a new issue if you don't mind. |
good idea, I've just opened #45 |
hello,
when I run ADLplug as standalone, it works fine. However, when I run it from inside Ardour 5.12, there are many Xruns and some audio glitches.
My latency is quite low (2.8 ms), with a higher latency (like 5.8 ms), there are fewer xruns. However, with Dexed, Zynaddsubfx or Helm in Ardour, which are apparently more ressource hungry than ADLplug, I don't have those xruns with the same low latency.
The DSP load is around 40 % with ADLplug (even without playing), while with Helm for example it's around 25%. I'm using the DOSBOX core, with 1 or 2% CPU, so it's not ressource hungry.
Distribution: Linux Mint 19 (latest), with 4.15.0-20-lowlatency kernel, ADL plug 1 beta 2
The text was updated successfully, but these errors were encountered: