Thank you for your donation!


Cloudsmith graciously provides open-source package management and distribution for our project.


LADSPA plugins and asound.conf
#1
I'm in the process of installing a new Moode onto my Pi3B+.

Previously, I have manually edited asound.conf (created) and mpd.conf to implement crossovers using Charlie Laub's ACDf plugins on older Moode instances, 2.6 and 3......

Is there a better way to do this? And is there a way to do it without getting in the way of the parametric and graphic EQ options?
Reply
#2
I think the LADSPA stuff all has to be done manually and may conflict with moOde config for the 3 LADSPA plugins it uses (Crossfeed, G-EQ, P-EQ).

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#3
(07-20-2018, 02:08 PM)Tim Curtis Wrote: I think the LADSPA stuff all has to be done manually and may conflict with moOde config for the 3 LADSPA plugins it uses (Crossfeed, G-EQ, P-EQ).

-Tim

I've now got the crossovers working properly in "asound.conf" and "mpd.conf" (tacked on the end). It it easy to add them to the source/skeleton for "mpd.conf"? As I'll lose the defs if I make MPD changes through the webiface?

Also spotted that MPD starts with output "1" now. Previously there was a state file and it restarted/rebooted using previous out config. Currently I use "mpc enable/disable" every boot.

I guess next is to play with making the filter chain the default in "asound.conf".

J.
Reply
#4
Nice! Please post the code when finished and I'll see what I can do :-)

Yes, mpd.conf gets overwritten after APPLY in the MPD config screen.

The output should stick after a restart, at least its doing that on my end. See section from moode log below that shows output 4 on. 

Code:
20180725 105120 worker: - Services
20180725 105120 worker: Reset renderer active
20180725 105122 worker: MPD started
20180725 105122 worker: MPD scheduler policy (time-share)
20180725 105122 worker: Configure MPD outputs
20180725 105122 worker: MPD output 1 ALSA default (off)
20180725 105122 worker: MPD output 2 ALSA crossfeed (off)
20180725 105122 worker: MPD output 3 ALSA parametric eq (off)
20180725 105122 worker: MPD output 4 ALSA graphic eq (on)
20180725 105122 worker: MPD output 5 ALSA bluetooth (off)
20180725 105122 worker: MPD crossfade (off)
20180725 105122 worker: Airplay receiver started
20180725 105122 worker: Airplay volume mgt (auto)
20180725 105122 worker: Squeezelite renderer started
20180725 105122 worker: Rotary encoder on (100 2 3 3 5)
20180725 105122 worker: Bluetooth controller started
20180725 105129 worker: Bluetooth controller initialized


-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#5
Tim,

Is it possible that adding and enabling an output "6" is causing Moode to default to opening output "1" at boot?
Code:
pi@Sulky:/var/log $ cat moode.log | grep -i 'mpd output'
20180724 183823 worker: Configure MPD outputs
20180724 183823 worker: MPD output 1 ALSA default (on)
20180724 183823 worker: MPD output 2 ALSA crossfeed (off)
20180724 183823 worker: MPD output 3 ALSA parametric eq (off)
20180724 183823 worker: MPD output 4 ALSA graphic eq (off)
20180724 183823 worker: MPD output 5 ALSA bluetooth (off)
pi@Sulky:/var/log $




In the general mpd.conf settings section, I have 
Code:
mixer_type "software"
Added to drive the crossovers. (USB soundcard is a CM6206LX cheapie. Using hardware mixer/volume with my setup causes volume level "2" to be comfortable listening and level "5" to be too much, hence I added the "mixer_type = software" global.)
Code:
audio_output {
type "alsa"
name "LADSPA filters2 active"
device "plug:ladspa_filters2"
mixer_control "Speaker"
mixer_device "hw:1"
mixer_index "0"
dsd_usb "yes"
}

asound.conf added to /etc.
  • Using Charlie Laub's ACDf LADSPA plugin(s).
  • Not yet added as default ALSA device.
  • Woofermatch performs null operation on the HF drivers. That way I get output from the top channels. Otherwise I get woofer only. I may yet find a more elegant way to do it.

Code:
# LADSPA filters; they act serially on each channel
# Altering a channel first will alter any channels
# that channel is copied.
# Filters with the same input and output channel MUST be last to operate

pcm.ladspa_filters2 {
    type ladspa
    slave.pcm woofermatch
    path "/usr/local/lib/ladspa"  # must indicate filter directory
    channels 4                    # two is default, other channel counts must $
    plugins
    {
         0 {                      # Output 2 (RHF)- 2nd order HPF on TC9
              label ACDf
              policy none
              input.bindings.1 "Input"
              output.bindings.2 "Output"
              input { controls [22 1 0 500 0.707] } # 22 = 2nd order HPF
         }
         1 {                      # Output 3 (RLF)- 2nd order LPF on woofer
              label ACDf
              policy none
              input.bindings.1 "Input"
              output.bindings.3 "Output"
              input { controls [21 1 0 500 0.707] } # 21 = 2nd order LPF
         }
         2 {                      # Output 1 (LLF)- 2nd order LPF on woofer
              label ACDf
              policy none
              input.bindings.0 "Input"
              output.bindings.1 "Output"
              input { controls [21 1 0 500 0.707] } # 21 = 2nd order LPF
         }
         3 {                      # Output 0 (LHF) - 2nd order HPF on TC9
              label ACDf
              policy none
              input.bindings.0 "Input"
              output.bindings.0 "Output"
              input { controls [22 1 0 500 0.707] } # 22 = 2nd order HPF
         }
    }
}

# gain block to normalise woofer level
pcm.woofermatch {
    type ladspa
    slave.pcm out4way
    path "/usr/local/lib/ladspa"  # must indicate filter directory
    channels 4                    # two is default, other channel counts must $
    plugins
    {
         0 {                      # Output 0 (LHF) - raise HF
              label ACDf
              policy none
              input.bindings.0 "Input"
              output.bindings.0 "Output"
              input { controls [0 1 0] } # 0 = gain/phase
         }
         1 {                      # Output 1 (LLF) - Reduce woofer gain
              label ACDf
              policy none
              input.bindings.1 "Input"
              output.bindings.1 "Output"
              input { controls [0 1 -9] } # 0 = gain/phase
         }
         2 {                      # Output 2 (RHF) - raise HF
              label ACDf
              policy none
              input.bindings.2 "Input"
              output.bindings.2 "Output"
              input { controls [0 1 0] } # 0 = gain/phase
         }
         3 {                      # Output 3 (RLF) - Reduce woofer gain
              label ACDf
              policy none
              input.bindings.3 "Input"
              output.bindings.3 "Output"
              input { controls [0 1 -9] } # 0 = gain/phase
         }
    }

}


pcm.out4way {
    type plug
    slave {
         pcm "hw:1,0"
         channels 4
    }
}


Cheers,

J.
Reply
#6
Hi J,

Have a look at function configMpdOutputs() in source file /var/www/inc/playerlib.php

As a workaround just change

$output = '1';

to

$output = '6';

-Tim
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply
#7
(07-28-2018, 04:38 PM)Tim Curtis Wrote: Hi J,

Have a look at function configMpdOutputs() in source file /var/www/inc/playerlib.php

As a workaround just change

$output = '1';

to

$output = '6';

-Tim

A bit later.... Quite a bit later.....

I settled for overwriting output "1" with my filters in mpd.conf. I can script a little but so far figuring out how to include that into Moode has defeated me. Any tips you can give on setting it up so that and change in config won't overwrite my changes?
Reply
#8
To replace output 1 with your code would require editing function wrk_mpdconf() in the file /var/www/inc/playerlib.php

Adding a 6th output is much more involved and would require one or more SQL columns or possibly a dedicated SQL table for the settings, a settings config page, settings on Audio config, changes to wrk_mpdconf() and configMpdOutputs(), etc...
Enjoy the Music!
moodeaudio.org | Mastodon Feed | GitHub
Reply


Forum Jump: