# Host config for the Omarchy speaker tuning.
#
# This exists so the tuning gets its own PipeWire client rather than sharing
# PipeWire's stock filter-chain.conf. That config merges every fragment in
# ~/.config/pipewire/filter-chain.conf.d/, so hosting the tuning there would load
# any unrelated filter a user keeps in that directory -- duplicating filters
# already hosted elsewhere, and stopping them all when the tuning is switched off.
#
# Installed as ~/.config/pipewire/omarchy-speaker-tuning.conf with the tuning
# graph merged from omarchy-speaker-tuning.conf.d/, and run with
#   pipewire -c omarchy-speaker-tuning.conf
#
# The contents are the minimum a filter-hosting client needs, taken from
# /usr/share/pipewire/filter-chain.conf.

context.properties = {
    log.level = 0
}

context.spa-libs = {
    audio.convert.* = audioconvert/libspa-audioconvert
    support.*       = support/libspa-support
}

context.modules = [
    # Boost the audio thread priority.
    { name = libpipewire-module-rt
        args = { }
        flags = [ ifexists nofail ]
    }

    # The native communication protocol.
    { name = libpipewire-module-protocol-native }

    # Lets this process provide nodes to PipeWire.
    { name = libpipewire-module-client-node }

    # Wraps nodes in an adapter with a converter and resampler.
    { name = libpipewire-module-adapter }
]
