You are not logged in.

#1 2013-10-12 10:58:37

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Alsa limiter for 6 channels

This is my .asoundrc, and the pair compressor + limiter works fine for stereo input:

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:Audigy2";
  path "/usr/lib/ladspa";
  plugins [{
          label fastLookaheadLimiter
          input {
           #InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
           controls [ 20 -1 0.8  ]
          }
      }]
}

Unfortunately, it does not work for 6 channels.
I.e., this one works fine:

$ ALSAPCM='pcm.ladcomp_compressor' speaker-test -c 2 -t wav -l 5

This one does not and you hear only the left and right channels.

$ ALSAPCM='pcm.ladcomp_compressor' speaker-test -c 6 -t wav -l 5

Of course the hardware is wired correctly and this one works:

$ ALSAPCM='pcm.surround51' speaker-test -c 6 -t wav -l 5

Since normally you have to select surround51 manually I thought that the problem could be in the output pcm, and I rewrote like this. But it is the same:

#[...] analogous 51 compressor omitted

pcm.plug51 {
  type plug
  slave.pcm "surround51"
  slave.channels 6
}


pcm.ladcomp_limiter51 {
  type ladspa
  slave.pcm "plug51"
  path "/usr/lib/ladspa"
  plugins [{
          label fastLookaheadLimiter
          input {
           #InputGain(Db) -20 -> +20 ; Limit (db) -20 -> 0 ; Release time (s) 0.01 -> 2
           controls [ 20 -1 0.8  ]
          }
      }]
}

Is there a way? Any insight?

Offline

#2 2013-10-12 14:37:09

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Alsa limiter for 6 channels

Try specifying "channels 6" or "slave.channels 6" within pcm.ladcomp_limiter51, or whatever PCM calls pcm.ladcomp_limiter51.

I assume that at the point of running fastLookaheadLimiter, the number of channels has not been specified (and so defaults to 2, i.e. stereo).

Offline

#3 2013-10-13 00:30:14

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Alsa limiter for 6 channels

For the moment lets forget about the compressor. This line does not work:

$ ALSAPCM='pcm.ladcomp_limiter51' speaker-test -c 6 -t wav -l 5

I tried adding "slave.channels 6" in the pcm.ladcomp_limiter51 section, just below slave.pcm. But it does not work at all. I.e., I get this error: -- ALSA lib pcm.c:6973:(snd_pcm_slave_conf) Unknown field channels --
Adding only "channels 6" seems to have no effects, I still hear only the front left and right channels. Also adding the input section has the same effect.

Perhaps the limiter does manage only two channels? It is possible to split the 6 channels in three different limiters and mix back again? Or there is another limiter that manages 6 channels?


Edit, the problem DOES seem in the limiter, the compressor by itself works:

pcm.dmix6 {
  type plug
  slave.pcm "surround51"
  slave.channels 6
}

pcm.ladcomp_compressor51 {
  type ladspa
  slave.pcm "dmix6";
  path "/usr/lib/ladspa";
  plugins [{
          label dysonCompress
          input {
              #peak limit, release time, fast ratio, ratio
              controls [0 1 0.5 0.99]
          }}]
}

Last edited by ezzetabi (2013-10-13 00:33:02)

Offline

#4 2013-10-13 01:20:14

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Re: Alsa limiter for 6 channels

Try limit_peak instead of fastLookaheadLimiter - I just did a very quick test, and it seems to work with more than stereo inputs.

Edit:

$ analyseplugin fast_lookahead_limiter_1913 | grep Input
Ports:	"Input gain (dB)" input, control, -20 to 20, default 0
	"Input 1" input, audio
	"Input 2" input, audio

I suppose that shows that fastLookaheadLimiter is limited to stereo sad

This looks more flexible:

$ analyseplugin cmt | grep -A14 limit_peak | grep Input
	"Input" input, audio

Last edited by brebs (2013-10-13 01:35:14)

Offline

#5 2013-10-13 10:10:26

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: Alsa limiter for 6 channels

I tried the two simple limiters from cmt and they works for 6 channels audio, but they do not have the effect of increasing the volume. I am afraid the lack of "input gain" control is the culprit. I will try splitting the audio with a type multi, but I have some doubts..

Offline

Board footer

Powered by FluxBB