Matthew Rosewarne on 9 Nov 2008 23:25:15 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] Software "Pre-Amp" hack


Unlike my previous machines, my Thinkpad T61 doesn't have a hardware volume 
control.  Since most media isn't normalised, the built-in speakers often 
struggle to be heard over environmental noise.  Eventually I got fed up with 
this and found out how to get around it with some magic in /etc/asound.conf 
(system-wide) or ~/.asoundrc (per-user):

	pcm.!default {
		type			plug
		slave.pcm		"softvol"
	}
	
	pcm.softvol {
		type			softvol
		slave {
			pcm			"dmix"
		}
		control {
			name		"Pre-Amp"
			card		0
		}
		min_dB			-5.0
		max_dB			20.0
		resolution	6
	}

I now have a "Pre-Amp" control that goes from line level to +20 dB in 
increments of 5 dB.  Unfortunately min_dB must be set below zero, but oddly 
enough setting the control to the lowest position seems to force it to mute.  
The final result is:
┌─────┐
│ 100 │		+20 dB
│  80 │		+15 dB
│  60 │		+10 dB
│  40 │		+5  dB
│  20 │		Line Level (No Amp.)
│  00 │		Mute
└─────┘

Now when I play something soft I can temporarily pump up the volume much 
higher than the software mixer would otherwise allow, then lower it afterwards 
to not distort loud or normalised audio.

Hope someone else finds this useful!

Attachment: signature.asc
Description: This is a digitally signed message part.

___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug