brummer10 / neural-amp-modeler-ui

This is a GUI for the Neural Amp Modeler LV2 plugin
43 stars 1 forks source link

is it possible that this addition to NAM could break compatibility with ardour....? #3

Closed billyblackburn closed 8 months ago

billyblackburn commented 8 months ago

Ardour segfaults every time i try to load it now.,
it works with other plugins still on a good note I am so happy to present this.....i been messing to get it this low for a week. i have new amd 7700x and plenty ram with a old scarlett.
Check out my latency though (with nam sadlay :()))) Screenshot from 2024-02-04 22-53-27

brummer10 commented 8 months ago

I don't think that have anything to do with the UI. 2024-02-05_05-16 I usually using 128 samples/frame. You could check if the GUI is the cause by just reinstall the neural-amp-modeler, that will disable the GUI. If it works then, please let me know and I'll investigate.

billyblackburn commented 8 months ago

ok let me try with carla

brummer10 commented 8 months ago

when you update your version

git pull
git submodule update

you could just run make uninstall to remove the GUI. To re-add it just run make install as usual

brummer10 commented 8 months ago

. . . and get the new quick access menu NeuralAmpModelerGui

billyblackburn commented 8 months ago

Oh.ok, good idea

lrfinotti commented 8 months ago

I can confirm the problem. The GUI opens fine in Ardour, but when I try to load a new .nam file, it crashes Ardour. Removing the GUI (by reinstalling plain NAM), it loads without problems. I also have just done a git pull and followed the installation steps again to make sure that I was using the latest version.

$ git pull
remote: Enumerating objects: 64, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (35/35), done.
remote: Total 58 (delta 41), reused 39 (delta 22), pack-reused 0
Unpacking objects: 100% (58/58), 8.24 KiB | 602.00 KiB/s, done.
From https://github.com/brummer10/neural-amp-modeler-ui
   fef035c..d059c20  main       -> origin/main
Fetching submodule libxputty
From https://github.com/brummer10/libxputty
   4655a9c..8d542dd  master     -> origin/master
Updating fef035c..d059c20
Fast-forward
 Neural_Amp_Modeler/Neural_Amp_Modeler.c |  85 ++++++++++++++++++++++++++++++++++++++++++-----
 Neural_Amp_Modeler/lv2_plugin.cc        | 149 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------
 Neural_Amp_Modeler/lv2_plugin.h         |   7 ++++
 Neural_Amp_Modeler/makefile             |   7 ++--
 Neural_Amp_Modeler/restore/manifest.ttl |   8 +++++
 libxputty                               |   2 +-
 6 files changed, 230 insertions(+), 28 deletions(-)
 create mode 100644 Neural_Amp_Modeler/restore/manifest.ttl

$ git submodule init

$ git submodule update 
Submodule path 'libxputty': checked out '8d542dd0b17fbef5a734a2634b5af1688c0e604d

$ make
for         Linux
with        cc
using       ld
and         xxd -i
 ================================================
 Building object file b64_encode.o 
 Building object file xadjustment.o 
 Building object file xadjustment_private.o 
 Building object file xasprintf.o 
 Building object file xchildlist.o 
 Building object file xchildlist_private.o 
 Building object file xcolor.o 
 Building object file xfilepicker.o 
 Building object file xpngloader.o 
 Building object file xputty.o 
 Building object file xsvgloader.o 
 Building object file xwidget.o 
 Building object file xwidget-linux.o 
 Building object file xwidget-mswin.o 
 Building object file xwidget_private.o 
 Building object file xbutton.o 
 Building object file xbutton_private.o 
 Building object file xcombobox.o 
 Building object file xcombobox_private.o 
 Building object file xdrawing_area.o 
 Building object file xdrawing_area_private.o 
 Building object file xframe.o 
 Building object file xframe_private.o 
 Building object file xkeyboard.o 
 Building object file xknob.o 
 Building object file xknob_private.o 
 Building object file xlabel.o 
 Building object file xlabel_private.o 
 Building object file xlistbox.o 
 Building object file xlistbox_private.o 
 Building object file xlistview.o 
 Building object file xlistview_private.o 
 Building object file xmenu.o 
 Building object file xmenu_private.o 
 Building object file xmeter.o 
 Building object file xmeter_private.o 
 Building object file xmultilistview.o 
 Building object file xmultilistview_private.o 
 Building object file xplayhead.o 
 Building object file xplayhead_private.o 
 Building object file xslider.o 
 Building object file xslider_private.o 
 Building object file xtabbox.o 
 Building object file xtabbox_private.o 
 Building object file xtooltip.o 
 Building object file xtooltip_private.o 
 Building object file xtuner.o 
 Building object file xtuner_private.o 
 Building object file xvaluedisplay.o 
 Building object file xvaluedisplay_private.o 
 Building object file xwaveview.o 
 Building object file xwaveview_private.o 
 Building object file xdirectory-dialog.o 
 Building object file xfile-dialog.o 
 Building object file xmessage-dialog.o 
 Building object file xmidi_keyboard.o 
 Building object file xsavefile-dialog.o 
 Build static library libxputty.a 
 =================== DONE =======================
build finish, now run make install

$ make install
for         Linux
with        cc
using       ld
and         xxd -i
 ================================================
. ., done

I am running Debian Sid

$ inxi -v3
System:
  Host: debian Kernel: 6.7.0-3.slh.1-aptosid-amd64 arch: x86_64 bits: 64
    compiler: gcc v: 13.2.0
  Desktop: KDE Plasma v: 5.27.10 Distro: aptosid 2013-01 - kde-full -
    (201305050307) base: Debian GNU/Linux trixie/sid
Machine:
  Type: Desktop System: ASUS product: All Series v: N/A
    serial: <superuser required>
  Mobo: ASUSTeK model: Z87-PRO v: Rev 1.xx serial: <superuser required>
    UEFI: American Megatrends v: 2103 date: 08/18/2014
CPU:
  Info: quad core model: Intel Core i7-4771 bits: 64 type: MT MCP
    arch: Haswell rev: 3 cache: L1: 256 KiB L2: 1024 KiB L3: 8 MiB
  Speed (MHz): avg: 3900 min/max: 800/3900 cores: 1: 3900 2: 3900 3: 3900
    4: 3900 5: 3900 6: 3900 7: 3900 8: 3900 bogomips: 55968
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Graphics:
  Device-1: AMD Cape Verde PRO [Radeon HD 7750/8740 / R7 250E]
    vendor: VISIONTEK driver: amdgpu v: kernel arch: GCN-1 bus-ID: 01:00.0
    temp: 45.0 C
  Device-2: Logitech Webcam C270 driver: snd-usb-audio,uvcvideo type: USB
    bus-ID: 3-6:5
  Display: x11 server: X.Org v: 21.1.11 with: Xwayland v: 23.2.4 driver: X:
    loaded: amdgpu dri: radeonsi gpu: amdgpu resolution: 1: 1920x1080~60Hz
    2: 1920x1080~60Hz
  API: OpenGL v: 4.6 vendor: amd mesa v: 23.3.5-1 glx-v: 1.4
    direct-render: yes renderer: AMD Radeon Graphics (radeonsi verde LLVM
    17.0.6 DRM 3.57 6.7.0-3.slh.1-aptosid-amd64)
Network:
  Device-1: Intel Ethernet I217-V vendor: ASUSTeK driver: e1000e v: kernel
    port: f040 bus-ID: 00:19.0
  IF: eth0 state: up speed: 100 Mbps duplex: full mac: e0:3f:49:a3:4c:a6
Drives:
  Local Storage: total: 13.88 TiB used: 6.24 TiB (45.0%)
Info:
  Memory: total: 32 GiB available: 31.3 GiB used: 6.56 GiB (20.9%)
  Processes: 335 Uptime: 1h 22m Init: systemd target: graphical (5)
  Packages: 7796 Compilers: gcc: 13.2.0 Shell: Bash v: 5.2.21 inxi: 3.3.32

I could not quite run Ardour with GDB, but could get a core dump, although there doesn't seem to be anything relevant there... But here it is: gdb.txt

brummer10 commented 8 months ago

That's very strange. I'm using debian/sid as well, Ardour 8.2.0 from the repository. No issues here, Peek 2024-02-07 13-19

brummer10 commented 8 months ago

I could not quite run Ardour with GDB, but could get a core dump, although there doesn't seem to be anything relevant there...

Indeed, nothing really to see there. Ardour provide builds for debugging here: https://nightly.ardour.org/

Just for the Neural Amp Modeler GUI I haven't implemented debug flags, I may need to that. However, the debug build may give better information were Ardour segfault.

brummer10 commented 8 months ago

I just downloaded the latest debug build from ardour.org, but still, didn't get it to crash.

lrfinotti commented 8 months ago

I am also using the official Ardour 8.2, FWIW...

I will download the debug version and try it again tomorrow morning and let you know how it goes. Thanks!

brummer10 commented 8 months ago

That will be very welcome. I just checked my source code and found 2 issues which I fixed now. So, before start a debugging session, would be nice if you could update the git checkout.

billyblackburn commented 8 months ago

Mine stopped crashing after a reboot...now it's working fine. Beats me

On Wed, Feb 7, 2024, 9:42 AM Hermann @.***> wrote:

That will be very welcome. I just checked my source code and found 2 issues which I fixed now. So, before start a debugging session, would be nice if you could update the git checkout.

— Reply to this email directly, view it on GitHub https://github.com/brummer10/neural-amp-modeler-ui/issues/3#issuecomment-1932193581, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYOVOVHMLK7SAYXCUUVNADYSOHGBAVCNFSM6AAAAABCZOB2CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZSGE4TGNJYGE . You are receiving this because you authored the thread.Message ID: @.***>

lrfinotti commented 8 months ago

After a reinstall of both NAM and the UI, Ardour still crashes for me. (With a "fresh" project, with a single mono audio track and just the NAM plugin. The plugin is added correctly, but loading a profile crashes Ardour immediately.)

But I cannot get a GDB trace, due to an incompatibility between versions in Ardour and Debian Sid: see here.

Is there anything else I could do to help find the problem?

It does work fine with Carla...

brummer10 commented 8 months ago

Have you tried to load a nam file via drag and drop? Did that crash as well? Maybe you could try ardour from the repository, that one you could run with the debugger ardour --gdb

If only I could reproduce the crash, I guess it is something really stupid simple.

lrfinotti commented 8 months ago

So, dropping a NAM file into the GUI works! And after that, I can select other files within the same directory using the drop down menu.

I will try Debian's Ardour with GDB tomorrow morning. (I have to leave for work now.)

brummer10 commented 8 months ago

Ah, that's good to know. So it seems it's a issue with the File Browser somehow.

brummer10 commented 8 months ago

I committed some changes related to the file browser, so, it may be a good idea to update the checkout (update submodule as well) before going to a debugging session.

billyblackburn commented 8 months ago

Nice work guys, but I have to be honest here ok, I preferred the default file browser because the new UI one doesn't fit my screen well....the one on mod desktop is ok, but it doesn't even show directories so the UI one is better than mod one but not as good as OG file browser for me (nautilus)

On Fri, Feb 9, 2024, 2:32 PM Hermann @.***> wrote:

I committed some changes related to the file browser, so, it may be a good idea to update the checkout (update submodule as well) before going to a debugging session.

— Reply to this email directly, view it on GitHub https://github.com/brummer10/neural-amp-modeler-ui/issues/3#issuecomment-1936490725, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYOVORP7C3JODX7ZOERMATYSZ2VLAVCNFSM6AAAAABCZOB2CWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMZWGQ4TANZSGU . You are receiving this because you authored the thread.Message ID: @.***>

brummer10 commented 8 months ago

You could resize it to fit your needs. It will keep it's size during session. So people prefer the List view mode.

lrfinotti commented 8 months ago

Hmm... It seemed like the update fixed problem, as I could load profiles with the file browser. But closing the GUI window crashed Ardour. Tested it twice. I will try to get Debian's Ardour version.

lrfinotti commented 8 months ago

In Debian Sid's Ardour (1:8.2.0+ds-1), the GUI does not open at all, so I cannot make it crash.

I did capture a GDB log: gdb.txt

(The error I see on the terminal as soon as I try to open the GUI is suil error: Failed to open module /opt/kxstudio/lib/suil-0/libsuil_x11_in_gtk2.so (/opt/kxstudio/lib/suil-0/libsuil_x11_in_gtk2.so: cannot open shared object file: No such file or directory).)

brummer10 commented 8 months ago

(The error I see on the terminal as soon as I try to open the GUI is suil error: Failed to open module /opt/kxstudio/lib/suil-0/libsuil_x11_in_gtk2.so (/opt/kxstudio/lib/suil-0/libsuil_x11_in_gtk2.so: cannot open shared object file: No such file or directory).)

You should install/re-install libsuil-0-0 from the debian/sid repository. I guess other plugs will have issues as well with libsuil from kxstudio.

Hmm... It seemed like the update fixed problem, as I could load profiles with the file browser. But closing the GUI window crashed Ardour.

Okay, so the issue is when the file-browser free it's memory. (I've moved that to the exit on the main UI) Could you check if test -f $HOME/.config/user-dirs.dirs && echo "exists" print "exists" in the terminal, or if it prints nothing. If it prints nothing, you may run xdg-user-dirs-update to generate this file.

brummer10 commented 8 months ago

Okay, I did a quick test (remove user-dirs.dirs) and now it crashes Ardour here as well. Nice, now I could fix it.

lrfinotti commented 8 months ago

I do have libsuil-0-0 from Debian:

# apt search libsuil-0-0
Sorting... Done
Full Text Search... Done
libsuil-0-0/unstable,now 1:0.10.20-dmo1 amd64 [installed,automatic]
  library for loading and wrapping LV2 plugin UIs (shared library)

So, I suppose I have both. Reinstalling it did not help. I will try to find what KXStudio package adds it and remove it.

Could you check if test -f $HOME/.config/user-dirs.dirs && echo "exists" print "exists" in the terminal, or if it prints nothing. If it prints nothing, you may run xdg-user-dirs-update to generate this file.

I did not have that file, but created it as you suggested, and now the official Ardour version seems to work! I can load and close the window with no crash.

lrfinotti commented 8 months ago

I found the package from KXStudio providing libsuil and removed:

 # apt policy libsuil-kxstudio
libsuil-kxstudio:
  Installed: (none)
  Candidate: 6:0.10.12-1kxstudio3
  Version table:
     6:0.10.12-1kxstudio3 500
        500 http://ppa.launchpad.net/kxstudio-debian/libs/ubuntu focal/main amd64 Packages

But I still get the same problem and error message with Debian's Ardour, where I cannot open the GUI.

I assume it is a problem with my particular system, and I don't use Debian's version, so it might not be worth finding what is wrong. But if you think it would be good to know, I would gladly try to help, although I have no idea what to do to find out.

brummer10 commented 8 months ago

I think you must run apt --purge remove libsuil-kxstudio

to remove as well the symlinks libsuil-kxstudio have installed and then apt --reinstall install libsuil-0-0 to really overwrite the search path to libsuil. but I can't really say if that would work. Anyway you are a user of the official Ardour version which comes with it's own libsuil, so you may just remove the one from debian.

However, nice thing is that I could fix the issue with non exist user-dirs.dirs file. I'll push the fix soon to the repository. Thanks for testing out and give me the right pointer to find it.

brummer10 commented 8 months ago

So I've pushed the fix for this issue to the repository. Additional I implemented a global config for the File Browser, so that now the settings will be reused across sessions. That allow to configure the file browser one time to your needs and then, forget about it.

brummer10 commented 8 months ago

On nice thing about XDG. For example, if you would like to have a direct link, to a folder with .nam files, in the left-hand menu, just add a line like: XDG_NAM_DIR="/path/to/my/nam/files" to the $HOME/.config/user-dirs.dirs file and you get a link "NAM" in the file browser. You could do that as well, for example say ENGL amps XDG_ENGL_DIR="/path/to/my/nam/engl/files" and so on.

lrfinotti commented 8 months ago

How do we "update" (to get the fixes)?

Would it be, from the source directory,

git pull
git submodule init
git submodule update
make
make install

Or do we need to uninstall the previous version first?

brummer10 commented 8 months ago

Yes, from the source directory run

git pull
git submodule update
make
make install

no need to uninstall before.

brummer10 commented 8 months ago

Okay, time to close this issue as it is resolved.