On Sun, 12 Jan 2025 20:16:12 +0100
Jan Stary <h...@stare.cz> wrote:

> These are some example files from Dolby:
> https://ott.dolby.com/OnDelKits/DDP/Dolby_Digital_Plus_Online_Delivery_Kit_v1.4.1/Test_Signals/muxed_streams/MPEG2TS/MPEG2TS_Muxed_Streams.html
> 
> Thesr contain 5.1 audio. Playing it on my stereo gear
> (I only have two ears anyway), I would expect the players
> (mplayer, ffplay, mpv, vlc) to do the reasonable thing:
> figure out the "right" position in the stereo panorama
> and play it "there".
> 
> But it seems only mplayer does that - for example,
> all the other players play the "center" channel on the left.
> 
> If anyone cares about this, can you plese confirm/report what
> the various players do with this on your stereo hardware?

I had picked up Godzilla (2014) on DVD a couple months ago and -- while
watching it in mpv under OpenBSD amd64/7.5-stable -- noticed that all
the dialog audio is fully on the left channel. I investigated
headphones, speakers, sndio, and my own ears, but wasn't invested
enough to dig deeper once I had watched it in full. I never even got
around to testing any other DVDs. (Lazy? Busy?)

Your query inspired me. There are plenty of discussions of mixing down
from 5.1 & 7.1 to stereo in ffmpeg, mpv, etc. The following is a fairly
detailed summary & analysis of solutions:

<https://superuser.com/a/1410620>

In short, for ffmpeg, passing `-ac 2` will force it to mix down to
stereo. Many of the solutions in the aforementioned link discuss
alternative audio filters to mix the individual channels in different
weights/volumes/mixes for enhanced center channel audio.

My testing with mpv showed that using the `--audio-channels=stereo`
configuration option correctly mixes down to stereo with dialog
correctly mixed across both left & right channels. 

mpv(1) includes the following:

> --audio-channels=auto-safe
>
>   Use the system's preferred channel layout. If
>   there is none (such as when accessing a hardware device
>   instead of the system mixer), force stereo. Some audio
>   outputs might simply accept any layout and do downmixing
>   on their own.
>
>   This is the default.

Further review of sndiod(8):

> -j flag
>
>   Control whether program channels are joined or expanded if
>   the number of channels requested by a program is not equal to the
>   device number of channels.  If the flag is off then client
>   channels are routed to the corresponding device channel,
>   possibly discarding channels not present in the device.  If the
>   flag is on, then a single client channel may be sent on multiple
>   device channels, or multiple client channels may be sent to a
>   single device channel.  For instance, this feature could be used
>   for mono to stereo conversions.  The default is on

I don't override the '-j' option for sndiod(8) on my workstation. If my
understanding is correct, that means that sndiod(8) will allow a client
client (mpv(1), in my case) to send more channels than my device (Intel
9 Series HD Audio; stereo) can process. Most likely, extra channels
are probably being discarded. But, forcing to mix down to stereo (`mpv
--audio-channels=stereo`, `ffmpeg -ac 2`, etc.) does the correct mixdown
(at least according to the ATSC specification) before sending to
sndiod(8) and the stereo audio device.

I haven't yet tested adding `-j off` to my sndiod(8) flags, but have
updated my mpv scripts. Thanks for your question!

Morgan Aldridge

Reply via email to