Page 1 of 1

No sound when using vcpkg for building Raze from source

Posted: Thu Jan 11, 2024 10:03 pm
by sacarias
Using Debian 12 Bookworm.

These are the complete steps I currently follow for building:

Code: Select all

cd Downloads/builds
git clone https://github.com/microsoft/vcpkg.git
vcpkg/bootstrap-vcpkg.sh
git clone https://github.com/ZDoom/ZMusic.git
mkdir -p ZMusic/build/zmusic_install
cd ZMusic/build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=zmusic_install
make -j2
make install
cd ../..      # Back to directory Downloads/builds
git clone https://github.com/ZDoom/Raze.git
mkdir -p Raze/build/raze_install
cd Raze
git config --local --add remote.origin.fetch +refs/tags/*:refs/tags/*
git pull
cd build
cp ../../ZMusic/build/zmusic_install/lib/libzmusiclite.so.1.1.12 libzmusiclite.so.1
cp -r ../../ZMusic/build/zmusic_install/include .
cp -r ../../ZMusic/build/vcpkg_installed .
cmake .. -DCMAKE_TOOLCHAIN_FILE=../../vcpkg/scripts/buildsystems/vcpkg.cmake -DZMUSIC_LIBRARIES=libzmusiclite.so.1 -DZMUSIC_INCLUDE_DIR=include -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=raze_install; echo $?
cp -r vcpkg_installed/x64-linux/include/SDL2 ../libraries/ZWidget/include
make -j2
make install
The step of copying SDL2 directory is because otherwise building process with "make" fails with "Fatal error: SDL2/SDL.h: No such file or directory". I really expected vcpkg to automatically take care of this, but it simply doesn't; and I don't know what CMake flag to use to fix this...

Anyways, with all of this the process completes.
But when running there's no sound at all. Console output does say something like "Opening device Openal: not found. Falling to NOSOUND".

Installing the OpenAL -dev dependencies and retrying from start changed nothing at all.
I did notice however that, when configuring Raze with CMake, vcpkg actually uninstalled the Alsa stuff installed back when configuring ZMusic...
Even when trying "ldd" to raze binary or libzmusic there's nothing pointing to any sound library...

This is the main problem here, but I'm still adding two additional ones:
---"make install" does NOT include libzmusic nor soundfonts directory into the installation directory; same analogous situation with GZDoom as well.
---If trying to build Raze without vcpkg at all and instead using system's development packages, CMake always marks WebP as missing even when libwebp-dev is installed; and I think it may be because Raze's CMakeLists only considers it if installed from vcpkg

Can someone help please?
Thanks.

Re: No sound when using vcpkg for building Raze from source

Posted: Fri Jan 12, 2024 7:59 pm
by Talon1024
Have you tried setting LD_LIBRARY_PATH to the folder where vcpkg installs the .so files?

Code: Select all

$ LD_LIBRARY_PATH=<path_to_vcpkg_so_files> ./raze
On the other hand, I'm using the distro-provided libraries for SDL2, WebP, etc. on Ubuntu 22.04, and I've had no problems compiling or playing GZDoom or Raze so far.

Re: No sound when using vcpkg for building Raze from source

Posted: Sun Jan 14, 2024 4:46 pm
by sacarias
Mods: what else would you need to help a bit with issue? Outputs, commands...?

For the note, the only thing vcpkg does is installing "separate" versions of: CMake, WebP, VPX, SDL2

Re: No sound when using vcpkg for building Raze from source

Posted: Fri Jan 19, 2024 12:39 am
by lucaso
If the make install command is not including the libzmusic and soundfonts directories in the installation directory, you can manually copy the necessary files to the installation directory. From the Raze build directory, run the following commands:

cp ../../ZMusic/build/zmusic_install/lib/libzmusiclite.so.1.1.12 raze_install/lib
cp -r ../../ZMusic/build/zmusic_install/soundfonts raze_install/
```
This will copy the `libzmusiclite.so.1.1.12` library file and the `soundfonts` directory to the appropriate location.

https://dinosaurgame3d.com

Re: No sound when using vcpkg for building Raze from source

Posted: Fri Jan 19, 2024 3:02 pm
by sacarias
What about the main problem?
Tried just again the whole process using vcpkg instead of of the entire libraries from distro, and no sound...

And GZDoom/Raze CMakeLists still fails to detect WebP libraries installed from distro...