Results 1 to 10 of 385

Thread: PulseAudio Equalizer Script

Threaded View

  1. #1
    Join Date
    Nov 2005
    Location
    Ireland
    Beans
    2,605
    Distro
    Ubuntu Development Release

    Post PulseAudio Equalizer Script



    Note 1: This package provides an equalizer interface for the LADSPA sound processing functionality of PulseAudio. If you wish to test or discuss an alternate PulseAudio equalizer implementation which does not rely on LADSPA processing, please see phish3's thread here.

    Note 2: This script requires PulseAudio 0.9.19 or later to function properly, which has the following implications:
    • Jaunty users: your version of PulseAudio is outdated - you must upgrade. I recommend Luke Yelavich's PPA.
    • Karmic users: you do not need to upgrade PulseAudio. If you are already using the 0.9.20 packages from the semi-official Ubuntu Audio Dev PPA, the equalizer will continue working.
    • Lucid (testing) users: you have the latest version of PulseAudio - no further action is necessary.

    Note 3: This script assumes that your PulseAudio setup is functioning properly. In other words: if your audio is not working, neither will this script.


    Hey folks,

    I'm releasing GUI and script for PulseAudio users that will set up system-wide equalized audio, without needing to restart PulseAudio or any running applications.

    Enjoy!

    Advantages:
    • Configurable 15 band equalizer for PulseAudio;
    • You can enable or disable equalized audio on-the-fly, without having to restart any running applications;
    • Offers the choice of using equalized audio for the current session or permanently;
    • No need to edit any configuration files by hand;
    • User-customizable: you can use any LADSPA audio processing plugin (which can apply various audio effects beyond equalization);
    • Packaged as a .deb file for easy installation;
    • Graphical User Interface.


    Installation:
    Since v2.6, the pulseaudio-equalizer package is available from my PPA, which you can access like so:
    Code:
    $ sudo software-properties-gtk --enable-ppa=psyke83/ppa; sudo apt-get update; sudo apt-get install pulseaudio-equalizer
    Source code:
    The source is available on Launchpad.

    Usage:
    Open the PulseAudio Equalizer (Applications -> Sound & Video). The interface should be fairly self-explanatory:

    • 15 frequency bands you can adjust to your liking;
    • Preamp will boost your equalized volume (as a multiplier value from 1x to 4x);
    • Presets are included (based on VLC's built-in equalizer), or you can choose to save own favourite configuration as a new preset;
    • EQ Enabled will enable the equalizer in the current session (which applies to all running applications);
    • Keep Settings will configure your PulseAudio configuration to remain permanently equalized (and therefore, you won't need to run the PulseAudio Equalizer interface each time you login);
    • Advanced menu options so that you can reset all settings (useful for troubleshooting) or delete user presets;
    • Apply Settings will apply all changes.


    TECHNICAL: How does the equalizer work?
    The script uses a LADSPA audio processing plugin, specifically the Multiband EQ/mbeq_1197 plugin from the swh-plugins package.

    If you examine the pulseaudio-equalizer.sh script, you will see the following lines near the beginning:

    Code:
    # Default LADSPA plugin & control settings; control settings will be overridden if $HOME/.equalizerrc file exists.
    PA_LADSPA_PLUGIN="mbeq_1197"
    PA_LADSPA_LABEL="mbeq"
    PA_LADSPA_CONTROL="-1,-1,-1,-1,-5,-10,-18,-15,-10,-5,-5,-5,-5,0,0"
    What do these variables mean?
    • "mbeq_1197" refers to the LADSPA plugin file (located in /usr/lib/ladspa/);
    • "mbeq" refers to the internal label used by the LADSPA plugin (some plugin files can have multiple labels embedded inside);
    • the comma separated numbers refers to the actual equalization settings (detailed below).


    You can use the "analyseplugin" utility from the "ladspa-sdk" package in order to see the detailed information on a particular LADSPA plugin. Here's the information for the plugin used by the script:

    Code:
    conn@inspiron:~$ analyseplugin mbeq_1197
    
    Plugin Name: "Multiband EQ"
    Plugin Label: "mbeq"
    Plugin Unique ID: 1197
    Maker: "Steve Harris <steve@plugin.org.uk>"
    Copyright: "GPL"
    Must Run Real-Time: No
    Has activate() Function: Yes
    Has deativate() Function: No
    Has run_adding() Function: Yes
    Environment: Normal or Hard Real-Time
    Ports:	"50Hz gain (low shelving)" input, control, -70 to 30, default 0
    	"100Hz gain" input, control, -70 to 30, default 0
    	"156Hz gain" input, control, -70 to 30, default 0
    	"220Hz gain" input, control, -70 to 30, default 0
    	"311Hz gain" input, control, -70 to 30, default 0
    	"440Hz gain" input, control, -70 to 30, default 0
    	"622Hz gain" input, control, -70 to 30, default 0
    	"880Hz gain" input, control, -70 to 30, default 0
    	"1250Hz gain" input, control, -70 to 30, default 0
    	"1750Hz gain" input, control, -70 to 30, default 0
    	"2500Hz gain" input, control, -70 to 30, default 0
    	"3500Hz gain" input, control, -70 to 30, default 0
    	"5000Hz gain" input, control, -70 to 30, default 0
    	"10000Hz gain" input, control, -70 to 30, default 0
    	"20000Hz gain" input, control, -70 to 30, default 0
    	"Input" input, audio
    	"Output" output, audio
    	"latency" output, control
    As you can see from the text in blue, the mbeq_1197 plugin allows you to equalize 15 different bands. If you wish to customize the plugin or control settings, you can manually edit a preset and enter the appropriate LADSPA information (future versions will support different plugins easily via the interface). If you want to see the plugins available (for all audio processing effects, not merely equalization), use the "listplugins" and "analyseplugin <plugin_name>" utilities for guidance.

    I have provided a "Laptop" preset which I have customized to improve the "tinny" audio from the internal speaker of my laptop (a Dell Inspiron 510m). While the settings may not be optimal for your setup, you may also find it useful for your own hardware.

    If you have any problems, questions or suggestions to improve the script, please let me know.

    Changelog:
    v1.0 - 24/10/2009 - Initial version.
    v1.1 - 25/10/2009 - Improved status checking; transition entire script to pacmd.
    v1.2 - 25/10/2009 - Improved script indenting; added toggle option.
    v1.3 - 25/10/2009 - Improved volume handling (existing levels are always maintained when toggling equalizer).
    v1.4 - 25/10/2009 - Improved mute handling (existing mute setting is always maintained when toggling equalizer); renamed sink to match LADSPA plugin.
    v1.5 - 02/11/2009 - Improved sink handling (user-defined sink will always be used/restored when equalizer is enabled/disabled); better status equalizer detection; better detection of running clients to transfer to equalized audio.
    v1.6 - 04/11/2009 - Added options "always-on" and "always-off" to permanently store equalizer settings; added support for custom control settings (if $HOME/.equalizerrc file is present).
    v1.7 - 04/11/2009 - Renamed options; options "enable-config" and "disable-config" will edit, backup & restore user configuration ($HOME/.pulse/default.pa) when possible; better status checking.
    v1.8 - 04/11-2009 - Avoid duplicate module-ladspa-sink modules getting loaded; added undocumented options "write-equalizerrc" and "delete-equalizerrc" for interfaces.
    v1.9 - 08/11/2009 - Now includes PyGtk interface; packaged as a .deb file; interface supports presets (but few meaningful presets are yet included). Requires testing.
    v2.0 - 08/11/2009 - Added VLC's equalizers; better support for loading user presets.
    v2.1 - 10/11/2009 - Added "debug" option to script; added swh-plugins, ladspa-sdk to depends; "Keep Settings" or selecting a preset will take effect immediately.
    v2.2 - 14/11/2009 - Major re-write of PyGTK interface; now supports pre-amp, saving/deleting presets; fixed rare bug which caused "Keep Settings" to mute audio on restart.
    v2.3 - 17/11/2009 - Better formatting of scale values on interface; ensure that preset list always remains sorted; script will automatically create user preset folder; confirmed Lucid Lynx compatibility.
    v2.4 - 19/11/2009 - Preamp range now 1x to 2x, default is 1.5x and increments are now allowed; added Flat preset; selecting a preset will now apply settings immediately; improved script to make enabling EQ slightly faster; preamp setting is no longer controlled by presets; added application icon.
    v2.5 - 04/02/2010 - Preamp range now between 0x and 2x, defaulting to 1x; improved script compatibility with new PulseAudio/Lucid Lynx version; misc bugfixes to prevent hangs on moving streams; optimized script to improve initialization speed and prevent loud pops when applying new settings; Fedora guideline compliance.
    v2.6 - 05/02/2010 - Small configuration detection fix - first version in PPA.
    v2.7 - 05/02/2010 - Small packaging fix.
    Attached Images Attached Images
    Last edited by psyke83; February 5th, 2010 at 10:38 AM.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •