Bug 78879

Summary: Decode matrix-encoded surround to discrete channel upmix
Product: PulseAudio Reporter: Que Quotion <quequotion>
Component: miscAssignee: pulseaudio-bugs
Status: RESOLVED MOVED QA Contact: pulseaudio-bugs
Severity: enhancement    
Priority: medium CC: lennart
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Que Quotion 2014-05-19 06:10:34 UTC
This is a feature request.

Dolby Surround (the old, analog stereo matrix-encoded surround codec, not Dolby Digital) encoded audio ouptut could be greatly improved by a plugin that could detected the matrix encoding, upmixed and output the stream discrete channels for systems that support output to four or more channels.

LabDV has a description of the technology (and audio samples):
http://www.labdv.com/guide/audio/dolby_surround-en.html

There is debate about whether Dolby Surround encoded three or four channels. It encoded four, but not discretely, and the Center channel (a simple blend of Left & Right) seems to be the one not everyone counts.

As it is, if a user has an entirely analog setup, with an analog stereo output and a Dolby Surround (ProLogic I/II) receiver, then analog stereo matrix-encoded surround may already be working (so long as the encoding isn't resampled out by pulseaudio, the receiver should be able to decode it). 

However, recently more users have digital setups with either HDMI or iec958 output to digital receivers.

I have such a setup and I've enabled the a52 plugin for AC3 digital 5.1 surround output, which creates a virtual device with five discrete channels. With this setup Dolby Digital, DTS, or discrete channel audio streams are mapped as is and stereo signals are stretched around the 5.1 channels.

If pulseaudio is configured for 5.1 (digital) output (a52 plugin, etc), the analog stereo matrix-encoding seems to be lost. The stereo signal is stretched around the 5.1 speakers, resulting in an artificial surround effect where the rear channels do not sound independently of the front

If pulseaudio is configured for stereo (digital) output, and the receiver is set to decode Dolby Surround (ProLogic (II)), it may be working but the quality of surround seems actually less than stretching the stereo signal around 5.1 speakers.

I haven't been able audibly to distinguish that the surround, center, or LFE channels are in use independently of the front in either case.

What I have in mind is this:

something streams a stereo signal to pulseaudio ->
an (alsa?) plugin detects analog stereo matrix encoding - >
the plugin upmixes the signal into discrete channels ->
Surround channel encoded audio is sent to Side and Rear speakers (as available),
Center channel encoded audio is sent to Center,
Left channel encoded audio is sent to Front Left speaker,
Right channel encoded audio is sent to Front Right speaker.
For ProLogic II, LFE channel encoded audio is sent to LFE.

Much like the a52 plugin, this one may face patent restrictions.
Steve Harris's GPL "Surround Matrix Encoder" LADSPA plugin implements most of the codec without violating Dolby's intellectual property:
http://plugin.org.uk/ladspa-swh/docs/ladspa-swh.html#tth_sEc2.102
Comment 1 Que Quotion 2014-05-19 06:13:16 UTC
**Dolby Surround (the old, analog stereo matrix-encoded surround codec, not Dolby Digital) encoded audio ouptut could be greatly improved by a plugin that could detect the matrix encoding, upmix and output the stream as discrete channels for systems that support output to four or more channels.**

**fixed some typos left by numerous edits....
Comment 2 GitLab Migration User 2018-07-30 10:21:28 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/372.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.