Mailing List Archive

Equalizing audio levels in mythtv
I have noted some users have found varying audio levels between channels
annoying. The inclusion of a ladspa compressor/limiter filter has helped
me enormously on a eeepc netbook running mythtv-frontend dvb-s.

The information was gleaned from the URL
http://alsa.opensrc.org/index.php/LADSPA_plugins

As in my case, create the file .asoundrc in your home folder with the
contents;

**********start of file*********
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 [ 0 0 0.8 ]
}
}
]
}

******end of file*****

Install the package swh-plugins
sudo apt-get install swh-plugins

In mythfrontend change audio output device from ALSA: to ALSA:ladcomp
in settings/general/audio output device.

restart alsa or reboot

The settings in .asoundrc may be a bit aggressive for some installations
but are great for the netbook's tiny speakers. Change the settings to
suit.

I hope I haven't left anything out! Assumes alsa installed.

Noel Sheridan
Re: Equalizing audio levels in mythtv [ In reply to ]
feadog wrote:
> I have noted some users have found varying audio levels between channels
> annoying. The inclusion of a ladspa compressor/limiter filter has helped
> me enormously on a eeepc netbook running mythtv-frontend dvb-s.
>
> The information was gleaned from the URL
> http://alsa.opensrc.org/index.php/LADSPA_plugins
>
>
Does this work with spdif out?

_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Equalizing audio levels in mythtv [ In reply to ]
On Tue, Feb 9, 2010 at 1:28 PM, Graeme Woollett <g.woollett@irl.cri.nz>wrote:

> feadog wrote:
> > I have noted some users have found varying audio levels between channels
> > annoying. The inclusion of a ladspa compressor/limiter filter has helped
> > me enormously on a eeepc netbook running mythtv-frontend dvb-s.
> >
> > The information was gleaned from the URL
> > http://alsa.opensrc.org/index.php/LADSPA_plugins
> >
> Does this work with spdif out?
>
It should work for non-encoded output (ie. not DTS or AC3) if you hook it up
to the spdif hw: change "slave.pcm "plughw:0,0";" to whatever your spdif
output is. I don't think it will work for passthrough DTS or AC3 as that
would require decoding and re-encoding the signal.

Cheers,
Steve
Re: Equalizing audio levels in mythtv [ In reply to ]
On Tue, 2010-02-09 at 13:37 +1300, Steve Hodge wrote:
> On Tue, Feb 9, 2010 at 1:28 PM, Graeme Woollett
> <g.woollett@irl.cri.nz> wrote:
> feadog wrote:
> > I have noted some users have found varying audio levels
> between channels
> > annoying. The inclusion of a ladspa compressor/limiter
> filter has helped
> > me enormously on a eeepc netbook running mythtv-frontend
> dvb-s.
> >
> > The information was gleaned from the URL
> > http://alsa.opensrc.org/index.php/LADSPA_plugins
> >
>
> Does this work with spdif out?
> It should work for non-encoded output (ie. not DTS or AC3) if you hook
> it up to the spdif hw: change "slave.pcm "plughw:0,0";" to whatever
> your spdif output is. I don't think it will work for passthrough DTS
> or AC3 as that would require decoding and re-encoding the signal.
>
> Cheers,
> Steve


Does this work with spdif out?

sorry, spdif is next years project, but I wonder why ac3 should be
treated differently than mp2.

Noel








_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Equalizing audio levels in mythtv [ In reply to ]
On Tue, 2010-02-09 at 18:51 +1300, feadog wrote:
> I wonder why ac3 should be
> treated differently than mp2.
>
just realized we're talking about dvb-t, not dvb-s




_______________________________________________
mythtvnz mailing list
mythtvnz@lists.linuxnut.co.nz
http://lists.ourshack.com/mailman/listinfo/mythtvnz
Archives http://www.gossamer-threads.com/lists/mythtv/mythtvnz/
Re: Equalizing audio levels in mythtv [ In reply to ]
On Tue, Feb 9, 2010 at 6:51 PM, feadog <feadog@orcon.net.nz> wrote:

> sorry, spdif is next years project, but I wonder why ac3 should be
> treated differently than mp2.
>
AC3 is not just a bunch of raw samples - it's an encoded format. SPDIF only
supports 2 channel 16 bit PCM samples at specific rates (48, 44.1, 32kHz).
Both AC3 and DTS are wedged into that format so you can't look at the 2
channel SPDIF data and draw any conclusions about the multi-channel content
it represents. Try outputing DTS by SPDIF to a receiver that doesn't
understand DTS and you'll see what I mean! The only way to manipulate the
volume (or anything else) is to decode the signal to descrete channels, do
whatever you want to those channels, and then re-encode it afterwards. I
think that can be done, but it's not the same as manipulating PCM data like
the setup you've got does.

Cheers,
Steve
Re: Equalizing audio levels in mythtv [ In reply to ]
On Tue, Feb 9, 2010 at 7:39 PM, feadog <feadog@orcon.net.nz> wrote:

> On Tue, 2010-02-09 at 18:51 +1300, feadog wrote:
> > I wonder why ac3 should be
> > treated differently than mp2.
> >
> just realized we're talking about dvb-t, not dvb-s
>

That doesn't make any difference, but I think I understand what you were
getting at now. Mp2 (or mp3 or mp4 or flac or any other 2 channel format) is
decoded to PCM samples by mythtv, which then passes it to alsa which then
processes it according to the rules the user has set up and then sends it to
the specified soundcard output. AC3 and DTS can be handled the same way - as
a number of discrete channels of PCM data. But S/PDIF can't accept 6
discrete channels: if you send the soundcard 6 channel PCM data then it will
generally only be able to output that via analogue connectors (some
soundcards are capable of encoding those separate channels as AC3 streams,
but they are rare). So most people set up mythtv (and/or mplayer, xine, etc)
to "passthrough" AC3 and DTS signals. That means that mythtv doesn't decode
the signal to 6 (or whatever) channels, but instead sends the encoded data
to alsa which gets the soundcard to output it, still encoded, via S/PDIF.
Since the data is still encoded it has to be handled differently by alsa to
achieve things like volume normalisation.

I hope, between this and my other explanation, that you can see what I mean.

Cheers,
Steve