Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: ef9f91f3cf14
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4d680f3f3d58
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 29, 2019

  1. openalSolf: make it search its own $out for data files

    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.
    oxij authored and Profpatsch committed Oct 29, 2019
    Copy the full SHA
    31cf1ff View commit details
  2. mpv: enable openal support by default

    See the previous commit.
    oxij authored and Profpatsch committed Oct 29, 2019
    Copy the full SHA
    4d680f3 View commit details
Showing with 21 additions and 1 deletion.
  1. +1 −1 pkgs/applications/video/mpv/default.nix
  2. +8 −0 pkgs/development/libraries/openal-soft/default.nix
  3. +12 −0 pkgs/development/libraries/openal-soft/search-out.patch
2 changes: 1 addition & 1 deletion pkgs/applications/video/mpv/default.nix
Original file line number Diff line number Diff line change
@@ -52,7 +52,7 @@
, zimgSupport ? true, zimg ? null
, archiveSupport ? false, libarchive ? null
, jackaudioSupport ? false, libjack2 ? null
, openalSupport ? false, openalSoft ? null
, openalSupport ? true, openalSoft ? null
, vapoursynthSupport ? false, vapoursynth ? null
}:

8 changes: 8 additions & 0 deletions pkgs/development/libraries/openal-soft/default.nix
Original file line number Diff line number Diff line change
@@ -20,6 +20,14 @@ stdenv.mkDerivation rec {
sha256 = "0b0g0q1c36nfb289xcaaj3cmyfpiswvvgky3qyalsf9n4dj7vnzi";
};

# this will make it find its own data files (e.g. HRTF profiles)
# without any other configuration
patches = [ ./search-out.patch ];
postPatch = ''
substituteInPlace Alc/helpers.c \
--replace "@OUT@" $out
'';

nativeBuildInputs = [ cmake ];

buildInputs = []
12 changes: 12 additions & 0 deletions pkgs/development/libraries/openal-soft/search-out.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff -Nuar a/Alc/helpers.c b/Alc/helpers.c
--- a/Alc/helpers.c 1970-01-01 00:00:01.000000000 +0000
+++ b/Alc/helpers.c 1970-01-01 00:00:02.000000000 +0000
@@ -951,6 +951,8 @@
}
}

+ DirectorySearch("@OUT@/share", ext, &results);
+
alstr_reset(&path);
}