About this mod
A simple BepInEx plugin that restores Unity's basic support for 5.1, 7.1, and other multichannel audio configurations, enabling surround sound for Valheim.
- Requirements
- Permissions and credits
If you have any form of surround sound setup and are plagued by questions like "did that deer run ahead to the left, behind and to the left, or just straight left?" -- or if you just want to enjoy a slightly more immersive Valheim experience as the waves break behind you and the umpteenth Graydwarf rock misses you and hits your house, then this may help.
Requirements:
- An up-to-date (5.4+) BepInEx installation
- A 4.0/5.1/7.1/etc. audio configuration to receive any benefit
Setup: just drop AudioModeSwitcher.dll into your BepInEx/plugins folder. It should go right next to other plugins, including Valheim BepInEx's default Valheim.DisplayBepInExInfo.dll.
Configuration (optional): once it's been run once, in BepInEx/config/nyrin.mods.AudioModeSwitcher, you can enable/disable the mod along with more verbose debug output to the BepInEx log. You can also specify a precise audio output format in the event that auto-detection isn't selecting the desired configuration.
How it works: the mod is extremely simplistic -- it just queries Unity for the system's preferred audio output format and then reinitializes the audio settings to use that (or the override, if provided in the configuration) instead of the hard-coded 2.0 stereo setup.
Limitations: positional audio clearly hasn't been a focus for the Valheim team, so you may occasionally run into things that don't seem entirely right, especially for things up close between where your camera is and where you character is. It's not bad, though; it just may be noticeable.
- As one example of this, the bass is very heavy; the subwoofer channel doesn't seem to be particularly balanced and you may need to adjust your equalizer settings (or turn your woofer down a bit) to compensate.
Troubleshooting: try turning on the debug logs in the configuration mentioned above and see what the reported supported format is. You should observe log output like the following:
[Info : Unity Log] AudioModeSwitcher: [DEBUG] Starting speakerMode == Stereo (4 ms)
[Info : Unity Log] AudioModeSwitcher: [DEBUG] Reported capabilities == Mode5point1 (5 ms)
[Info : Unity Log] AudioModeSwitcher: [DEBUG] New audio setting == Mode5point1 (57 ms)
If Unity doesn't think your computer supports anything above stereo, double-check your OS configuration (like the surround sound configuration in Windows where you select your speaker layout). You can also try manually specifying an output format even if Unity doesn't claim it's preferred; your mileage may vary on whether that helps.