You are not logged in.

#26 2010-11-26 11:46:51

AudioCoder
Member
Registered: 2010-11-26
Posts: 5

Re: Global Equalizer?

A problem with the instructions at:

https://wiki.archlinux.org/index.php/Ad … Using_mbeq

is that the ladspa plugin is added/run before the software mixer. This means that if you have x applications playing back sound at the same time you will x times the resources the ladspa plugin requires. In most cases this is a very stupid way of doing things. What you typically want to do is to equalize your speakers/headphones and this should be done after the audio streams have been mixed to one (stereo/surround) stream.

Does anyone know how to insert the ladspa module after the software mixer?

Offline

#27 2010-11-26 13:31:57

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Global Equalizer?

See thread.

Look at pcm.dmixed - I suppose you would put the equalizer between the dmix and the output to "type hw".

Offline

#28 2010-11-26 14:12:16

AudioCoder
Member
Registered: 2010-11-26
Posts: 5

Re: Global Equalizer?

Hi,
Thank you for your answer brebs.

I tried this:

pcm.eq {
  type ladspa
  slave.pcm "hw:0,0"
  path "/usr/lib/ladspa"
  plugins [
    {
      label Test
      id 5000
      input {
        controls [ 1 -1 12 -5 400 0 200 0 1 ]
      }
    }
  ]
}

#Redirect the output from the mixer to go through the ladspa plugin
pcm.dmix2 {
    type asym
    playback.pcm {
        type dmix
        ipc_key 567829
        slave {
            pcm "eq"
            channels 2
        }
    }
}

# Redirect the default device to go via the EQ
pcm.!default {
  type plug
  slave.pcm "dmix2"
}

# Redirect the OSS emulation through the EQ too (when programs are running through "aoss")
pcm.dsp0 {
  type plug
  slave.pcm "dmix2"
}

Unfortunately it seems not be allowed to use the output from the mixer. Running speaker-test i get this output:
ALSA lib pcm_dmix.c:1015:(snd_pcm_dmix_open) dmix plugin can be only connected to hw plugin

I really hope this is not true - or at least there is a work-around.

Last edited by AudioCoder (2010-11-26 14:13:57)

Offline

#29 2010-11-26 14:26:14

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: Global Equalizer?

Is it possible to apply it per-channel?

My subwoofer obviously is not good at high frequencies but there is no way of omitting them with my amplifier...


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#30 2010-11-26 14:30:37

Fackamato
Member
Registered: 2006-03-31
Posts: 579

Re: Global Equalizer?

Cdh wrote:

Is it possible to apply it per-channel?

My subwoofer obviously is not good at high frequencies but there is no way of omitting them with my amplifier...

Wtf, you don't have a lowpass filter somewhere in the chain to the sub?

Offline

#31 2010-11-26 14:31:40

AudioCoder
Member
Registered: 2010-11-26
Posts: 5

Offline

#32 2010-11-27 05:20:14

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Global Equalizer?

AudioCoder, yeah, in my playings I get that annoying error too:

ALSA lib pcm_dmix.c:1023:(snd_pcm_dmix_open) dmix plugin can be only connected to hw plugin

I found a scrap of info that this limitation is "for simplicity reasons".

I suppose that dmix must be last in the chain.

Last edited by brebs (2010-11-27 05:21:08)

Offline

#33 2010-11-27 09:49:30

sausageandeggs
Member
Registered: 2009-12-05
Posts: 66

Re: Global Equalizer?

Really easy solution, using pulse & LADSPA, + has a GUI

http://aur.archlinux.org/packages.php?ID=34859

Last edited by sausageandeggs (2010-11-27 09:49:50)

Offline

#34 2010-11-27 12:19:33

Cdh
Member
Registered: 2009-02-03
Posts: 1,098

Re: Global Equalizer?

Fackamato wrote:

Wtf, you don't have a lowpass filter somewhere in the chain to the sub?

Actually I have not a "chain" but only a very cheap "amplifier". But it does the job pretty well.

@AudioCoder
Thank you.
edit: Can't make it really work...
This is what I have so far:

~ % cat .asoundrc
# ALSA library configuration file

# Include settings that are under the control of asoundconf(1).
# (To disable these settings, comment out this line.)
#</home/chris/.asoundrc.asoundconf>

pcm.!default upmix_20to51

pcm.upmix_20to51 {
    type plug
    slave.pcm lowpass_21to21
    slave.channels 3
    ttable {
        0.0     1       # left channel
        1.1     1       # right channel
        0.2     0.5     # mix left and right ...
        1.2     0.5     # ... channel for subwoofer
    }
}

pcm.lowpass_21to21 {
    type ladspa
    slave.pcm "upmix_21to51"
    path "/usr/lib/ladspa"
    channels 3
    plugins {
    0 {
        id 1890
        policy duplicate
        input.bindings.0 "Input"
        output.bindings.0 "Output"
        input {
            controls [ 250 2 ]
        }
    }
        1 {
            id 1672 # 4 Pole Low-Pass Filter with Resonance (FCRCIA) (1672/lp4pole_fcrcia_oa)
            policy none
            input.bindings.2 "Input";
            output.bindings.2 "Output";
            input {
        # This should cut off at 120 Hz ???
        # http://www.halfgaar.net/surround-sound-in-linux
        # http://www.dolby.com/assets/pdf/tech_library/38_LFE.pdf
                controls [ 300 2 ]
            }
        }
    }
}

pcm.upmix_21to51 {
    type plug
    slave.pcm dmixer
    slave.channels 6
    ttable {
        0.0     1       # front left
        1.1     1       # front right
        0.2     1       # rear left
        1.3     1       # rear right
        0.4     0.5     # center
        1.4     0.5     # center
        2.5     1       # subwoofer
    }
}

pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 4096
        rate 44100
        channels 6
    }
    bindings {
        0 0
        1 1
        2 2
        3 3
        4 4
        5 5
    }
}

mplayer can only seek one time, seeking the second time gives:

MPlayer interrupted by signal 11 in module: seek_audio_reset
ID_SIGNAL=11

Cutting some frequencies off kindof works but it are certainly not the right ones... The subwoofer doesn't output high frequencies anymore but no deep frequences either...

Last edited by Cdh (2010-11-27 12:56:29)


฿ 18PRsqbZCrwPUrVnJe1BZvza7bwSDbpxZz

Offline

#35 2010-11-29 08:02:47

AudioCoder
Member
Registered: 2010-11-26
Posts: 5

Re: Global Equalizer?

Cdh:
I am sorry, I have never tried that ladspa plugin. You could try playing with it in for instance audacity to see what happens, if you can't find enough information about the filter.

Offline

#36 2010-11-29 08:12:16

AudioCoder
Member
Registered: 2010-11-26
Posts: 5

Re: Global Equalizer?

brebs:
Thank you for helping me investigate this. It seems like there is not much to do about it. Maybe I will give the alsa mailing list a try (or i could look into the source code) because the scrap is from 2007 but it doesn't seem like this "feature" has changed.

Offline

#37 2012-02-17 00:57:15

deliank
Member
Registered: 2012-02-17
Posts: 1

Re: Global Equalizer?

I've recently described it: http://krustev.net/w/articles/Global_eq … _for_ALSA/

quarkup has also given you a pointer to the answer in arch wiki which you must have missed.

Offline

Board footer

Powered by FluxBB