HOWTO systemwide eq with alsaequal

Share your own howto's etc. Not for support questions!

HOWTO systemwide eq with alsaequal

Postby Polaris96 » 2009-12-22 00:57

Recently, I found this little widget while answering a help question and it turned into a small bear hunting dependencies and compiling. It's a nice little app, though. It's very easy to set this up, now that the legwork is done (Many thanks to CraigEvil and TheGarage, both of whom helped out a lot when I was chasing dependencies and config syntax)

This is a PERFECT "first sourcebuild" for those of you who are thinking about trying out a source compiled program. This isn't a tutorial on compiling, though. I'm going to tell you how to get it done and set it up, but not WHY you do it, this way.


WHO WANTS THIS?

Anybody who wants a system wide, always on eq. Anybody who wants a player independent optional eq. Anybody who really likes CLI controlled applications.


WHO WILL NOT LIKE THIS?

People who who dislike working in the terminal. People who dislike spending time to load software. If you live in synaptic, this is probably not for you.


WHAT DO YOU NEED?

Lenny (or newer) and an internet connection. You probably COULD use Etch, but I'm not promising it. You must have alsa installed and also alsa-utils. I haven't included these in the dependency installation. The other stuff should pull it in even if you don't have it.


WHAT EXACTLY IS ALSAEQUAL?

Alsaequal is a plugin utility to control frequency attenuation (it's an equalizer :) ) of audio input streams via alsa. It uses the LADSPA utilities library for audio processing. It's basically CLI based (although there's an available GUI DE front end). It can be made to sit in between any audio stream and Alsa, allowing you to "equalize" anything from AV multimedia to system bells.

You can find out more at http://www.thedigitalmachine.net/alsaequal.html



HOW DO I SET IT ALL UP?

You should not see any error messages at any point in this process. If you do, stop and then post the errors here. I think this will be painless, though. One other note: I compile exclusively as root. There's some controversy over doing this. You'll be fine as long as you follow the directions.


First, fire up your terminal emulator and become root. Then, make sure you're in your home directory like this:

Code: Select all
    ~$su
    Password:blahblahblah
    ~#pwd
    /home/Polaris#



the 'pwd' prints the working directory. If you need to, you can 'cd' into your home directory.

Now paste this:

Code: Select all
  aptitude install build-essential caps libasound2-dev libasound2-plugins


That will handle your dependencies. (thanks again to craigevil). If nothing is installed, that's ok. It just means you've already got everything onboard.

Paste this:

Code: Select all
 wget http://www.thedigitalmachine.net/tools/alsaequal-0.6.tar.bz2


See how easy that was? Now you know how to grab stuff off the web from the commandline :)

Paste this:
Code: Select all
  tar -xjvvf alsaequal-0.6.tar.bz2


That will uncompress the BZip and extract the tarball (you gotta love these terms)

Then do this:

Code: Select all
    ~# cd alsaequal
    ~#make clean
    ~#make



There may be some garbage on the screen but you should NOT see the word "errors"

ok? good. do this:

Code: Select all
    ~#make install
    ~#make clean




You did it! Now you have alsaequal. We need to do one last thing to get it working. First, become a normal user
Code: Select all
~#exit
~$pwd
/home/polaris$

Again, the 'pwd' just tells me which directory I'm in. If you're not in your $HOME directory (polaris, for me) you need to 'cd' into it. BTW thanks to mzilikazi for pointing out that taking this step as root results in an .asoundrc file owned BY root. That does us no good at all. Make sure you're not root before proceeding.

Code: Select all
    ~$nano .asoundrc


This will open a blank screen. Paste the following code into it (you can push down on the mouse scroll wheel to paste a selection into nano or use the EDIT/PASTE menu from your terminal emulator (not nano))

Code: Select all
  ctl.equal {
      type equal;
    }

    pcm.plugequal {
      type equal;
      # Modify the line below if you don't
      # want to use sound card 0.
      slave.pcm "plug:dmix";
    }

    # pcm.equal {
      # Or if you want the equalizer to be your
      # default soundcard uncomment the following
      # line and comment the above line.
    pcm.!default {
      type plug;
      slave.pcm plugequal;
    }



Then use [ctrl]-O to save it (you will notice an output path at the bottom of the nano screen when you press [ctrl]-O you need to hit [return] at that point) and then [ctrl]-X to exit nano

NOTE: you may wonder why you don't see the file listed when you type 'ls'. This is because all files that start with '.' are normally invisible. These files hold configuration information for various user customizable utilities like X, gnome, and, in our case, alsa. To see the hidden files in any directory, you must type 'ls -a'

One last thing:
Code: Select all
  ~#alsa force-reload




That's it! you're good to go. You now have a small system wide eq! bueno. to access the eq settings, you open a tedrminal window and type
Code: Select all
   ~$alsamixer -D equal


When you want to shut the alsamixer utility, double-tap [esc]

Hope this helps.


WHERE CAN I FIND OUT MORE?

http://sidux.com/PNphpBB2-viewtopic-t-11512.html

http://wiki.archlinux.org/index.php/ALSA#System-Wide_Equalizer
Last edited by Polaris96 on 2010-08-05 16:36, edited 2 times in total.
Polaris96
 
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

Postby scraze » 2009-12-25 14:23

Nice! I hope this will soon hit the Debian repositories. Who knows how often I've resumed and postponed the search for a systemwide equaliser..

By the way, the author mentions that this is actually a generic realtime LADSPA plugin controller for ALSA, and there is a great possibility that the other LADPSA plugins will work as well. Totally kick-ass .. gotta try that out when time is abundant.

Thanks! :}
User avatar
scraze
 
Posts: 85
Joined: 2008-05-14 21:47
Location: Utrecht, the Netherlands

Re: HOWTO systemwide eq with alsaequal

Postby Polaris96 » 2009-12-26 15:55

Actually, combing through the LADSPA utilities, in general, leads me to believe that WRITING an eq utility in ladspa is pretty simple. Not about to give a tutorial, but I see no reason why any of the LADSPA utilities would fail in debian.
for as long as the world remains. for as long as time remains. so, too, will I remain. To serve. To help. And to make my contribution. Also, never forget our family at debianuserforums.org If we can't solve your problem, they probably can.
Polaris96
 
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

Postby mzilikazi » 2010-01-09 16:26

Very cool tip. Worked straight away. :) I did notice that you are creating .asoundrc as root
Code: Select all
~#nano .asoundrc

which I think was not your intention.

Also. checkinstall (instead of make install) works rather nicely if you didn't want to be bothered with making a proper Debian package.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: HOWTO systemwide eq with alsaequal

Postby Polaris96 » 2010-01-10 03:36

VERY good point irt ownership of .asoundrc. Looking at my notes, I DID create .asoundrc in my user directory as root. Then, I did this:
Code: Select all
~#chown polaris96:polaris96 .asoundrc


If anybody following my original directions has permission problems reading .asoundrc, use the command above, replacing "polaris96" with your user name. Apologies to all. As we become set in our ways, we often forget personal quirks of methodology. Problem is, this is EXACTLY the kind of thing that will piss off a "cookbooker" when trying to make the app work. My bad :)

So far as "check install" goes, I don't really know anything about it. I started compiling code a long time ago in system v UNIX. Check Install probably is much better, but I'm aware of the headaches associated with "old fashioned" compiling and I'm staying with it. Newer people SHOULD take mzilikazi's advice.

This is small enough that you might even consider building it as a deb package. That would be REALLY slick and it's not too hard. There's a very good tutorial in theis forum's "how to" section. I'll get the link sometime soon and post it here.
for as long as the world remains. for as long as time remains. so, too, will I remain. To serve. To help. And to make my contribution. Also, never forget our family at debianuserforums.org If we can't solve your problem, they probably can.
Polaris96
 
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

Postby Squier » 2010-02-23 20:48

1) When i try execute:
Code: Select all
$ alsamixer -D equal

I get the follow error:
Code: Select all
~$ alsamixer -D equal

alsamixer: function snd_ctl_open failed for equal: Operation not permitted

But, when i execute then with sudo, the command is executed without error. It`s normal?

2) Somebody knows how to configure mpd with alsaequal? I tried to enter device "plug:plugequal" in mpd.conf, but mpd writes an error: Error: problems opening audio device
Squier
 
Posts: 3
Joined: 2010-02-17 20:31

Re: HOWTO systemwide eq with alsaequal

Postby Polaris96 » 2010-03-05 13:15

make sure your user account has the "audio" group. Whenever something executes in root but not in user space, it's a permission issue for sure. First do this:
Code: Select all
~/$ groups


If you don't see the word "audio", become root (or use sudo, if you like) and do this:
Code: Select all
~/# usermod  -aG audio [your-username]
~/# alsa reload
for as long as the world remains. for as long as time remains. so, too, will I remain. To serve. To help. And to make my contribution. Also, never forget our family at debianuserforums.org If we can't solve your problem, they probably can.
Polaris96
 
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

Postby mzilikazi » 2010-03-12 02:49

New version is out. This was done with checkinstall
Code: Select all
$ apt-cache policy alsaequal
alsaequal:
  Installed: 0.6-1
  Candidate: 0.6-1
  Version table:
 *** 0.6-1 0
        100 /var/lib/dpkg/status

If you didn't build a proper .deb you can run make uninstall from the 0.4 source dir.

BTW I just noticed this. You can switch from mixer to equalizer while in alsamixer.

F6>Sound Card>enter device name...>equal>enter

And of course you can also switch back to the mixer the same way.
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: HOWTO systemwide eq with alsaequal

Postby El1iP3S01D » 2010-04-26 21:01

thank you for this EQ...i LOVE DEBIAN LINUX.....
By the way, Ryoko my Turtle and Saleen s7 TT rule my world...:-p
User avatar
El1iP3S01D
 
Posts: 210
Joined: 2008-04-03 06:49
Location: Bklyn, NY

Re: HOWTO systemwide eq with alsaequal

Postby megu » 2010-05-22 13:14

A big thank you for this post!
Works like a charm.

You should maybe update the wget in your initial post to point to the current version 0.6:
http://www.thedigitalmachine.net/tools/ ... .6.tar.bz2
megu
 
Posts: 1
Joined: 2010-05-22 13:08

Re: HOWTO systemwide eq with alsaequal

Postby mzilikazi » 2010-05-22 14:06

To use mbeq:
Code: Select all
apt-get install swh-plugins

This .asoundrc works for me:

more .asoundrc
Code: Select all
ctl.equal {
  type equal;
  library "/usr/lib/ladspa/mbeq_1197.so";
  module "mbeq";
}

pcm.plugequal {
  type equal;
  slave.pcm "plughw:0,0";
  library "/usr/lib/ladspa/mbeq_1197.so";
  module "mbeq";
}

pcm.equal {
#pcm.!default {
   type plug;
   slave.pcm plugequal;
}

Image
Debian Sid Laptops:
AMD Athlon(tm) 64 X2 Dual-Core Processor TK-55 / 1.5G
Intel(R) Pentium(R) Dual CPU T2390 @ 1.86GHz / 3G
User avatar
mzilikazi
Forum Ninja
 
Posts: 3321
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: HOWTO systemwide eq with alsaequal

Postby naitech » 2010-07-31 15:25

Very Nice Instructions. You have to love debian. Thanks
naitech
 
Posts: 1
Joined: 2010-07-31 15:21

Re: HOWTO systemwide eq with alsaequal

Postby ufowam » 2010-10-27 01:04

I just registered to thank you for this great post. I installed it on my ubuntu after deleting that crappy pulseaudio and right now I'm like... rediscovering my music ^^

Thank you again mister :D
ufowam
 
Posts: 1
Joined: 2010-10-27 01:01

Re: HOWTO systemwide eq with alsaequal

Postby Polaris96 » 2010-11-04 20:01

Welcome aboard!

Pulseaudio is a pretty decent system, but, like so many of the available apps in the LINUX world, many of its features consist of "reiventing the wheel"

Like you, I tried and then ditched pulseaudio. I do wish more people were working in ALSA, though. It's great software, and we should reach its full potential before we throw it away.
for as long as the world remains. for as long as time remains. so, too, will I remain. To serve. To help. And to make my contribution. Also, never forget our family at debianuserforums.org If we can't solve your problem, they probably can.
Polaris96
 
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

Postby g1annos » 2010-12-03 12:11

Is .asoundrc file necessary for alsaequal to work? I mean... can I ignore this step?

I'm asking because I realized that the presence of this file makes Skype to malfunction. If that file exists I have NO SOUND in Skype. When I delete this file, sound comes back to Skype again.

So is this step necessary?
g1annos
 
Posts: 109
Joined: 2008-12-01 02:15

Next

Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable