Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

low pass high pass global filter for alsa

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
urhaxable
Posts: 2
Joined: 2017-02-11 21:44

low pass high pass global filter for alsa

#1 Post by urhaxable »

I have been wanting a system wide EQ basically to remove low frequencies from fronts, center, rears and remove high frequencies from the subwoofers. i have been unable to find a system wide EQ that can control frequencies of each channel. So I gave up on that as I don't think it exists. So I found that with ALSA you can edit .asounrc and create filters and controls. So I figured I'd go this route. I have come up with an .asoundrc that I think should , but doesn't. I've looked at many examples, read manpages, docs, etc. everything I could find. Here is my file, can anyone help me figure out why it does not work. If possible also create a stereo to 5.1 upmix pcm for when listening to music. But for now I'd just love to get the 5.1 filtered properly. Thanks.

Code: Select all

#~/.asoundrc
# Bandpass plug
# this will tie everything together.
pcm.bandpass222 {
    type plug
    slave.pcm "highpass"
    hint {
        show on
        description "My Bandpass Filter"
    } 
}
# high pass filter
# remove freqs below 60hz from fronts, center, and rears
# remove freqs below 5hz from subwoofers 
pcm.highpass {
    type ladspa
    slave.pcm "lowpass";
    path "/usr/lib/ladspa";
    channels 6
    plugins {
        0 {
            label hpf
        policy none
        input.bindings.0 "Input";
        output.bindings.0 "Output";
        input {
            controls [60]
            }
        }
        1 {
        label hpf
        policy none
        input.bindings.1 "Input";
        output.bindings.1 "Output";
        input {
            controls [60]
            }
        }
        2 {
        label hpf
        policy none
        input.bindings.2 "Input";
        output.bindings.2 "Output";
        input {
            controls [60]
            }
        }
        3 {
        label hpf
        policy none
        input.bindings.3 "Input";
        output.bindings.3 "Output";
        input {
            controls [60]
            }
        }
        4 {
        label hpf
        policy none
        input.bindings.4 "Input";
        output.bindings.4 "Output";
        input {
            controls [60]
            }
        }
        5 {
        label hpf
        policy none
        input.bindings.5 "Input";
        output.bindings.5 "Output";
        input {
            controls [5]
            }
        }
    }
}
# Low pass filter
# removes freq above the higher range
# of human hearing (20,000 Hz)
# removes any freq above 300hz from the subwoofers
pcm.lowpass {
    type ladspa
    slave.pcm "hw:0,0";
    path "/usr/lib/ladspa";
    channels 6
    plugins {
        0 {
        label lpf
        policy none
        input.bindings.0 "Input";
        output.bindings.0 "Output";
        input {
            controls [20000]
            }
        }
        1 {
        label lpf
        policy none
        input.bindings.1 "Input";
        output.bindings.1 "Output";
        input {
            controls [20000]
            }
        }
        2 {
        label lpf
        policy none
        input.bindings.2 "Input";
        output.bindings.2 "Output";
        input {
            controls [20000]
            }
        }
        3 {
        label lpf
        policy none
        input.bindings.3 "Input";
        output.bindings.3 "Output";
        input {
            controls [20000]
            }
        }
        4 {
        label lpf
        policy none
        input.bindings.4 "Input";
        output.bindings.4 "Output";
        input {
        controls [20000]
            }
        }
        5 {
        label lpf
        policy none
        input.bindings.5 "Input";
        output.bindings.5 "Output";
        input {
            controls [300]
            }
        }
    }
}

urhaxable
Posts: 2
Joined: 2017-02-11 21:44

Re: low pass high pass global filter for alsa

#2 Post by urhaxable »

Ok, seems like I have the bandpass high and low working properly now, but I only have front left and front right working, i rewrote my .asoundrc from scratch and tried a few different pcm but still get just stereo. Here is my current .asoundrc with high/low bandpass working with stereo even when playing 5.1 movie:

Code: Select all

pcm.bandpass51 {
    type plug
    slave.pcm "pluglphp"
}

pcm.pluglphp {
    type ladspa
    #slave.pcm "plughw:0,0" #works with stereo
    #slave.pcm "surround51" #doesnt work at all
    slave.pcm "orig51" #works with stereo
    path "/usr/lib/ladspa"
    channels 6
    plugins {
        0 {
            label lpf
            id 1041
            policy none
            input.bindings.0 "Input";
            output.bindings.0 "Output";
            input {
                controls [ 20000 ]
            }
        }
        1 {
            label lpf
            id 1041
            policy none
            input.bindings.1 "Input";
            output.bindings.1 "Output";
            input {
                controls [ 20000 ]
            }
        }
        2 {
            label lpf
            id 1041
            policy none
            input.bindings.2 "Input";
            output.bindings.2 "Output";
            input {
                controls [ 20000 ]
            }
        }
        3 {
            label lpf
            id 1041
            policy none
            input.bindings.3 "Input";
            output.bindings.3 "Output";
            input {
                controls [ 20000 ]
            }
        }
        4 {
            label lpf
            id 1041
            policy none
            input.bindings.4 "Input";
            output.bindings.4 "Output";
            input {
                controls [ 20000 ]
            }
        }
        5 {
            label lpf
            id 1041
            policy none
            input.bindings.5 "Input";
            output.bindings.5 "Output";
            input {
                controls [ 300 ]
            }
        }
        6 {
            label hpf
            id 1042
            policy none
            input.bindings.0 "Input";
            output.bindings.0 "Output";
            input {
                controls [ 60 ]
            }
        }
        7 {
            label hpf
            id 1042
            policy none
            input.bindings.1 "Input";
            output.bindings.1 "Output";
            input {
                controls [ 60 ]
            }
        }
        8 {
            label hpf
            id 1042
            policy none
            input.bindings.2 "Input";
            output.bindings.2 "Output";
            input {
                controls [ 60 ]
            }
        }
        9 {
            label hpf
            id 1042
            policy none
            input.bindings.3 "Input";
            output.bindings.3 "Output";
            input {
                controls [ 60 ]
            }
        }
        10 {
            label hpf
            id 1042
            policy none
            input.bindings.4 "Input";
            output.bindings.4 "Output";
            input {
                controls [ 60 ]
            }
        }
        11 {
            label hpf
            id 1042
            policy none
            input.bindings.5 "Input";
            output.bindings.5 "Output";
            input {
                controls [ 5 ]
            }
        }
    }
}
pcm.orig51 {
    type plug
    slave.pcm surround51 #still gives stereo
    slave.channels 6
}
If I remove he orig51 and the uncomment the plughw and comment the orig slave I still get same results, if i call surround51 as slave within the pluglphp I get no sound, so I had to call surround51 separate using orig51. Anyone see what I'm doing wrong that I'm not getting 5.1 audio using this config?

I'm using this for testing:

Code: Select all

mplayer -ao alsa:device=bandpass51 /home/brandon/Linux-Data/Videos/Test/Dolby-Atmos-Demonstration-2014-1080p-AVC-TrueHD-7.1/BDMV/STREAM/00020.m2ts -aid 2

Post Reply