Author Topic: Latest Linux version crashes  (Read 340 times)

Hanuman

  • Posts: 112
Latest Linux version crashes
« on: 23 Mar '23 - 05:25 »
My app works fine

I download the latest Linux Bass library here
https://www.un4seen.com/download.php?bass24-linux

Extract "libs/x86_64/libass.so" and replace the existing one. Now the app crashes and fails to load.

Bass.Init actually works; but all plugins then fail to load, and the app has a hard crash.

It seems that there's something wrong with that build.

jpt

  • Posts: 109
Re: Latest Linux version crashes
« Reply #1 on: 23 Mar '23 - 11:18 »
It seems that there's something wrong with that build.
Not sure.
No problems here (from years), running Debian 11.6 64 bits

Ian @ un4seen

  • Administrator
  • Posts: 25728
Re: Latest Linux version crashes
« Reply #2 on: 23 Mar '23 - 12:24 »
Did you update the add-ons too? In the past the add-ons weren't linked with the BASS library (libbass.so) on Linux and instead depended on it being preloaded with global scope by the app, but that was changed a few years ago for simplicity (linking order and scope no longer matters) and predictability. The add-ons should be placed alongside the BASS library and/or "rpath" (in the linker options) set to where it is.

Hanuman

  • Posts: 112
Re: Latest Linux version crashes
« Reply #3 on: 23 Mar '23 - 19:33 »
Are you saying that PluginLoad should no longer be called, as they are loaded automatically? The version that works is from 2022-01-20

Does that apply for all platforms?

To get plugin supported file extensions, I need to call PluginGetInfo with the handle returned by PluginLoad; if you say they now auto-load, how does that work?

Whatever the case may be; the hard crash is definitely not optimal behavior.

I just tested on Windows, it runs fine. On MacOS, it crashes on start without saying anything, could be the same issue but haven't explored further.

Here's the device initialization code
https://github.com/mysteryx93/MediaPlayerUI.NET/blob/master/Avalonia.Bass/BassDevice.cs
« Last Edit: 23 Mar '23 - 20:54 by Hanuman »

Hanuman

  • Posts: 112
Re: Latest Linux version crashes
« Reply #4 on: 24 Mar '23 - 07:40 »
OK managing the thousand DLLs is a real hassle as updates come up.

I wrote a Linux script to download/update all the files

bass-update.sh
Code: [Select]
#!/bin/bash

./bass-download.sh bass
./bass-download.sh bassflac
./bass-download.sh basswv
./bass-download.sh bassopus
./bass-download.sh bassdsd
./bass-download.sh bassalac
./bass-download.sh basswebm
#./bass-download.sh basshls
./bass-download.sh bassape
./bass-download.sh basscd
./bass-download.sh basswma
./bass-download.sh bassmix
#./bass-download.sh basswasapi
#./bass-download.sh bassssl
./bass-download.sh bass_fx files/z/0
./bass-download.sh bass_mpc files/z/2
./bass-download.sh bass_tta files/z/2
./bass-download.sh bass_spx files/z/2
./bass-download.sh bass_aac files/z/2
./bass-download.sh bass_ac3 files/z/2
./bass-download.sh bass_ofr files/z/2
#* ./bass-download.sh bass_dts
#* ./bass-download.sh BASSZXTUNE
./bass-download.sh bass_adx stuff
./bass-download.sh bass_aix stuff
#./bass-download.sh bass_wadsp files/z/4
#./bass-download.sh bass_vst files/z/5
#./bass-download.sh bass_winamp files/z/1
#*./bass-download.sh bass_sfx
#./bass-download.sh bass_wa stuff
./bass-download.sh tags files/z/3 18
#*./bass-download.sh bass_dshow


#./bass-download.sh bassenc
#./bass-download.sh bassenc_mp3
#./bass-download.sh bassenc_flac
#./bass-download.sh bassenc_ogg
#./bass-download.sh bassenc_opus


bass-download.sh
Code: [Select]
#!/bin/bash
if [ -z "$1" ]; then
  echo "Syntax: bass-download Lib [path] [sufix]"
  exit 1
fi
lib=$1
path=$2
if [ -z "$2" ]; then
  path="files/"
fi
sufix=$3
if [ -z "$3" ]; then
  sufix="24"
fi

archive="temp.zip"

# Windows
wget -O "$archive" "https://www.un4seen.com/${path}/${lib}${sufix}.zip"
unzip -o -j "$archive" "$lib.dll" -d "win-x86"
unzip -o -j "$archive" "x64/$lib.dll" -d "win-x64"

# Linux
wget -O "$archive" "https://www.un4seen.com/${path}/${lib}${sufix}-linux.zip"
unzip -o -j "$archive" "libs/x86_64/lib$lib.so" -d "linux-x64"
unzip -o -j "$archive" "libs/aarch64/lib$lib.so" -d "linux-arm64"

# OSX
wget -O "$archive" "https://www.un4seen.com/${path}/${lib}${sufix}-osx.zip"
unzip -o -j "$archive" "lib$lib.dylib" -d "osx-x64"

rm $archive

Then just call
./bass-update.sh

This could come in handy for others.

This seems to solve my issues.

Hanuman

  • Posts: 112
Re: Latest Linux version crashes
« Reply #5 on: 24 Mar '23 - 20:00 »
OK got all the DLLs updated to the latest version, ensured by the script.

On Linux, everything works fine.

On Windows, when I debug the application, in either Debug or Release mode, all the plugins load fine. Once I publish the app, none of the plugins load??? I disabled "assembly trimming" that could cause issues, tried manually putting all the DLLs, both the x64 and x86 versions, into the app folder. Nothing loads.

Scratching my head. Since it works perfectly in Visual Studio, it's probably not a BASS issue but... what could I be missing?? Any idea? I exhausted all my ideas.

Hanuman

  • Posts: 112
Re: Latest Linux version crashes
« Reply #6 on: 24 Mar '23 - 23:34 »
OK everything working fine now after a lot of digging.

Ian @ un4seen

  • Administrator
  • Posts: 25728
Re: Latest Linux version crashes
« Reply #7 on: 27 Mar '23 - 11:34 »
Are you saying that PluginLoad should no longer be called, as they are loaded automatically?

Does that apply for all platforms?

It's good to see that you've got things working now, but to answer these questions... The change I mentioned only applies to Linux, and it doesn't mean that add-ons are now loaded automatically or that you should no longer use BASS_PluginLoad. The change is just that the add-ons are linked to the BASS library (which was already the case on the other platforms), and so Linux needs to be able to find the library (in its library search path) when loading an add-on (whether that's via linking or BASS_PluginLoad). The add-ons tell Linux to check their own folder, but other paths can also be used via the "rpath" linker option.