Tony Tascioglu Wiki

TechnoTony Wiki - Tony Tascioglu's personal public knowledge-base!

User Tools

Site Tools


scripts:media:apply_eq_directly_in_pipewire

Apply Headphone EQ Directly In Pipewire

I have DT770m headphones that need EQ to be decent. I used to use easyeffects but it required a lot of extra load. Pipewire already has a native equalizer (or can use LV2/LADSPA plugins). So, it made sense to just do the EQ in pipewire.

Normally, you can add this directly to your output device. In my case I'm using a USB sound card (courtesy of David Yeh), which while it has ALSA plugins, doesn't do volume control the normal way, and has both 3.5mm and toslik out.

So, I use the 4 channel mode, with fronts to 3.5mm and rears to optical on the sound card. Meaning, I made two nodes like this to separate my headphone/speaker and reroute them to the front/rear channels.

This also lets me independently control volume on the 3.5mm and toslink (albeit digitally, which is fine at 16 bit for most cases).

context.modules = [
  {
    name = libpipewire-module-filter-chain
    args = {
      node.name = "EMU_Headphones"
      node.description = "E-Mu 0404 Headphones"
      media.name = "E-Mu 0404 Headphones"
      filter.graph = {
        nodes = [
          {
            type = builtin
            name = eq
            label = param_eq
            config = {
              filters = [
                { type = bq_highshelf, freq = 0, gain = -6.6, q = 1.0 }
                { type = bq_lowshelf, freq = 100, gain = 10.5, q = 1.0 }
                { type = bq_peaking, freq = 100, gain = -7.0, q = 0.4 }
                { type = bq_peaking, freq = 3500, gain = 4.5, q = 0.7 }
                { type = bq_peaking, freq = 2000, gain = -3.5, q = 1.4 }
                { type = bq_peaking, freq = 2800, gain = 1.3, q = 3.0 }
              ]
            }
          }
        ]
      }
      audio.channels = 2
      audio.position = [ FL FR ]
      capture.props = {
        node.linger = true
        media.class = Audio/Sink
        audio.channels = 2
        audio.position = [ FL FR ]
      }
      playback.props = {
        node.target = "alsa_output.usb-E-MU_Systems__Inc._E-MU_0404___USB_E-MU-70-3F04-07D60A1C-075A2-STN_2-00.analog-surround-40"
        node.linger = true
        stream.dont-remix = true
        audio.channels = 2
        audio.position = [ FL FR ]
        stream.channel-map = [ FL FR ]
      }
    }
  }
]
scripts/media/apply_eq_directly_in_pipewire.txt ยท Last modified: by Tony