psycha0s / airwave

Airwave is a WINE-based VST bridge, that allows for the use of Windows 32- and 64-bit VST 2.4 audio plugins with Linux VST hosts
MIT License
572 stars 35 forks source link

GUIs transparent in Ardour #23

Closed spectromas closed 7 years ago

spectromas commented 9 years ago

For me airwave cannot be used at all in ardour, the plugin GUIs are transparent and closing/reopening them doesn't change anything. I suspect there is something that could be changed in ardour to fix this because I don't have the same problem renoise or bitwig but I asked one of the ardour devs but they looked at the Known Issues on the front page and said they couldn't do more if it is a wine/airwave bug.

Which wine bug is it that causes this problem? I had a search on the wine bug tracker but I couldn't see anything similar. Is there any headway being made on either wine's side or airwave's?

I tried the develop branch, as well as master, with the latest ardour release version.

jypma commented 8 years ago

I'm having some luck routing the airwave-created VST's first through Carla, and then into Ardour. That way, the native VST's GUI does seem to work.

So in ardour, insert Carla as VST plugin, then insert the airwave-created VST into Carla. Not sure whether the more advanced VST features like tempo information are proxied correctly. Of course, Carla has its own wine proxying as well, but hey, more choice is good right :)

psycha0s commented 8 years ago

I've created a patch for WINE that shoud fix (not a correct fix, just a workaround) this issue. I hope to public it soon in the wine bugtracker.

psycha0s commented 8 years ago

Here is my bug report: https://bugs.winehq.org/show_bug.cgi?id=39440

Snevzor commented 8 years ago

Still no wine fix?

Appears I have wine 1.6 still and a lot depends on that version so I cannot switch to 1.7 or higher without breaking a lot of things.

psycha0s commented 8 years ago

Well, my patch for wine isn't 100% correct and thus, I doubt that it will be merged. But TBH, a general issue with Ardour is not a wine but airwave itself.

Snevzor commented 8 years ago

Oh :( any work-arounds that don't require compiling things myself?

psycha0s commented 8 years ago

There are no workarounds currently, possibly I will find one in the future.

Snevzor commented 8 years ago

Okay :)

2016-03-14 9:38 GMT+01:00 Anton Kalmykov notifications@github.com:

There are no workarounds currently, possibly I will find one in the future.

— Reply to this email directly or view it on GitHub https://github.com/phantom-code/airwave/issues/23#issuecomment-196204370 .

Vriendelijke groeten,

Sven Depoorter

jypma commented 8 years ago

@phantom-code I applied your latest diff to wine-staging 1.9.5, expecting to open Kontakt 5 (32-bit) inside Ardour. Kontakt 5 works fine on standalone wine, and as VST bridged in carla.

However, after compiling wine-staging 1.9.5 with your diff, ardour still won't show the embedded plugin window. Should the patch still work?

psycha0s commented 8 years ago

@jypma sadly, airwave doesn't work with Ardour even with my patch. I'll try to dive into this issue as soon as I can.

psycha0s commented 8 years ago

Ardour users, please test the latest changes and tell if the issue is still present for you. And I'm just reminding that after rebuilding the airwave you need to update your vst links.

Snevzor commented 8 years ago

Wow, that was fast. Unfortunately I can't build airwave myself to test it out (conflicting dependencies and such).

psycha0s commented 8 years ago

@Snevzor if you're using Ubuntu, then you can try to install pre-built binary from here: https://github.com/phantom-code/airwave/releases/tag/1.3.1 Though I didn't test myself.

spectromas commented 8 years ago

The guis are certainly showing now but they seem to freeze (themselves and ardour) after a short time.

psycha0s commented 8 years ago

Thanks for testing I will try to reproduce it.

jypma commented 8 years ago

@spectromas I haven't seen that issue before myself. Could you share the version numbers you're using of:

psycha0s commented 8 years ago

@spectromas, did you update your links? I know, this can be obvious, but from my experience, people make this mistake again and again.

spectromas commented 8 years ago

@phantom-code yeah I did do that eventually, I wouldn't have thought to but I saw you mention it somewhere.

@jypma ardour is 64 bit, 4.7. Linux 4.1.19. It seems to happen with all plugins but Fabfilter Pro Q and Synth1 were two I tested. These were 32 bit. I use jack2-dbus 1.9.10-4 and cadence (latest git version). These are all the settings I use though. 2016-03-21-070124_1253x470_scrot

Snevzor commented 8 years ago

I got another behavior compared to the above mentioned one from @spectromas. I can load the plugin and I can hear it's working but the gui is black (which is new so there is evidence that something has changed): 2016-03-21-202720_1920x1174_scrot

When I maximize the window I see a part of the GUI (but I cannot click anything because probably the real 'hitboxes' are somwhere else in one of our 11 dimensions): 2016-03-21-204112_1920x1174_scrot

As soon as I close the plugin window Ardour freezes and crashes. Tested with LE456 64bit, LE456 32 bit and Amplitube 4 64 bit.

I did update my links using the Airwave manager.

I'm on Ubuntu 14.04.4 LTS (kernel 3.13.0-83-generic, x86_64) I have Ardour 4.7.0, jack2 (1.9.11-20160223) started using Cadence with the following settings: 2016-03-21-203526_759x572_scrot

psycha0s commented 8 years ago

Confirming the freeze after parameter change.

jypma commented 8 years ago

@phantom-code confirmed here as well. Freeze when moving a knob too fast / too often. Not immediately though, some of the first events do make it through.

I traced this down to plugin.cpp calling into its AudioMasterProc around line 230, but not returning. Every freeze is the same: an audioMasterAutomate event doesn't seem to return from AudioMasterProc. They do all come in on the same thread, so it doesn't look like a threading issue at first glance.

Any idea what might be going on in there?

1458828398.934098805           Massive.so : (0x7fdd4effd700) handleAudioMaster(returning)
1458828398.934102307          Massive.dll : handleAudioMaster(audioMasterAutomate)
1458828398.934106882           Massive.so : (0x7fdd4effd700) handleAudioMaster(opcode: audioMasterAutomate, index: 108, value: 0, opt: 0.615234)
1458828398.936389522           Massive.so : (0x7fdd4f40b700) dispatch: effProcessEvents
1458828398.936412509          Massive.dll : handleDispatch: effProcessEvents
1458828398.936389522           Massive.so : (0x7fdd4f40b700) dispatch: effProcessEvents
1458828399.457465426          Massive.dll : handleAudioMaster(audioMasterGetCurrentProcessLevel)
1458828399.457495265           Massive.so : (0x7fdd4effd700) handleAudioMaster(opcode: audioMasterGetCurrentProcessLevel, index: 0, value: 0, opt: 0)
1458828399.457507584           Massive.so : (0x7fdd4effd700) handleAudioMaster(returning)
1458828399.457524772          Massive.dll : handleAudioMaster(audioMasterAutomate)
1458828399.457549860           Massive.so : (0x7fdd4effd700) handleAudioMaster(opcode: audioMasterAutomate, index: 109, value: 0, opt: 1)
(freezes after this, no more output)
jypma commented 8 years ago

I just spotted that ardour's handling of audioMasterAutomate involves a nested call back into Plugin->getParameter. Maybe there's something fishy / thread-y there?

psycha0s commented 8 years ago

I've already seen this several months ago. I'm thinking that threading scheme used in Airwave isn't compatible with Ardour. When an instance of DataPort is used for a request it can't be used for another request before it gets the response. Imagine a following situation (P - plugin endpoint (.so), H - host endpont (.dll)):

  1. P sends dispatch event
  2. H gets dispatch event and calls an audio master callback
  3. P receives an audio master call and translates it to the VST host (Ardour)
  4. VST host sends another dispatch event (the dispatch event call from point 1 is still not returned) At this stage, a DataPort will be in the "waiting for the response" state.

I don't know whether it's correct host behaviour to call a dispatcher when previous dispatcher call is not yet returned. If I don't miss anything, it will be hard to fix this issue.

jypma commented 8 years ago

I have a fix working, by spawning off processReplacing into a different thread. Stay tuned.

jypma commented 8 years ago

@phantom-code Added PR

psycha0s commented 8 years ago

Could anybody who uses the Ardour build airwave from jypma-ardour_fix branch? It contains a fix for a deadlock. I have tested this version with Ardour4 + Spire-1.1 and it seems to be working fine.

jypma commented 8 years ago

Looks like the develop branch works for me, at least I can tweak Massive's knobs without problems.

However, even with patched wine, any plugin doing a resize will freeze the plugin and ardour's GUI. Audio continues though. This is on a patched wine. Curiously, I don't see anything about audioMasterSizeWindow when triggering a resize from a plugin... (Massive) Isn't a plugin supposed to do resizing through that? Or should it just go ahead and resize the window?

spectromas commented 8 years ago

Has this been merged in to the master branch now? I saw the comment on linuxmusicians so I rebuilt airwave and things are looking good so far, I GUIs and no crashes. I think further testing might be good but so far so good. Thanks so much, it's finally like a dream come true.

psycha0s commented 8 years ago

Yes, it's merged in the master. This branch is used for relatively stable commits only. And usually, I build an Ubuntu package for every release. I don't use Ardour personally thus I do only basics tests: load a plugin, rotate knobs and try to play several notes. If you encounter any issues, please report back.

Snevzor commented 8 years ago

I still have largely the same issue as I posted 2 weeks ago. Plugin GUI is shifted almost completely out of range. When I close the GUI ardour freezes and ultimately crashes. The only difference from 1.3.2 is that I can control the (part of the visible) GUI now. Should I make a separate issue for this?

psycha0s commented 8 years ago

@Snevzor I've created a separate issue for you. It seems like a XEMBED problem, could you please provide your wine version there (#41)?

Snevzor commented 8 years ago

Thanks! Will do!

2016-03-31 19:24 GMT+02:00 Anton Kalmykov notifications@github.com:

@Snevzor https://github.com/Snevzor I've created a separate issue for you. It seems like XEMBED problem, could you please provide your wine version?

— You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub https://github.com/phantom-code/airwave/issues/23#issuecomment-204036299

Vriendelijke groeten,

Sven Depoorter

spectromas commented 8 years ago

@phantom-code unless you need more testing for this, feel free to close the issue. It seems to be completely fixed for me.