talwat / lowfi

An extremely simple lofi player.
MIT License
517 stars 22 forks source link

Shared object "libasound.so.2" not found #45

Open pfr-dev opened 1 week ago

pfr-dev commented 1 week ago

Would love to see support for pipewire``pulseaudio and portaudio just to name a few.

talwat commented 1 week ago

lowfi does support pipewire & pulseaudio? It uses an external crate called rodio which relies on the ALSA API that is supported by lots of different audio backends via pulseaudio-alsa for instance. Supporting the native API of other backends is firstly not within lowfi's control and secondly just pretty unnecessary.

I'm closing this issue as invalid, but if your audio just isn't working then feel free to reopen it.

talwat commented 1 week ago

From portaudio's own website:

It lets you write simple audio programs in 'C' or C++ that will compile and run on many platforms including Windows, Macintosh OS X, and Unix (OSS/ALSA)

So yeah, really not sure what this issue is about.

pfr-dev commented 1 week ago

Ok, my fault, I should have been clearer with the actual issue.

The build fails on both VoidLinux (where I have pipewire configured) and on NetBSD (Portaudio).

[...]
error: failed to run custom build command for `alsa-sys v0.3.1`

Caused by:
  process didn't exit successfully: `/tmp/cargo-installFOLnsz/release/build/alsa-sys-1faf8fa56a1d5f78/build-script-build` (exit status: 101)
  --- stdout
  cargo:rerun-if-env-changed=ALSA_NO_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG
  cargo:rerun-if-env-changed=PKG_CONFIG
  cargo:rerun-if-env-changed=ALSA_STATIC
  cargo:rerun-if-env-changed=ALSA_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_STATIC
  cargo:rerun-if-env-changed=PKG_CONFIG_ALL_DYNAMIC
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_PATH
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_LIBDIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64-unknown-netbsd
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR_x86_64_unknown_netbsd
  cargo:rerun-if-env-changed=HOST_PKG_CONFIG_SYSROOT_DIR
  cargo:rerun-if-env-changed=PKG_CONFIG_SYSROOT_DIR

  --- stderr
  thread 'main' panicked at /home/dave/.cargo/registry/src/index.crates.io-6f17d22bba15001f/alsa-sys-0.3.1/build.rs:13:18:

  pkg-config exited with status code 1
  > PKG_CONFIG_ALLOW_SYSTEM_LIBS=1 PKG_CONFIG_ALLOW_SYSTEM_CFLAGS=1 pkg-config --libs --cflags alsa

  The system library `alsa` required by crate `alsa-sys` was not found.
  The file `alsa.pc` needs to be installed and the PKG_CONFIG_PATH environment variable must contain its parent directory.
  The PKG_CONFIG_PATH environment variable is not set.

  HINT: if you have installed the library, try setting PKG_CONFIG_PATH to the directory containing `alsa.pc`.

  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error: failed to compile `lowfi v1.5.3`, intermediate artifacts can be found at `/tmp/cargo-installFOLnsz`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

I suppose I'd like to be able to use this without needing to install alsa

However, I tested after installing alsa-plugins-pulse and alsa-lib on NetBSD and the cargo build succeeds but the resulting binary complains with:

~ λ lowfi
lowfi: Shared object "libasound.so.2" not found

So, again, I apologise for the lazy first post, but perhaps we can reopen this issue and give it a new name?

talwat commented 1 week ago

Ah I see now. Could you try installing pulseaudio-alsa instead of alsa-plugins-pulse? I'm not sure if they're entirely the same on BSD however.

talwat commented 1 week ago

It might also be a BSD issue unfortunately, the sound crate I'm using doesn't support BSD's.