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

 

 

 

HOWTO systemwide eq with alsaequal

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Message
Author
Polaris96
Posts: 555
Joined: 2009-06-17 18:37

HOWTO systemwide eq with alsaequal

#1 Post by Polaris96 »

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/ALS ... _Equalizer
Last edited by Polaris96 on 2010-08-05 16:36, edited 2 times in total.

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

Re: HOWTO systemwide eq with alsaequal

#2 Post by scraze »

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! :}

Polaris96
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

#3 Post by Polaris96 »

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.

User avatar
mzilikazi
Forum Account
Forum Account
Posts: 3282
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: HOWTO systemwide eq with alsaequal

#4 Post by mzilikazi »

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

Polaris96
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

#5 Post by Polaris96 »

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.

Squier
Posts: 3
Joined: 2010-02-17 20:31

Re: HOWTO systemwide eq with alsaequal

#6 Post by Squier »

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

Polaris96
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

#7 Post by Polaris96 »

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.

User avatar
mzilikazi
Forum Account
Forum Account
Posts: 3282
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: HOWTO systemwide eq with alsaequal

#8 Post by mzilikazi »

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
El1iP3S01D
Posts: 210
Joined: 2008-04-03 06:49
Location: Bklyn, NY

Re: HOWTO systemwide eq with alsaequal

#9 Post by El1iP3S01D »

thank you for this EQ...i LOVE DEBIAN LINUX.....
By the way, Ryoko my Turtle and Saleen s7 TT rule my world...:-p

megu
Posts: 1
Joined: 2010-05-22 13:08

Re: HOWTO systemwide eq with alsaequal

#10 Post by megu »

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

User avatar
mzilikazi
Forum Account
Forum Account
Posts: 3282
Joined: 2004-09-16 02:14
Location: Colorado Springs, CO

Re: HOWTO systemwide eq with alsaequal

#11 Post by mzilikazi »

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

naitech
Posts: 1
Joined: 2010-07-31 15:21

Re: HOWTO systemwide eq with alsaequal

#12 Post by naitech »

Very Nice Instructions. You have to love debian. Thanks

ufowam
Posts: 1
Joined: 2010-10-27 01:01

Re: HOWTO systemwide eq with alsaequal

#13 Post by ufowam »

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

Polaris96
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

#14 Post by Polaris96 »

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.

g1annos
Posts: 122
Joined: 2008-12-01 02:15

Re: HOWTO systemwide eq with alsaequal

#15 Post by g1annos »

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?

Polaris96
Posts: 555
Joined: 2009-06-17 18:37

Re: HOWTO systemwide eq with alsaequal

#16 Post by Polaris96 »

you must have .asoundrc to make alsa equal work. .asoundrc tells alsa to use the equalizer. if it isn't there, Alsa won't know to stream through the equalizer. I'm really not sure why this would make skype fail to function. If time permits I'll look into it, but I don't use skype so I might not get to it (sorry)

You might consider some of the open source skype alternatives that are become available, btw.
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.

g1annos
Posts: 122
Joined: 2008-12-01 02:15

Re: HOWTO systemwide eq with alsaequal

#17 Post by g1annos »

you must have .asoundrc to make alsa equal work. .asoundrc tells alsa to use the equalizer. if it isn't there, Alsa won't know to stream through the equalizer.
You are right. I cannot read the code to understand why .asoundrc is necessary but I confirmed it experimentally.
I'm really not sure why this would make Skype fail to function.
Maybe that doesn't happen in 32bit version. Unfortunately Skype hasn't release yet a 64bit version for Debian, so I forced install the 64bit Ubuntu package. Then I installed the qt4 dependencies of 32bit sound libraries (ia32-libs ia32-libs-gtk libqt4-core libqt4-gui) and finally I deleted the 32bit pulse plugins (rm -f /usr/lib32/libpulse*) --> IF rm -f /usr/lib32/libpulse* isn't done Skype crashes.

Thus it is a lot complicated for me to understand which is the conflict of .asoundrc, after all that.
You might consider some of the open source skype alternatives that are become available, btw.
It would be the best. But are there any open source alternatives able to communicate with Skype?

Thanks a lot.

vortex636
Posts: 53
Joined: 2010-11-24 02:39

Re: HOWTO systemwide eq with alsaequal

#18 Post by vortex636 »

Hello!

This an awsome post, thank you so much for taking the time and effort to write it.
It worked perfectly for me, but for one simple problem: the .asounrdrc pcm configuration disabled my microphone.
While trying to reconfigure it, i got an error that dmix plugin does not support capture devices.
You wouldn't happen to know of a workaround for this would you?
So far I had to disable the asoundrc and alsaequal whenever I wanna skype...
Is there a way to add in asoundrc more than the pcm in order to use both alsaequal and the microphone?

Thanks!

g1annos
Posts: 122
Joined: 2008-12-01 02:15

Re: HOWTO systemwide eq with alsaequal

#19 Post by g1annos »

So far I had to disable the asoundrc and alsaequal whenever I wanna skype...
Is there a way to add in asoundrc more than the pcm in order to use both alsaequal and the microphone?
In my situation it totally mutes Skype. Not just the mic. Skype does not have sound at all.

I guess that you have 64bit version of Debian. Right? And you forced the Skype version.

I did exactly that, and then installed the 32bit libraries and qt4 dependencies, and then I removed (rm *) the 32bit libpulse plugins from lib32in order for Skype no to crash. I believe that there is where the problem is established and thus cannot have asoundrc with Skype working together.

vortex636
Posts: 53
Joined: 2010-11-24 02:39

Re: HOWTO systemwide eq with alsaequal

#20 Post by vortex636 »

Έστω και καθυστερημένα, ευχαριστώ Γιαννο ! :)

Post Reply