openalSolf, mpv: fix, enable HRTF support #63628
Merged
+21
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What? Why?
Fixing HRTF (see https://en.wikipedia.org/wiki/Head-related_transfer_function) functionality in
openalSolf
and then enabling it by defeault inmpv
is the simplest way I found to get proper sound output for media files with more than two channels of audio.For instance, say you want to properly hear all of the channels of a 5.1 movie while wearing stereo headphones. Applying this patchset makes it magically work in plain simple
mpv
without any hacking with ALSA mapping tables, PulseAudio, jackd, etc.As a nice bonus, using this also allows to map
mpv
sound output with a HRTF. The default HRTF that comes withopenalSolf
is not particularly awesome, but it works, and it can be easily configured via~/.alsoftrc
if desired.git log
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
withopenalSoft
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.mpv: enable openal support by default
See the previous commit.
nix-instantiate
environmentnix-env -qaP
diffs