# Dolby Pro Logic II encoder sink
#
# Copy this file into a conf.d/ directory such as
# ~/.config/pipewire/filter-chain.conf.d/
#
{
  "context.modules": [
    {
      "name": "libpipewire-module-filter-chain",
      "flags": [
        "nofail"
      ],
      "args": {
        "node.description": "Dolby Pro Logic II Sink",
        "media.name": "Dolby Pro Logic II Sink",
        "filter.graph": {
          "nodes": [
            {
              "type": "builtin",
              "name": "fc_copy",
              "label": "copy"
            },
            {
              "type": "builtin",
              "name": "lfe_copy",
              "label": "copy"
            },
            {
              "type": "builtin",
              "name": "sl_phased",
              "label": "convolver",
              "config": {
                "filename": "/hilbert",
                "length": 90
              }
            },
            {
              "type": "builtin",
              "name": "sr_phased",
              "label": "convolver",
              "config": {
                "filename": "/hilbert",
                "length": 90
              }
            },
            {
              "type": "builtin",
              "name": "mixer_lt",
              "label": "mixer",
              "control": {
                "Gain 1": 1,
                "Gain 2": 0,
                "Gain 3": 0.7071067811865475,
                "Gain 4": 0.7071067811865475,
                "Gain 5": -0.8660254037844386,
                "Gain 6": -0.5
              }
            },
            {
              "type": "builtin",
              "name": "mixer_rt",
              "label": "mixer",
              "control": {
                "Gain 1": 0,
                "Gain 2": 1,
                "Gain 3": 0.7071067811865475,
                "Gain 4": 0.7071067811865475,
                "Gain 5": 0.5,
                "Gain 6": 0.8660254037844386
              }
            }
          ],
          "links": [
            {
              "output": "fc_copy:Out",
              "input": "mixer_lt:In 3"
            },
            {
              "output": "fc_copy:Out",
              "input": "mixer_rt:In 3"
            },
            {
              "output": "lfe_copy:Out",
              "input": "mixer_lt:In 4"
            },
            {
              "output": "lfe_copy:Out",
              "input": "mixer_rt:In 4"
            },
            {
              "output": "sl_phased:Out",
              "input": "mixer_lt:In 5"
            },
            {
              "output": "sl_phased:Out",
              "input": "mixer_rt:In 5"
            },
            {
              "output": "sr_phased:Out",
              "input": "mixer_lt:In 6"
            },
            {
              "output": "sr_phased:Out",
              "input": "mixer_rt:In 6"
            }
          ],
          "inputs": [
            "mixer_lt:In 1",
            "mixer_rt:In 2",
            "fc_copy:In",
            "lfe_copy:In",
            "sl_phased:In",
            "sr_phased:In"
          ],
          "outputs": [
            "mixer_lt:Out",
            "mixer_rt:Out"
          ]
        },
        "capture.props": {
          "node.name": "effect_input.dolby_pro_logic_ii",
          "media.class": "Audio/Sink",
          "audio.channels": 6,
          "audio.position": [
            "FL",
            "FR",
            "FC",
            "LFE",
            "SL",
            "SR"
          ]
        },
        "playback.props": {
          "node.name": "effect_output.dolby_pro_logic_ii",
          "node.passive": true,
          "audio.channels": 2,
          "audio.position": [
            "FL",
            "FR"
          ]
        }
      }
    }
  ]
}
