Re: [LAU] LADSPA Plugins from ALSA,would like some help, please !

From: bricolodu <jean.beauve@email-addr-hidden>
Date: Wed Sep 07 2016 - 16:14:39 EEST

Hello,

I believe that my problem is a format problem but I really don't find the
way to solve it !

Here is my latest implementation :

*INPUT -> OUTPUT:*

/pcm.!default { # *INPUT*
# type plug
  type route
  slave.pcm conversion_plug;
# slave.pcm BassMax;
# slave.pcm mix;
# slave.pcm "plughw:0,0"
  slave.channels 2 #To get MONO out from Left Channel)
  ttable.0.0 0.5
  ttable.1.0 0.5
  ttable.0.1 0.5
  ttable.1.1 0.5
}

pcm.conversion_plug { # *CONVERSION PLUG*
    type plug
# slave.pcm mix
    slave.pcm BassMax
}

pcm.BassMax { # *BASSMAX*
    type ladspa
    slave.pcm mix;
    path "/usr/lib/ladspa"
    channels 2
    plugins {
        0 {
            id 1098 # Identity (Audio) (1098/identity_audio)
            policy duplicate # Keep Left Channel unchanged
            input.bindings.0 "Input";
            output.bindings.0 "Output";
        }
        1 {
            id 1672 # 4 Pole Low-Pass Filter with Resonance (FCRCIA)
(1672/lp4p$
            policy none # Apply Low Pass Filter to subwoofer mon$
            input.bindings.0 "Input";
            output.bindings.0 "Output";
            input {
                controls [ 200 2 ]
            }
        }
        2 {
            id 1220 # Overtone (Harmonics Generator)
            policy none # Apply Overtone to subwoofer mono Mix
            input.bindings.0 "Input";
            output.bindings.0 "Output";
            input {
                controls [ 1 -1 0 1 0.2 -1 -1 1 -1 -1 ]
            }
        }
    }
}

pcm.mix { # *OUPUT*
# type plug
    type route
    slave.pcm "plughw:0,0"
    slave.channels 2
    ttable {
        0.0 0.5 # left channel = mono mix left and right$
        1.0 0.5
    }
}/

And here are the trials I made to get SOUND :

*1/ INPUT -> OUTPUT:*

#1 INPUT (type plug) -> OUPUT (type plug), I get an error:
squeezelite: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion
`!snd_interval_empty(i)' failed.

#2 INPUT (type plug) -> OUPUT (type route), I get sound

#3 INPUT (type route) -> OUPUT (type plug), I get sound

#4 INPUT (type route) -> OUTPUT (type route), I get sound

*WHY ?*

Anyway, I thought that different format type between INPUT and OUTPUT was
THE solution, so I tried :

*2/ INPUT -> BASSMAX -> OUTPUT :*

#1 INPUT (type plug) -> BASSMAX -> OUPUT (type plug):
squeezelite: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion
`!snd_interval_empty(i)' failed.

#2 INPUT (type plug) -> BASSMAX -> OUPUT (route plug):,

#3 INPUT (type route) -> BASSMAX -> OUPUT (route plug),

#4 INPUT (type route) -> BASSMAX -> OUPUT (type plug),
Produced the same error :
[10:18:13.284316] test_open:130 hwparam init error: Invalid argument
[10:18:13.286370] output_init_common:373 unable to open output device

So,I tried to convert the type from route to plug:

*3/ INPUT -> CONVERSION PLUG -> BASSMAX -> OUTPUT :*

#1: INPUT (type route) -> CONVERSION PLUG (type plug) -> BASSMAX -> OUPUT
(type plug):
squeezelite: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion
`!snd_interval_empty(i)' failed.
Aborted

#2: INPUT (type route) -> CONVERSION PLUG (type plug) -> BASSMAX -> OUPUT
(type route):
[12:00:38.138447] test_open:130 hwparam init error: Invalid argument
[12:00:38.140665] output_init_common:373 unable to open output device

*This one should have worked !*

Then I thought I should try again *without* the BASSMAX just to confirm it
was working

*4/ INPUT -> CONVERSION PLUG -> OUTPUT :*

#1 INPUT (type route) -> CONVERSION PLUG (type plug) -> OUPUT (type route),
YES, I got sound

#2 INPUT (type plug) -> CONVERSION PLUG (type route) -> OUPUT (type plug),
failed:
[12:51:11.783791] test_open:124 playback open error: Invalid argument
[12:51:11.785627] output_init_common:373 unable to open output device

#3 atltough without any interest
     INPUT (type plug) -> CONVERSION PLUG (type plug) -> OUPUT (type route),
also failed:
squeezelite: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion
`!snd_interval_empty(i)' failed.
Aborted

#4 atltough without any interest
     INPUT (type route) -> CONVERSION PLUG (type route) -> OUPUT (type
plug), also failed:
[13:16:07.156408] test_open:124 playback open error: Invalid argument
[13:16:07.158014] output_init_common:373 unable to open output device

*It looks like I have to have the INPUT in type route*

However, although I thought that the LADSPA might not like the INPUT in
route type, I also tried to add the conversion plug in between BASSMAX and
OUTPUT

5/ INPUT -> BASSMAX -> CONVERSION PLUG -> OUPUT
# 1 INPUT (plug type) -> BASSMAX -> CONVERSION PLUG (type plug) -> OUPUT
(type route), I got :
squeezelite: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion
`!snd_interval_empty(i)' failed.
Aborted
# 2 INPUT (plug type) -> BASSMAX -> CONVERSION PLUG (type route) -> OUPUT
(type plug), I got :
[12:21:59.863034] test_open:124 playback open error: Invalid argument
[12:21:59.864826] output_init_common:373 unable to open output device
#3 INPUT (plug type) -> BASSMAX -> CONVERSION PLUG (type route) -> OUPUT
(type route), I got :
[12:25:25.686880] test_open:124 playback open error: Invalid argument
[12:25:25.688497] output_init_common:373 unable to open output device
#4 INPUT (plug type) -> BASSMAX -> CONVERSION PLUG (type plug) -> OUPUT
(type plug), I got:
squeezelite: pcm_params.c:170: snd1_pcm_hw_param_get_min: Assertion
`!snd_interval_empty(i)' failed.
Aborted

#5 INPUT (type route) -> BASSMAX -> CONVERSION PLUG (type route) -> OUTPUT
(type plug)
I got:
[12:32:08.213364] test_open:124 playback open error: Invalid argument
[12:32:08.215192] output_init_common:373 unable to open output device

#6 INPUT (type route) -> BASSMAX -> CONVERSION PLUG (type plug) -> OUTPUT
(type route)
I got:
[12:34:21.398664] test_open:130 hwparam init error: Invalid argument
[12:34:21.400769] output_init_common:373 unable to open output device

*This one might have worked, unless LADSPA doesn’t accept route type as
input*

NOTE that:
INPUT (type route) -> CONVERSION PLUG (type plug) -> BASSMAX -> PLUGHW works
I get, from a 63Hz sine wave at the input, 126 Hz on the left Channel and
63Hz not attenuated on the right Channel.

*So what are my left options ?*

Best regards,
Jean

--
View this message in context: http://linux-audio.4202.n7.nabble.com/LADSPA-Plugins-from-ALSA-would-like-some-help-please-tp101061p101077.html
Sent from the linux-audio-user mailing list archive at Nabble.com.
_______________________________________________
Linux-audio-user mailing list
Linux-audio-user@lists.linuxaudio.org
http://lists.linuxaudio.org/listinfo/linux-audio-user
Received on Wed Sep 7 20:15:01 2016

This archive was generated by hypermail 2.1.8 : Wed Sep 07 2016 - 20:15:01 EEST