View Issue Details

IDProjectCategoryView StatusLast Update
0009477ardourbugspublic2023-10-14 13:06
Reportercyr123 Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
PlatformPCOSPop!_OSOS Version22.04
Product Version8.0 
Summary0009477: Unable to open native file dialogs from VST plugins
DescriptionWhen I select an option in a plugin GUI that is supposed to open a file / directory dialog in the OS (e.g. "load preset", "open preset directory" or "load license file") nothing happens. This is specific to Ardour, it works as expected in Carla.

I've seen this in a number of plugins, I expect it applies to all VST3 plugins at least.
Examples: Dexed, TAL-U-NO-LX, AudioThings "Things" plugins.
Steps To Reproduce1) Open custom GUI in Dexed
2) Click on CART
3) Click on LOAD, SAVE or SHOW DIR

Nothing happens (a file dialog is expected)
Additional InformationJust as I was posting this bug report I decided to run Ardour from a terminal and look for any hints, and I found some. It looks like some kind of confusion regarding MIME types, followed to an attempt to run every web browser under the sun. I hope this makes sense to someone...

xdg-mime: mimetype argument missing
Try 'xdg-mime --help' for more information.
Warning: unknown mime-type for "/home/cyrano/.local/share/DigitalSuburban/Dexed/Cartridges" -- using "application/octet-stream"
Error: no "view" mailcap rules found for type "application/octet-stream"
Use of uninitialized value $file in open at /usr/share/perl5/File/MimeInfo/Applications.pm line 140.
Use of uninitialized value $file in open at /usr/share/perl5/File/MimeInfo/Applications.pm line 140.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Use of uninitialized value in subroutine entry at /usr/share/perl5/File/BaseDir.pm line 105.
Opening "/home/cyrano/.local/share/DigitalSuburban/Dexed/Cartridges" with Visual Studio Code (inode/directory)
/usr/bin/flatpak: symbol lookup error: /lib/x86_64-linux-gnu/libsoup-2.4.so.1: undefined symbol: g_file_info_get_modification_date_time
/usr/bin/xdg-open: 882: x-www-browser: not found
XPCOMGlueLoad error for file /usr/lib/firefox/libmozgtk.so:
/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined symbol: atk_component_scroll_to
Couldn't load XPCOM.
/usr/bin/xdg-open: 882: iceweasel: not found
/usr/bin/xdg-open: 882: seamonkey: not found
/usr/bin/xdg-open: 882: mozilla: not found
/usr/bin/xdg-open: 882: epiphany: not found
/usr/bin/xdg-open: 882: konqueror: not found
/usr/bin/xdg-open: 882: chromium: not found
/usr/bin/xdg-open: 882: chromium-browser: not found
/usr/bin/xdg-open: 882: google-chrome: not found
/usr/bin/xdg-open: 882: www-browser: not found
/usr/bin/xdg-open: 882: links2: not found
/usr/bin/xdg-open: 882: elinks: not found
/usr/bin/xdg-open: 882: links: not found
/usr/bin/xdg-open: 882: lynx: not found
/usr/bin/xdg-open: 882: w3m: not found
xdg-open: no method available for opening '/home/cyrano/.local/share/DigitalSuburban/Dexed/Cartridges'
/bin/sh: 1: /etc/alternatives/x-www-browser: not found
XPCOMGlueLoad error for file /usr/lib/firefox/libmozgtk.so:
/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined symbol: atk_component_scroll_to
Couldn't load XPCOM.
/bin/sh: 1: mozilla: not found
/bin/sh: 1: google-chrome: not found
/bin/sh: 1: chromium-browser: not found
/bin/sh: 1: opera: not found
/bin/sh: 1: konqueror: not found
TagsNo tags attached.

Activities

cyr123

2023-10-11 15:27

reporter   ~0028181

I have tried to debug this further, looking more closely at the log I see that xdg-open tries (but fails) to launch VS Code, which might be related to this issue: https://github.com/microsoft/vscode/issues/41037 (though I have had no such problems outside Ardour)

If I uninstall VS Code, xdg-open now correctly tries to open the file manager (Nautilus), but that then fails because of:

"/lib/x86_64-linux-gnu/libatk-bridge-2.0.so.0: undefined symbol: atk_component_scroll_to"

Something quite similar reported here: https://gitlab.gnome.org/GNOME/zenity/-/issues/18 turned out to be caused by LD_LIBRARY_PATH and conflicting library versions, I strongly suspect this is the issue here as well.
I see that the launch script for Ardour sets LD_LIBRARY_PATH to that Ardour can use the bundled libraries, but shouldn't this be cleared from the environment when an external application is launched from within Ardour?

cyr123

2023-10-11 16:05

reporter   ~0028182

I think I confirmed and partially fixed the issue using the following wrapper script:

$ cat /opt/Ardour-8.0.0/bin/xdg-open
#!/bin/sh

unset LD_LIBRARY_PATH
/usr/bin/xdg-open "$@"

This fixed the "show directory" function, however it is still no possible to open a file dialog to load or save a file (and I see no log output to diagnose this).

x42

2023-10-13 00:35

administrator   ~0028193

If they'd use the official VST3 GUI that would not be an issue. LD_LIBRARY_PATH is unset there:

https://github.com/steinbergmedia/vstgui/blame/65c353fcad783dd6baa34a2b9dbe23bb9f88d035/vstgui/lib/platform/linux/x11fileselector.cpp#L189

Please suggest that to the plugin vendor

cyr123

2023-10-13 05:25

reporter   ~0028194

Do you happen to know any plugins that do this correctly I could check?

Is there any reason Ardour couldn't, or shouldn't, unset LD_LIBRARY_PATH before loading any plugins? Or could the way it's built and packaged be changed to not rely on this var?

Meanwhile, I've installed a flatpak version of Ardour8 and it doesn't have this issue. I suppose that's a solution, but I'd rather use the officially supported version.

x42

2023-10-13 20:00

administrator   ~0028196

Ardour cannot unset it. It is the plugin that copies the environment after calling fork (which is another thing a plugin should not do since it causes dropouts).
surge is an example of a plugin that gets it right (and they also use vfork).

cyr123

2023-10-14 07:22

reporter   ~0028197

What I mean was essentially https://linux.die.net/man/3/unsetenv in main()
But maybe that would break bundled plugins or some other dynamically loaded part of Ardour ?

SurgeXT (LV2 and VST3 version) seems to have the same problem as the other plugins I've tried.

I've fixed the problem using the brute force method of removing every .so file from /opt/Ardour-8.0.0/lib that isn't needed to allow Ardour to launch without errors.
This is what I'm going to use for now, the flatpak has the problem of not seeing plugins installed using OS packages because of the sandboxing.

x42

2023-10-14 13:06

administrator   ~0028198

Last edited: 2023-10-14 13:06

> What I mean was essentially https://linux.die.net/man/3/unsetenv in main()

That will not work since Ardour dynamically loads modules after that. All engine backends are dynamically linked, as are control surfaces and panners.

> SurgeXT (LV2 and VST3 version) seems to have the same problem as the other plugins I've tried.

Surge solved this a few years ago:
https://github.com/surge-synthesizer/surge/issues/3790
https://github.com/surge-synthesizer/surge/issues/657

Anyway it is really bad practice for plugins to rely on external resources. (libraries or applications), and as the surge discussion explains using fork to launch an external app is even worse since it can cause dropouts.
On other platforms (macOS, Windows) plugins are all statically linked, and pro-audio distros (e.g. KXStudio) do this as well.

I'd rather prefer a baldly written or badly packaged plugin to not work than causing audio dropouts. YMMV.

Issue History

Date Modified Username Field Change
2023-10-10 18:14 cyr123 New Issue
2023-10-11 15:27 cyr123 Note Added: 0028181
2023-10-11 16:05 cyr123 Note Added: 0028182
2023-10-13 00:35 x42 Note Added: 0028193
2023-10-13 05:25 cyr123 Note Added: 0028194
2023-10-13 20:00 x42 Note Added: 0028196
2023-10-14 07:22 cyr123 Note Added: 0028197
2023-10-14 13:06 x42 Note Added: 0028198
2023-10-14 13:06 x42 Note Edited: 0028198
2023-10-14 13:06 x42 Note Edited: 0028198