Volume normalization

From MythTV Official Wiki
Revision as of 01:05, 31 July 2013 by Vossman (talk | contribs) (doc)

Jump to: navigation, search

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

Pulse Audio

This method will use the alsa LADSPA plugin 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.

meaning of settings

There are four setting for the dyson compress

  • Peak limit (in dB) – Controls the desired limit of the output signal in dB's. [Range -30 to 0]
  • Release time (in seconds) – Controls the time taken for the compressor to relax its gain control over the input signal [Range 0 to 1]
  • Fast compression ratio – [Range 0 to 1]
  • Compression ratio – [Range 0 to 1]

info taken from here

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