[mythtv] AGC for audio

Mark Spieth mark at digivation.com.au
Fri May 16 07:44:51 UTC 2008


>Hi devs,
>
>With a recent upgrade to 0.21 I found that audio channels from my DVB
>tuners and the DVD were low - in my setup this was obvious with
>mythmusic starting mp3 playback after exiting a video recording and the
>speaker cones nearly flying across the room.  I've also noticed that
>other users complain about varying levels between channels or tuners.
>
>I've coded up a simple Auto Gain Control (AGC) based on this post
>http://www.dsprelated.com/showmessage/21943/1.php .  It's modified to
>take into account that the gain can go too high during periods of silence.
>
>I placed the call to ManageAGC() in AddAudioData() before any calls to
>AddSamples() in NuppleVideoPlayer.cpp . It seems to be working well.  In
>normal operation it has two floating point multiplications and 2
>add/subtracts per an audio sample.
>
>I've coded it against the release-0-21-fixes branch and placed a svn
>diff patch here if anyone would like to try it out:
>http://people.connect.net.au/bf/john/agc_svn_diff

nice and simple. Ive always refrained from agc as it usually adds artifacts.
however, it could go in audiooutputbase (the correct place for this). with a 
config item for enabling in DB and mythfrontend setup.
also gain needs to be scaled with samplerate so that the timeconstant 
remains "constant" with varying samplerates.

how well does it work with speech as I can see this amplifying background 
noise and then making sudden bursts of speech too loud.

also why did you choose 0.05 as the set point.

cheers
mark 



More information about the mythtv-dev mailing list