raysan5 / raylib

A simple and easy-to-use library to enjoy videogames programming
http://www.raylib.com
zlib License
22.95k stars 2.29k forks source link

[raudio] No sound #4533

Closed exformation closed 5 hours ago

exformation commented 5 days ago

Issue: Device initializes successfully, no errors building/running, and the examples show that the song is progressing, but there is no audio.

Potential Solution: I have a hunch raudio is using the wrong device? I've had this issue with some games, where I would hear no audio unless I changed to PipeWire Sound Server:
image

I don't see any options for interacting with the audio devices on the cheatsheet, so not sure how to experiment with that. I'm guessing I'd have to dig into miniaudio?

exformation commented 5 days ago

Never mind. I switched back to PulseAudio and still have the issue, so it isn't a PipeWire thing. Raylib audio just doesn't show up anywhere in my system as a sound output, while other programs do.

exformation commented 3 days ago

I've confirmed that:

All other programs and audio libraries I've tried work fine, but I still feel like my computer might just be cursed in some way. I'm not really sure how to investigate this more. Tempted to just re-image ...

Peter0x44 commented 10 hours ago

Are you using Nix OS?

exformation commented 8 hours ago

Are you using Nix OS?

Yep, on NixOS and Wayland. Sorry should've mentioned. There are build instructions for NixOS in the docs so I figured it'd work okay.

exformation commented 5 hours ago

YES. Mentioning that made me take another look at my nix shell and compare it to one I used for bevy. I needed this:

LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;

Here is my full flake.nix for naylib for anyone referencing this later:

{
  inputs.nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";
  outputs = { self, nixpkgs }:
    with nixpkgs.legacyPackages.x86_64-linux.pkgs; {
      devShells.x86_64-linux.default = mkShell rec {
        buildInputs = [
          nim
          nimlangserver
          nimble
          alsa-lib
          # if building for wayland
          wayland
          libxkbcommon
        ] ++ raylib.buildInputs;
        LD_LIBRARY_PATH = lib.makeLibraryPath buildInputs;
      };
    };
}