Try / OpenGothic

Reimplementation of Gothic 2 Notr
MIT License
1.13k stars 80 forks source link

Problem with running Arch Linux build #140

Closed pm4rcin closed 3 years ago

pm4rcin commented 3 years ago

Hi, I tried to run the game with aur package but when I try to launch it that happens:

Gothic2Notr -g ~/Games/gog/gothic-2-gold-edition/drive_c/GOG\ Games/Gothic\ 2\ Gold/
ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) alsa_open_playback: Could not open playback device 'default': No such file or directory

---crashlog(std::system_error(No device))---
GPU: ?
#1: 4�a� - /usr/lib/libstdc++.so.6(+0xa2da7) [0x7fc6617d1da7]
#2: 4�a� - /usr/lib/libstdc++.so.6(+0xa304e) [0x7fc6617d204e]
#3: 4�a� - /usr/lib/libTempest.so(+0xae4fd) [0x7fc6619bc4fd]
#4: Tempest::SoundDevice::device() - /usr/lib/libTempest.so(_ZN7Tempest11SoundDevice6deviceEv+0x40) [0x7fc661a4b4e0]
#5: Tempest::SoundDevice::SoundDevice() - /usr/lib/libTempest.so(_ZN7Tempest11SoundDeviceC1Ev+0x4c) [0x7fc661a4b57c]
#6: Gothic::Gothic(int, char const**) - Gothic2Notr(_ZN6GothicC1EiPPKc+0x2aa) [0x560a8b1c50ea]
#7: main - Gothic2Notr(main+0x51) [0x560a8b147b11]

fish: Job 1, 'Gothic2Notr -g ~/Games/gog/goth…' terminated by signal SIGABRT (Przerwij)

Specs: CPU: Ryzen 5 4600H GPU: Geforce GTX 1650 RAM: 16GB 3200MHz Dist: Arch 5.11.16 Wine: System(vanilla 6.7)

Try commented 3 years ago

Hi, @pm4rcin !

Looks like OpenAL failed to initialize:

ALSA lib pcm_dmix.c:1075:(snd_pcm_dmix_open) unable to open slave
AL lib: (EE) alsa_open_playback: Could not open playback device 'default': No such file or directory

Game engine interprets this case as a fatal failure.

pm4rcin commented 3 years ago

Is there something I can do to help you fixing the issue?

Try commented 3 years ago

Looking into alsa-error message, I think the problem is outside of OpenGothic: https://bbs.archlinux.org/viewtopic.php?id=173709

I think, reinstalling alsa should work

pm4rcin commented 3 years ago

Since I use pipewire I had to install pipewire-alsa and the problem is gone. Anyway I think that it'd be good idea to build the Engine against pulseaudio and not pure alsa or ideally against pipewire. :)

MordragT commented 5 months ago

I am getting the same error on Nixos with the following derivation:

{
  lib,
  stdenv,
  fetchFromGitHub,
  cmake,
  alsa-lib,
  glslang,
  libglvnd,
  vulkan-headers,
  vulkan-loader,
  xorg,
}:
stdenv.mkDerivation rec {
  pname = "opengothic";
  version = "master";

  src = fetchFromGitHub {
    owner = "Try";
    repo = "OpenGothic";
    rev = "794e575f006698900eaf826d17eb1c98061795ad";
    sha256 = "sha256-geyUc4LeiI9uqjy4YtNi0BTa76JqmcEtvy71GjdFTd0=";
    fetchSubmodules = true;
  };

  nativeBuildInputs = [
    cmake
  ];

  cmakeFlags = [
    "-DBUILD_SHARED_LIBS=ON"
    "-DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo"
    "-DCMAKE_SKIP_RPATH=OFF"
  ];

  buildInputs = [
    alsa-lib # cannot find audio device
    glslang
    libglvnd
    vulkan-headers
    vulkan-loader
    xorg.libX11
    xorg.libXcursor
  ];

  postInstall = ''
    mv opengothic/lib* $out/lib/
    mv $out/bin/Gothic2Notr $out/bin/opengothic
  '';

  meta = with lib; {
    description = "Reimplementation of Gothic 2 Notr";
    homepage = "https://github.com/Try/OpenGothic";
    changelog = "https://github.com/Try/OpenGothic/releases/tag/opengothic-v${version}";
    license = licenses.mit;
    platforms = platforms.all;
    maintainers = with maintainers; [mordrag];
  };
}

I believe this error probably occurs on my system due to how nix fundamentally works and as I am also using pipwire-alsa. Although for example aplay works fine. Is it possible to compile opengothic/tempest openal against pipewire or pulseaudio? I am not sure if that solves my problem but I think it may be worth a try. I only skimmed the cmake files and it seems that it should be possible, but I wanted to ask first before I investigate it any further.