it is a issue openal-soft's FindOSS.cmake https://github.com/kcat/openal-soft/blob/master/cmake/FindOSS.cmake
trofi> Looking at the build failure (if I remove libc from buildInputs) I think the problem here is that it tries to pull in build's headers, not host's headers:
trofi> These unexpected headers are injected from OSS headers: openal-soft-aarch64-unknown-linux-gnu> -- Found OSS: /nix/store/xy6ngc2gxqcypczxbahrqz31xr97m6gg-glibc-2.35-163-dev/include.
trofi> The header path detection comes from cmake/FindOSS.cmake:
trofi> Apparently glibc headers do provide sys/soundcard.h and confuse cmake.
see nixpkgs issue: https://github.com/NixOS/nixpkgs/issues/183774
Without those data files HRTF will silently fail to initialize.
It searches /usr and /usr/local by default but we don't have those paths.
It also searches XDG_DATA_DIRS but using that requires configuration by the
user. This patch makes makes it just work.
How to play with it:
- Build `mpv` with `openalSoft` support.
- cat << EOF > ~/.alsoftrc
[general]
hrtf = true
EOF
- Wear stereo headphones.
- Play a file with 6 or more channels with `mpv -ao openal $file`, e.g.
https://archive.org/download/5.1SurroundSoundTestFilesVariousFormatsAACAC3MP4DTSWAV/5.1%20Surround%20Sound%20AAC%20Test.mp4
- Try `hrtf = false` to hear the difference.
* Added PulseAudio backend support.
* Made ALSA and PulseAudio backends optional.
* Made ALSA and PulseAudio backends actually work by adding to
NIX_LDFLAGS (because package uses dlopen).
TEST: Tested all 3 backends (OSS, ALSA, PulseAudio) using openal-info
and my upcoming Warzone 2100 update, by selecting the backend in
.alsoftrc. It also works without .alsoftrc (I think it first tries pulse
then alsa then oss).