Skip to content
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

JUCE8 Plugins Don't Work Causing Black Screen and Crash #386

Open
1 task done
relaborn opened this issue Dec 18, 2024 · 18 comments
Open
1 task done

JUCE8 Plugins Don't Work Causing Black Screen and Crash #386

relaborn opened this issue Dec 18, 2024 · 18 comments

Comments

@relaborn
Copy link

Thanks for giving yabridge a shot!

  • I read through both the troubleshooting and the known issues sections, and my issue wasn't listed there

Problem description

This is not a yabridge issue but I'm documenting it here because people will come here.

Many JUCE8 plugins result in a black screen GUI because they require Direct2d feature level 1.3 and that's not currently available in wine, dxvk or vkd3d.

You will likely see this error in your logs

[Wine STDERR] err: DxgiFactory::CreateSwapChainForComposition: Not implemented

There is a workaround for plugin developers to call previous rendering methods after detecting wine but this requires developers to want to do this and implement it. Apulsoft have done this already and others might be willing if they are hit with a pleasant support request detailing the problem and pointing to the solution.

https://forum.juce.com/t/juce8-direct2d-wine-yabridge/64298/5

This is likely to be a growing problem unless there's an implementation of recent D2D features upstream as developers transition to JUCE8. Personally I back up my prefixes before I attempt an upgrade.

What did you expect to happen?

Working plugin

What actually happened?

Black screen plugin crashes after a while

Operating system

Debian 12.8 Bookworm

How did you install yabridge?

Directly

yabridge version

5.1.1

yabridgectl version

5.1.1

Wine version

wine-9.21.r1.g32abf9fc ( TkG Staging Esync Fsync )

Plugin

Many JUCE8 Plugins

Plugin type

VST3

Plugin architecture

64-bit

Host

Bitwig, Reaper, Mixbus

Desktop environment or WM

Gnome

GPU model

AMD Radeon RX 6600

GPU drivers and kernel

Mesa 22.3.6-1+deb12u1

Debug log

20:03:14 [Lair-9AGIJQgm] [Wine STDERR] 0024:fixme:d2d:d2d_device_create_device_context Options are ignored 0x1.
20:03:14 [Lair-9AGIJQgm] [Wine STDERR] err: DxgiFactory::CreateSwapChainForComposition: Not implemented
20:03:14 [Lair-9AGIJQgm] [Wine STDERR] err: DxgiFactory::CreateSwapChainForComposition: Not implemented
20:03:14 [Lair-9AGIJQgm] [Wine STDERR] 0024:fixme:d2d:d2d_device_create_device_context Options are ignored 0x1.

Anything else?

Plugins I know to be problematic:
Audio Modelling SWAM instruments and Ambiente
Hertz Drums
All Aberrant DSP plugins

All these plugins have older versions based on JUCE7 except Ambiente. If you check for older versions in your download page or contact the developer you should be able to get them.

Developers often have their own altered tree for JUCE, so not all JUCE8 plugins are a problem.

VocAlign6Pro is JUCE8 but exhibits other problems.
Minimal Audio Squash is JUCE8 but works fine.
Apulsoft apUnmask is JUCE8 works fine.

How to find out if your plugin is based on JUCE8

strings PluginName.vst3 | grep 'JUCE v8'

to scan the all your yabridge vst3 plugins, do this
cd ~/.vst3/yabridge && IFS=$(echo -en "\n\b"); for i in $(find . -name *.vst3 -type l); do grep 'JUCE v8' $i; done

@0CCULTIST
Copy link

Does the latest version of apShaper work for you? 1.2.4 switched to JUCE 8 and doesn't work for me, but 1.2.3 does.

@relaborn
Copy link
Author

Just tried the demo and it doesn't work. It's based on JUCE 8.0.3 and apUnmask (which works) is based on JUCE 8.0.4 so I presume it's just a build from before the issue was fixed.

The dev is really nice. If you drop him a mail explaining the issue, he'll probably do a new build.

@relaborn
Copy link
Author

Just an additional symptom and a partial fix.

Sonible prime:vocal is a JUCE 8.0.4 based ARA2 plugin and standalone app. It doesn't work with yabridge 5.1.1 due to the lack of ARA2 support (it doesn't allow plain VST usage).

The standalone app manages to display it's initial screen but only updates for resizing. Same CreateSwapChainForComposition error.

This can be fixed by creating a dxvk.conf file containing this single line

d3d11.maxFeatureLevel = 9_1

then add this to your environment in your preferred way.

DXVK_CONFIG_FILE=/wherever/your/file/is/dxvk.conf

This fixes prime:vocal but just produces a black screen for apShaper 1.2.4. It may or may not work for other JUCE 8 plugins, I guess dependent on whether they've coded a fallback. Potentially, it would be nice to set DXVK_CONFIG_FILE in a yabridge toml file so that it can be enabled per plugin or per prefix.

A fuller fix probably requires vkd3d, which does contain code to cover CreateSwapChainForComposition. I have yet to figure out a way of forcing JUCE 8 to use DirectX12, if that's possible. The version of vkd3d installed by winetricks is vkd3d-proton which works in conjunction with dxvk, using dxvk's DXGI implementation.

@relaborn relaborn reopened this Dec 30, 2024
@sandycorzeta
Copy link

Confirmed this also happen with reFX NEXUS5 vst.
They use JUCE8 also and have it black screen when i use it through yabridge.
Version 4 didn't have this problem.

@relaborn
Copy link
Author

Also with SPL Machine Head from Plugin Alliance. Same issue. Black screen. JUCE 8.0.4

I noticed that 'D2D swap chain thread' was in the output when checking for JUCE. Maybe configurable via a preprocessor directive? That doesn't help us but it might mean there's variation in results for different JUCE 8 plugins. Minimal Audio Squash - which works - also has this in the output but they are definitely using a modified version of JUCE 8.

strings 'SPL Machine Head.vst3' | grep JUCE
JUCE v8.0.4
JUCE
JUCE AudioPluginHost
JUCE_
JUCE D2D swap chain thread
JUCE

@relaborn
Copy link
Author

Harmony Bloom from Mario Nieto also fails with a black screen and eventual crash. Same reason. JUCE 8.0.4

@andiejs
Copy link

andiejs commented Feb 12, 2025

Hi gang, I'm hoping the WINE people might be able to work on this; if you can help me give some more specifics in the WINE forum post, this might help us get some action. ---->>>
https://bugs.winehq.org/show_bug.cgi?id=57833

@relaborn
Copy link
Author

Maybe link this issue in your bug report.

DxgiFactory::CreateSwapChainForComposition

is the problem but it's not a problem with wine. Wine has vkd3d for D3D12 (which has been forked to vkd3d-proton). This feature has been implemented already in vkd3d but the stack is not mainstream yet. The current native D3D implementation in wine tops out at D3D10, I think.

What most people used for earlier JUCE plugins and JUCE 8 plugins that have been written to fall back to older rendering methods is dxvk. dxvk is separate from the wine project and provides D3D8-11 with a focus on games. A dxvk developer has said they won't implement that feature.

So the problem we have is that the feature is not there in dxvk and won't be added and people use dxvk for plugins because it performs better than the native wine D3D implementation currently in many cases.

@andiejs
Copy link

andiejs commented Feb 12, 2025

Thanks very much, I've linked that info in the winehq bug report.
The thing is it's not working on the native wine D3D nor on dxvk. Am I wrong in thinking that if it worked on native wine D3D that would also be good? When you say "This feature has been implemented already in vkd3d but the stack is not mainstream yet." does that imply there's some way of getting it going?

If in fact the way to do this is through dxvk and not making native wine support it, I think we need to find those dxvk guys and ask them once again to implement this. It's wild that all WINE support for JUCE, .vst3s, making music is hanging in the balance of a dev saying they won't implement it... maybe another dev will? maybe they'll change their mind if we let them know it's important? Do you have any sense of who to speak to? I think maybe we should hunt them down and pester them a little bit?

@relaborn
Copy link
Author

If it worked with native wine D3D that would be great.

Development takes time and requires resources. Certain sections might be implemented and other sections not.

For instance, vkd3d-proton, which was forked from wine's version uses dxvk for DXGI, probably because dxvk is relatively mature and has a working DXGI implementation (don't quote me).

Wine is always in the position of playing catchup. DirectX 12 was released in 2015 and Vulkan in 2016 but Vulkan didn't really catch on for maybe 5 years. Vulkan provides a much better api to translate into than openGL. But even with the best starting point, it's a lot of work. Sometimes things progress faster if there's a company pushing for development of a particular thing. dxvk was supported by Valve to make Windows games run on Linux. Now they have linux hand held consoles playing windows games.

There are often very good reasons for things to not be implemented. CreateSwapChainForComposition is part of D3D11, so that's Windows 7 vintage. In theory, that's dxvk's wheelhouse.

@mjsuarez
Copy link

@andiejs, saw your bug report on winehq (thanks!) and FYI, I've been in touch with Audio Modeling's support. Based on the dxvk fallback in the JUCE forum they crafted a Saxophones 3.9(beta) for me to test which worked. They said they'd work with the JUCE team to try and get it in for the next update. I think JUCE holds the low-hanging fruit, while winehq will require an extension ladder. We'll see.

@relaborn
Copy link
Author

That's really good news. When I contacted them I also pointed them at the method to fix but they didn't seem overly interested. They did, however, link me their JUCE 7 versions of the plugins except for Ambiente, which doesn't have a JUCE 7 variant.

I guess that proves that contacting support can yield results even if the first few people didn't have as much luck. They are probably discovering some of the size of their Linux user base.

I agree that an easier vector is JUCE. Right now having individual developers having to think about and solve the problem rather than a JUCE-wide solution but maybe if enough developers are complaining to JUCE that will come to pass.

If you get an update that all their plugins are working, it would be very useful if you posted that here.

@andiejs
Copy link

andiejs commented Feb 14, 2025

I've been trying to piece this stuff together all day and my current understanding is that - -

If we try to fix this from the point of view of WINE:
CreateSwapChainForComposition is part of DXGI, which is not part of D3D11, but a separate layer. DXGI is implemented both by wine and by DXVK, and neither have implemented CreateSwapChainForComposition, so theoretically that could be either of them. Zeb over at the Wine forum seems to consider it to be something WINE should fix.
Also, as mentioned, there's not d2d support for feature level 1.3, which would fall to WINE and not DXVK, based on what they currently cover.
It's unclear to me exactly how these relate, since d2d is not part of dxgi, but they're connected...

The Audio Modeling support sent me the same saxophones they sent you, which work. Oddly, even though they created them by making the JUCE patch suggested on the JUCE forum post, they told me they wanted JUCE to fix it rather than using that patch. Seems unfortunate to me since they've already got it working, and I tried to encourage them to use the fix regardless of JUCE (who are at least discussing this issue, yay!)

As you can see I'm trying to work all angles (Juce, Wine, Audio Modeling...) I agree it would be easiest for Juce to just work around Wine, but they're right to say why the heck doesn't Wine implement this decade old stuff...

@relaborn
Copy link
Author

relaborn commented Feb 14, 2025

You know more than I do. I looked at the source for yabridge because I wanted to see how easy it would be to patch in libMTS support from a prefix to the host. It's really nice what robbert has managed to do but this stuff gets complicated quickly and it's way out of my wheelhouse. GPU stuff is further beyond me. I would need to study it for a long time.

In vkd3d, CreateSwapChainForComposition has been implemented in part
https://gitlab.winehq.org/wine/vkd3d/-/blob/master/include/vkd3d_dxgi1_2.idl?ref_type=heads

The vkd3d-proton fork uses the DXGI from dvxk which doesn't implement it.

JUCE is open source, so maybe the easiest way would be to provide a patch to JUCE to fix the issue, if it hasn't been done already, as that's the easiest fix. I've started looking through the JUCE issues and pull requests but have yet to find anything.

https://github.com/juce-framework/JUCE/

@andiejs
Copy link

andiejs commented Feb 14, 2025

There is a discussion on the JUCE forum, it was actually linked in the first post of this thread. For completeness of information I probably should have linked this a couple days ago, but things were a little heated for a moment and some of them weren't completely friendly to non-JUCE devs (me) being on that forum at all (though others are being friendly and helpful).

They are looking into fixing it and a couple of people have implemented solutions on their own forks, but there are still some issues remaining including some of them rightly saying WINE should just support decade-old Windows dependencies and it's not their problem. I think they do recognize that in the short term it may be easier for them to do a quick workaround, and they're looking into it.

I'm trying to get more exact info out of them of what the WINE people would need to do to support JUCE -- as I said in my last post, the JUCE people say it's "d2d support for feature level 1.3" but then it's also that dxgi error that we all see (CreateSwapChainForComposition) and I'm not clear whether or how these relate.

https://forum.juce.com/t/juce8-direct2d-wine-yabridge/64298/49

@andiejs
Copy link

andiejs commented Feb 14, 2025

In vkd3d, CreateSwapChainForComposition has been implemented in part
https://gitlab.winehq.org/wine/vkd3d/-/blob/master/include/vkd3d_dxgi1_2.idl?ref_type=heads

Oh, and thanks for the link to vkd3d -- unfortunately that's just an interface file where it's mentioned as something that should be implemented, but I don't see an actual implementation anywhere in their code!

@relaborn
Copy link
Author

relaborn commented Feb 14, 2025

Yup. That's as far as they've got. Not even stubs for the interface yet.

Nice work in the JUCE forum. It looks like it's helping.

@relaborn
Copy link
Author

relaborn commented Mar 8, 2025

Another non functional JUCE8 plugin with the same issue.

Fuel from MusicHack.

https://www.musikhack.com/products/fuel/

Their previous plugin Master Plan works fine with dxvk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants