Difference between revisions of "Volume normalization"

From MythTV Official Wiki
Jump to: navigation, search
m
m (See also)
Line 103: Line 103:
 
* [http://en.wikipedia.org/wiki/Dynamic_range_compression Wikipedia: Dynamic range compression]
 
* [http://en.wikipedia.org/wiki/Dynamic_range_compression Wikipedia: Dynamic range compression]
 
* [http://alsa.opensrc.org/Ladspa_(plugin) Ladspa (plugin) - ALSA wiki]
 
* [http://alsa.opensrc.org/Ladspa_(plugin) Ladspa (plugin) - ALSA wiki]
 +
* [https://github.com/opensrc/alsa/blob/master/Ladspa_%28plugin%29.md Ladspa (plugin)]

Revision as of 16:13, 29 July 2013

This page describes some methods to enable volume normalization on the fly, i.e., dynamic range compression.

Pulse Audio

This method with use the alsa LADSPA pulgin named dyson compress to compress the range of the audio.

configure pulse audio

first you need to determine the name of the output to normalize:

pacmd list-sinks | grep -A 1 index

my result:

    index: 0
	name: <alsa_output.pci-0000_01_05.1.hdmi-stereo>
--
  * index: 1
	name: <alsa_output.pci-0000_03_06.0.analog-stereo>

I am using the analog device (index 1)

Next you need to edit your default.pa file

sudo nano /etc/pulse/default.pa 

and add the following lines

### custom sink for DRC
.ifexists module-ladspa-sink.so
.nofail
load-module module-ladspa-sink sink_name=ladspa master=alsa_output.pci-0000_03_06.0.analog-stereo plugin=dyson_compress_1403 label=dysonCompress control=0,1,0.5,0.99
.fail
.endif

The last options on the control flag:

control=0,1,0.5,0.99

set the Peak limit (in dB), Release time, Fast compression ratio, and Compression ratio, respectively.

restart pulse audio

pulseaudio -k
pulseaudio -D

setup as default sink

pacmd list-sinks | grep -A 1 index

my result:

    index: 0
	name: <alsa_output.pci-0000_01_05.1.hdmi-stereo>
--
  * index: 1
	name: <alsa_output.pci-0000_03_06.0.analog-stereo>
--
    index: 2
	name: <ladspa>

edit file

sudo nano /etc/pulse/default.pa 
set-default-sink 2

restart pulse again, and the asterisk should have move to index 2, our ladspa filtered volume:

    index: 0
	name: <alsa_output.pci-0000_01_05.1.hdmi-stereo>
--
    index: 1
	name: <alsa_output.pci-0000_03_06.0.analog-stereo>
--
  * index: 2
	name: <ladspa>


See also