Note: You are viewing an old version of this page. View the current version.

Differences between version 2 and previous revision of KnowledgeBase/AlsaEqual.

Other diffs: Previous Major Revision, Previous Author

Newer page: version 2 Last edited on Saturday, 15 September 2012 23:02:27 by CyberLeo Revert
Older page: version 1 Last edited on Saturday, 15 September 2012 22:58:05 by CyberLeo Revert
@@ -33,9 +33,9 @@
  slave.pcm asymed; 
 
 </code> 
  
-Use 'alsamixer -D equal' to change the equalizer settings 
+Use 'alsamixer -D equal' to change the equalizer settings; they will be saved and restored by the OS boot scripts just like any other soundcard volume setting.  
  
 And here's a way to switch presets: 
 <code brush="bash"> 
 #!/bin/sh 

version 2

Install media-plugins/alsaequal Configure thus:

/etc/asound.conf:

# Set default card and device; check /proc/asound/cards for the names to use in !card :
defaults.pcm.!card PCH
defaults.ctl.!card PCH
defaults.pcm.!device 0
defaults.ctl.!device 0

ctl.equal {
  type equal;
}

pcm.plugequal {
  type equal;
  # 32-bit programs will fail because they can't load 64-bit ladspa plugins; point to both in order:
  path "/usr/lib64/ladspa;/usr/lib32/ladspa";
  slave.pcm "plug:dmix";
}
pcm.equal {
  type plug;
  slave.pcm plugequal;
}
pcm.asymed {
  type asym;
  playback.pcm "plugequal";
  capture.pcm "dsnoop";
}
pcm.!default {
  type plug;
  slave.pcm asymed;
}

Use 'alsamixer -D equal' to change the equalizer settings; they will be saved and restored by the OS boot scripts just like any other soundcard volume setting.

And here's a way to switch presets:

#!/bin/sh

# Mine: "80 74 68 66 66 66 64 62 58 56"
# Flat: "65 65 65 65 65 65 65 65 65 65"

set_equalizer_curve() {
  curve="${*}"
  ctl=0
  for point in ${curve}
  do
    ctl=$(( ${ctl} + 1 ))
    echo cset numid=${ctl} ${point}
  done | amixer -D equal -s
}

profile="${1:-mine}"
case "${profile}" in
mine) curve="80 74 68 66 66 66 64 62 58 56" ;;
flat) curve="65 65 65 65 65 65 65 65 65 65" ;;
*) echo "Unknown profile ${profile}" >&2 ;;
esac

[ "${curve}" ] && set_equalizer_curve "${curve}"