Initial release of pautosurround: automatic multichannel audio from PulseAudio and PipeWire

published Jan 11, 2022, last modified Jan 15, 2022

It's a pain to manually switch sound profiles when watching movies or listening to music. Let's fix that.

Initial release of pautosurround: automatic multichannel audio from PulseAudio and PipeWire

Heads up!  Two newsworthy items since initial publishing of this post — as of January 2022, the development version of PulseAudio has gained this feature independently, while this program has gained the ability to do the same in modern Linux setups with PipeWire.  

Many people have been, through fortune or hard work, blessed with the opportunity to have a home cinema.

Quite a few of those people run an HTPC with Linux (and PulseAudio / PipeWire) on it.  This HTPC tends to be connected — through either HDMI or a multichannel sound card — to an advanced receiver or home theater system, with support for multichannel audio (5.1, 7.1 or more).

If you are fortunate enough to find yourself in this scenario, PulseAudio is fantastic for you, as is PipeWire.  Through the PulseAudio volume control, it lets you select whether you want your audio to be stereo, or 5.1, or 7.1.  When listening to tunes, you select stereo, and enjoy your home theater's intelligent upmixing of sound.  When watching movies, you select 5.1 or 7.1, and the receiver gets the full multichannel signal from your favorite media player.

As long as you remember to switch to the appropriate profile, you should be good.  But, if you don't, well, things don't sound very well:

  • If you play stereo music in multichannel mode, the receiver thinks it's getting multichannel sound, and so it can't intelligently upmix or do Dolby Pro Logic.
  • If you play movies in stereo mode, the receiver doesn't get all the channels — you might miss the center channel, the surround sounds will be faked, and you'll get no subwoofer / LFE signal either.

Come to think of it, that's a bit of a bother.  Shouldn't the profile be automatic?  After all, the media player already knows it's either playing stereo sound or multichannel sound.  You already know the computer is connected to a multichannel receiver.  Why can't the computer know to select the appropriate output mode?

Well, now it canI have released pautosurround — a utility that fixes the issue for you.  With it installed, the computer autoselects 5.1 when multichannel content is played, and reverts back to its previously-selected profile once it's done.  This is something that not even Windows has.

Go enjoy it!