LinHES Forums
http://forums.linhes.org/

volume leveling
http://forums.linhes.org/viewtopic.php?f=17&t=18346
Page 1 of 4

Author:  footeo [ Mon May 26, 2008 7:50 pm ]
Post subject:  volume leveling

Does anyone know of a way to automatically normalize or level the volume of played back video or audio files in myth. I would rather not have to re-transcode the files but, apply some sort of filter or limiter on the volume top and bottom. I find myself constantly adjusting the volume level of some movies as well as some of my audio files. Any help would be greatly appreciated.

Author:  tscholl [ Tue May 27, 2008 9:36 am ]
Post subject: 

Sorry I don't know how to do it, but I did request the same feature be included in R6.

Author:  footeo [ Tue May 27, 2008 10:59 am ]
Post subject: 

How about it? Will this be in the next release?

Author:  tjc [ Tue May 27, 2008 6:36 pm ]
Post subject: 

No. Cecil is all out of orange smoke for the moment.

Author:  bigB [ Tue May 27, 2008 8:59 pm ]
Post subject: 

What is needed is an Audio Filter feature to be added to mythtv. Once that is added, an Automatic Gain Control algorithm could be put into the audio processing loop of mythtv. Similar to the DSP plugins of winamp. This type of feature might make it into the mythtv source as there is minimal work to be done by the developers. Similar to the playback filters already in there.

What you are asking is not that hard, its just where to put it.

Author:  mjl [ Tue May 27, 2008 9:08 pm ]
Post subject: 

Hi,
I have also thought of the "normalizer" as a feature. xmms has a vol-norm plugin also. Too bad there isn't an easy way to pipe the stream through it on the way to the output.

I find the cd's and streams are not all at a normal range.

Mike

Author:  pelrun [ Tue May 27, 2008 11:16 pm ]
Post subject: 

According to the following, you can do it in your ALSA configuration, rather than in mythtv:

http://alsa.opensrc.org/index.php/Ladspa_%28plugin%29

Author:  bigB [ Tue May 27, 2008 11:22 pm ]
Post subject: 

Interesting,

If your nice, I might explore this :-)

Author:  footeo [ Wed May 28, 2008 2:38 pm ]
Post subject: 

pelrun wrote:
According to the following, you can do it in your ALSA configuration, rather than in mythtv:

http://alsa.opensrc.org/index.php/Ladspa_%28plugin%29


Thanks for this I have it working for videos now.

I created a /etc/asound.conf like this (as per the wiki):
Code:
 pcm.ladcomp {
      type plug
      slave.pcm "ladcomp_compressor";
  }
 pcm.ladcomp_compressor {
      type ladspa
      slave.pcm "ladcomp_limiter";
      path "/usr/lib/ladspa";
      plugins [
          {
              label dysonCompress
              input {
                  #peak limit, release time, fast ratio, ratio
                  controls [0 1 0.5 0.99]
              }
          }
      ]
  }
 pcm.ladcomp_limiter {
      type ladspa
      slave.pcm "plughw:0,0";
      path "/usr/lib/ladspa";
      plugins [
          {
              label fastLookaheadLimiter
              input {
               #InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
               controls [ 20 0 0.8  ]
              }
          }
     ]
  }


I installed the ladspa sdk to see what plugins were installed and ended up needing to install the fastLookaheadLimiter plugin:
Code:
aptitude install ladspa-sdk
aptitude install swh-plugins


I changed the default player in video settings to (I use the mplayer-resumer to start out where I left off):
Code:
player-resumer.pl -fs -zoom -ao alsa:device=ladcomp %s


It seems to work great it seems to level off the volume quite nicely. Now if I can figure out how to get myth's internal player to use it to do recordings, DVDs, and live tv. I am guessing that would be a lot trickier.

p.s. sorry if this is a little hard to follow.

Author:  cecil [ Wed May 28, 2008 2:48 pm ]
Post subject: 

I'd think all you have to do is configure MythTV to use alsa:device=ladcomp. It is in the settings someplace, sorry not in front of my system at the moment.

Author:  footeo [ Wed May 28, 2008 3:10 pm ]
Post subject: 

Ok, I have got it to sort of work with the recordings as well. I changed the audio output device under general settings to: ALSA:ladcomp but the volume controls in myth will no longer control the volume. I have also tried changing the mixer to ALSA:ladcomp but volume is still not controllable. If I change the device and mixer to ALSA:default the volume controls will work again but, I would assume it is not using ladcomp. If anyone who knows move about these setting knows what would need to be changed that would be great as I am just sort of winging it.

Author:  footeo [ Wed May 28, 2008 6:34 pm ]
Post subject: 

ok I believe I have it working now. I don't know how It wasn't working before but, I guess this is the one thing I didn't try.

settings are:
Audio output device: ALSA:ladcomp
Mixer Device: ALSA:default

This seems to work. Although it is sort of a hard thing to test. The question I have is does this affect the settings in video or are the mplayer settings that I did above separate?

Author:  cecil [ Wed May 28, 2008 6:35 pm ]
Post subject: 

Settings in MythTV will only affect MythTV's internal player. Nice work!

Author:  bigB [ Wed May 28, 2008 7:10 pm ]
Post subject: 

Nice work indeed.

To test it, make the settings really EXTREME!! then it should be obvious. Short attack and release times should make it sound really compressed.

BigB.

Author:  footeo [ Thu May 29, 2008 5:40 am ]
Post subject: 

I can confirm that the leveler is working for live tv and recordings. I may tweak it some but for the most part I think it sounds pretty good. No more waking the baby playing movies or having to deal with loud commercials while watching live tv.

Page 1 of 4 All times are UTC - 6 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/