LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 03-23-2008, 04:01 PM   #1
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Rep: Reputation: 46
Talking =D I know how to equalize/tweak alsa system-wide; but few probs


"How to make ALSA use an equalizer...?" I asked myself. In short, the CAPS LADSPA plugins must be installed and the file ~/.asoundrc must be created with the content in the "code" block below (say, you can copy+paste). To tweak the frequecies, the numbers in the file where it says "control" have to be modified (use negative values for quiet bands, so the sound won't be trashed).

Here's the complete story (well, at least almost complete):
After googling and trying things like a maniac, I finally found out how to use LADSPA sound plugins for the entire sound output. On forums, this subject never is solved, so here is something hopefully to link to...
I installed the CAPS plugins via Debian repos, so they (the *.so files) are in /usr/lib/ladspa.
I created a file ~/.asoundrc which overrides ALSA options (most important of which is that the default playback device is "dmixed" with manual arguments):

(See below for example file)

For all users, this should be /etc/asound.conf.
The id 1773 means a specific LADSPA plugin from CAPS, an equalizer, and input->controls tweaks the frequencies. (I chose mainly minus values because it would clip too much otherwise). Period and buffer size are low so there is few lag. pcm.!default overrides the default dmix, so "dmixing" must be provided after passing the plugin.
And then I had a nice ALSA EQ! (newly started alsa-apps) Other LADSPA plugins can be processed like this either by ID or "label" (I didn't look up others, though).

8 bits per sample was not played, though, so please contribute if you know how to solve this! I'm sure this is becoming an interesting thread!

You might also want to study these docs:
* .asoundrc - http://www.alsa-project.org/main/index.php/Asoundrc
* alsa pcm plugins
* a working asoundrc (not tried out) - http://ubuntuforums.org/archive/index.php/t-510085.html

Forum threads where this is not (yet) solved:
* http://www.linuxforums.org/forum/lin...equalizer.html
* http://www.linuxforen.de/forums/archive/index.php/t-206238.html (German)
* http://bbs.archlinux.org/viewtopic.php?pid=191266
- ubuntuforums.org:
* http://ubuntuforums.org/showthread.p...ualizer&page=3
* http://ubuntuforums.org/showthread.p...ualizer&page=2

Last edited by TITiAN; 04-26-2009 at 08:37 AM. Reason: CAPS not SWH + short instruction
 
Old 04-05-2008, 09:58 AM   #2
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Original Poster
Rep: Reputation: 46
Update: Here's a file for ~/.asoundrc or /etc/asound.conf that enables recording and includes the declip plugin, as well as modifying the amplitude (=volume).
Also note again that the CAPS-plugins are needed.
Code:
pcm.eq {
        type ladspa
        slave.pcm       plug:dmix
        path "/usr/lib/ladspa"
        plugins [
                #{      #amp
                #       id 1068
                #       input { controls [1] }
                #}
                {       # EQ
                        id 1773
                        input {
                                controls [ 8 0 -1 -2 -12 -11 -10 -9 -8 -7 ]
                        }
                }
                {       # declip   
                        id 1195
                }
        ]
}
pcm.!default {
        type asym
        playback.pcm    plug:eq
        capture.pcm     plug:dsnoop
}
This kind of tweaking naturally is known and can be found in the web, but I just wanted to contribute an example and let others discuss this.

Last edited by TITiAN; 04-26-2009 at 08:35 AM. Reason: sorry, it's CAPS, not SWH
 
Old 04-26-2009, 06:53 AM   #3
Dukeman
LQ Newbie
 
Registered: Jul 2005
Location: Sweden
Distribution: Slackware 12.0
Posts: 3

Rep: Reputation: 0
Thank you, this was very helpful!

It seems that the SWH project no longer contains the 1773 (equalizer) plugin.
If you replace the id "1773" with "1197" in the above code block, everything works beautifully.
 
Old 04-26-2009, 08:33 AM   #4
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Original Poster
Rep: Reputation: 46
Sorry, the 10-band eq plugin with ID 1773 is from CAPS, not from SWH. I'm editing the posts right away.

This is a setup I recommend (explanation below):
Code:
pcm.!default {
    @func refer
    name { @func concat 
           strings [ "pcm."
                     { @func getenv
                       vars [ ALSA_PCM_DEFAULT ]
                       default "_default"
                     }
           ]
         }
}
pcm._default {
	type asym
	playback.pcm	plug:eq
	capture.pcm	plug:dsnoop
}
pcm.eq {
	type ladspa
	slave.pcm "plug:dmix"
	path "/usr/lib/ladspa"
	plugins [
		{  #  Amp
			id 1181
			input {
				controls [ -20 ]
			}
		}
		{  #  EQ
			id 1197
			input {
				controls [ 12 16.4 20 10 6 2 3 4 6 7.5 8.5 9 9 9 9 ]
			}
		}
		{  #  EQ (with 30Hz control)
			id 1773
			input {
				controls [ 16 0 2 6 0 4 1 1.5 1.5 1.5 ]
			}
		}
	]
}
pcm.noeq {
	type asym
	playback.pcm	noeq-out
	capture.pcm	plug:dsnoop
}
pcm.noeq-out {
	type route
	slave.pcm plug:dmix
	slave.channels 2
	ttable.0.0	0.5
	ttable.1.1	0.5
}
PROBLEM WITH 64-BIT SYSTEMS: 32-bit ALSA applications can't output sound that is tweaked by LADSPA plugins. But there is a way for those to output normal (or amplified) sound.

Now, as an example, wine and sauerbraten are 32-bit applications (except if you recompile sauerbraten). I run 'wine' like this:
Code:
ALSA_PCM_DEFAULT=noeq wine /some/win/app.exe
Setting the variable ALSA_PCM_DEFAULT to "noeq" instructs ALSA to use the virtual device "noeq" as the default output because the config file tells it to use the device defined by the variable; if the variable isn't set, the device "_default" will be used (this is what I use for 64-bit applications, say most of the software that I use). The "default" device plugs into equalized output and the usual input.
When the "noeq" device is used, I found that it should have half the volume. This is because I can't equalize the standart ouput without either making it more quiet (and turn my speakers louder ), or make the sound clip and have real bad sound. Of course, I chose to make the sound more quiet. But that means that unequalized sound (I do need it, see below why) would be relatively loud, which would be annoying. So I found a way to adapt its volume to the equalized sound ouput: You can do that by "routing" the sound (although I don't really "route" it, I just use the aplification option). Voilą, the "noeq-out" device makes unequalized sound fit into my concept.
Why unequalized sound? 32-bit applications can't load 64-bit libraries. But the LADSPA plugins on a 64-bit system (note again, this is for 64-bit systems) are 64-bit.

Last edited by TITiAN; 04-26-2009 at 09:12 AM.
 
Old 08-29-2009, 05:05 PM   #5
dynamics
LQ Newbie
 
Registered: Aug 2009
Location: Guildford
Distribution: Ubuntu Jaunty
Posts: 12

Rep: Reputation: 0
System wide equalizer

I was trying to find out how to set up the systemwide equalizer in Jaunty. If not atleast I want to set up a custom equalizer for vlc player.

I could set up the equalizer in my vlc player but the problem I am facing is I cannot name it or save it as 'mine' or whatever name I want as one can do it in xmms (save as 'mine' or 'mine1' and then load 'mine' or 'mine1' etc whenever I want)

Secondly whenever I open a song to play in vls it starts with default 'flat' equalizer configuration. Even if I set up my own equalizer settings it changes to default when the next track begins.

In one sentence what I want is how to make the vlc player equalizer work similar to 'xmms'

PS: Why I want to do it is the default settings of xmms frequency bands are not good as compared to vlc player equilizer frequency settings (or tone quality)

Thanks
 
Old 08-29-2009, 05:22 PM   #6
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Original Poster
Rep: Reputation: 46
I guess the approach with the file /etc/asound.conf isn't suitable for most end-users. I don't know about the problem in VLC as I rarely use its equalizer. But you could start another thread, with a title like "How do I save equalizer settings in VLC?", so people will see your question in the "Zero Reply Threads" list. That way you will get a helpful answer more likely. Also copy+paste can be useful so you don't have to write the whole post again .

Have fun
 
Old 11-01-2009, 06:35 AM   #7
41x
LQ Newbie
 
Registered: Jul 2008
Location: Sofia, Bulgaria
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
Not working for me :S
 
Old 11-01-2009, 08:05 AM   #8
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Original Poster
Rep: Reputation: 46
If it doesn't work, make sure the LADSPA plugins are installed (I think they're from the CAPS set). When you have, play a .wav sound file with "aplay" (from the commandline) and post the output. Then we'll see what's wrong (hopefully).
 
Old 11-03-2009, 12:06 PM   #9
41x
LQ Newbie
 
Registered: Jul 2008
Location: Sofia, Bulgaria
Distribution: Slackware
Posts: 5

Rep: Reputation: 0
Another way of doing that is with alsaequal *a guide can be found here* which can be used with the alsamixer gui (a graphical representation instead numbers) for adjusting the values.

1. fixed

Last edited by 41x; 11-08-2009 at 12:55 PM.
 
Old 11-05-2009, 09:53 AM   #10
TITiAN
Member
 
Registered: Mar 2008
Location: NRW, Germany
Distribution: Debian GNU/Linux with XFCE and packages from "testing"
Posts: 377

Original Poster
Rep: Reputation: 46
Your link is dead.
edit: looks interesting... (flying over old posts sometimes brings up interesting things)
damn, it looks even better than just a static eq in an .asoundrc file.

Last edited by TITiAN; 02-13-2011 at 07:06 AM.
 
  


Reply

Tags
alsa, effect, effects, ladspa, system


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
installing a program system wide Shautieh Linux - Software 3 01-18-2008 04:28 PM
How to modify the system-wide PATH jayhel Slackware - Installation 8 04-22-2005 04:00 AM
System Wide Permission lmanwarren Linux - General 1 03-29-2005 09:15 PM
Changing system-wide buttons rossjman1 Debian 1 03-22-2005 09:57 PM
*system-wide* KDE install, how? webvandals Linux - Software 5 03-06-2004 12:48 AM


All times are GMT -5. The time now is 12:57 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration