Nevcairiel / LAVFilters

LAV Filters - Open-Source DirectShow Media Splitter and Decoders
GNU General Public License v2.0
7.23k stars 786 forks source link

LAV audio decoder maps surround channels of 5.1 audio to BL/BR (0x3f) instead of SL/SR (0x60f) #523

Closed adrianjw closed 1 year ago

adrianjw commented 1 year ago

I'm currently running a 7.1 setup. In version 0.77 and 0.77.1, when playing back content with 5.1 audio in DTS, DTS-HD MA, DDP E-AC3 format decoded to PCM (but not DD AC-3 or FLAC, these are fine), LAV audio decoder will map the surround channel to BL/BR (0x3f) instead of SL/SR (0x60f) (as if "use legacy 5.1 channel layout" is enabled by default with no way to disable it). I can actually hear sound coming out from my rear channels instead of my side channels. This problem does not exist in version 0.76.1 and earlier. I'm using MPC-HC v1.9.24 as the media player.

version 0.76.1 image

version 0.77.1 image

Similar problem to this: https://www.reddit.com/r/Windows10/comments/msdjvy/51_channel_pairs_are_changed/

More info: https://learn.microsoft.com/en-us/windows-hardware/drivers/audio/mapping-stream-formats-to-speaker-configurations

nwoltman commented 1 year ago

I'm seeing the same issue. It happens when converting formats like DTS-HD MA to PCM. Here's the Pin info if it helps at all:

LAV Audio Pin IN ``` - Connection media type: Audio: DTS 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_DTS_HD {A2E58EB7-0FA9-48BB-A40C-FA0E156D0645} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 256000 cbFormat: 18 WAVEFORMATEX: wFormatTag: 0x2001 nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 0 (extra bytes) ```
LAV Audio Pin OUT (0.76.1) ``` - Connection media type: Audio: PCM 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 12 cbFormat: 40 WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x0000060f SubFormat: {00000001-0000-0010-8000-00AA00389B71} - Enumerated media type 0: Set as the current media type - Enumerated media type 1: Set as the current media type - Enumerated media type 2: Audio: PCM 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 12 cbFormat: 40 WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x0000003f SubFormat: {00000001-0000-0010-8000-00AA00389B71} - Enumerated media type 3: Audio: PCM 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 12 cbFormat: 40 WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x0000003f SubFormat: {00000001-0000-0010-8000-00AA00389B71} ```
LAV Audio Pin OUT (0.77.1) ``` - Connection media type: Audio: PCM 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 12 cbFormat: 40 WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x0000003f SubFormat: {00000001-0000-0010-8000-00AA00389B71} - Enumerated media type 0: Audio: PCM 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 12 cbFormat: 40 WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x0000060f SubFormat: {00000001-0000-0010-8000-00AA00389B71} - Enumerated media type 1: Audio: PCM 48000Hz 5.1 chn 4608 kbit/s AM_MEDIA_TYPE: majortype: MEDIATYPE_Audio {73647561-0000-0010-8000-00AA00389B71} subtype: MEDIASUBTYPE_PCM {00000001-0000-0010-8000-00AA00389B71} formattype: FORMAT_WaveFormatEx {05589F81-C356-11CE-BF01-00AA0055595A} bFixedSizeSamples: 1 bTemporalCompression: 0 lSampleSize: 12 cbFormat: 40 WAVEFORMATEX: wFormatTag: 0xfffe nChannels: 6 nSamplesPerSec: 48000 nAvgBytesPerSec: 576000 nBlockAlign: 12 wBitsPerSample: 16 cbSize: 22 (extra bytes) WAVEFORMATEXTENSIBLE: wValidBitsPerSample: 16 dwChannelMask: 0x0000060f SubFormat: {00000001-0000-0010-8000-00AA00389B71} - Enumerated media type 2: Set as the current media type - Enumerated media type 3: Set as the current media type ```

ffprobe confirms the input source uses the side channels:

 Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s16p (default)
    Metadata:
      title           : DTS-HD MA 5.1
      BPS             : 2176686
      DURATION        : 00:42:21.963000000
      NUMBER_OF_FRAMES: 238309
      NUMBER_OF_BYTES : 691632168
      SOURCE_ID       : 001100
      _STATISTICS_WRITING_APP: mkvmerge v64.0.0 ('Willows') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-01-29 17:44:39
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID