Home of the Squeezebox™ & Transporter® network music players.
Results 1 to 8 of 8
  1. #1
    Junior Member
    Join Date
    Oct 2018
    Posts
    7

    PCP: Parametric EQ using ladspa_dsp

    Hi all,

    I'm running PCP for some self-build speakers which sound better with a custom parametric equalization, http://www.uibel.net/bauvor/bv_box/o...chreibung.html
    But I have started tweaking the sound of all my 4 PCP based players with this approach.
    For the parametric eq I'm using ladspa_dsp, https://github.com/bmc0/dsp for which I managed to build a tcz package and hack asound.conf to include my settings.
    Currently this is quite raw, as you will need to edit /etc/asound.conf and the dsp config files. Now that I understand how all this works, I don't mind editing these config files directly. And as these files change only when I measure and calibrate new speakers, I usually do this only once per player.

    I'm posting this to help others who want more than the 10 band EQ included in PCP. I build a ladspa_dsp.tcz that runs on PCP 6.0. I'm not sure how this should be distributed, currently I have just attached it to this post... Ideally I would like to add it to the PCP repository somehow.

    A step by step guide for setting up parametric EQ:

    1. copy ladspa_dsp.tcz and ladspa_dsp.tcz.dep to /mnt/mmcblk0p2/tce/optional/
    Optional: If you like to use the dsp command line tool to quickly test settings, you need to install pcp-libffmpeg using tce-load -wi pcp-libffmpeg

    2. add ladspa_dsp.tcz to /mnt/mmcblk0p2/tce/onboot.lst
    echo ladspa_dsp.tcz >> /mnt/mmcblk0p2/tce/onboot.lst


    3. backup ladspa_dsp config: Add "etc/ladspa_dsp" to edit /opt/.filetool.ls>>
    echo etc/ladspa_dsp >> /opt/.filetool.lst


    4. configure /etc/asound.conf by adding:

    #--- ladspa_dsp below ---
    pcm.dsp {
    type plug
    slave {
    format FLOAT
    rate unchanged
    channels unchanged
    pcm {
    type ladspa
    path "/usr/local/lib/ladspa"
    playback_plugins [{
    label "ladspa_dsp"
    }]
    slave.pcm {
    type plug
    slave {
    pcm "sound_device"
    rate unchanged
    channels unchanged
    }
    }
    }
    }
    }


    5. create dsp config files
    sudo mkdir /etc/ladspa_dsp
    sudo chown tc /etc/ladspa_dsp

    # dsp config file, see https://github.com/bmc0/dsp
    echo "effects_chain=noise -200 @cms50-v3-37Hz.txt" > /etc/ladspa_dsp/config

    # effects file containing the parametric eq settings
    # this example for the Focal CMS 50 monitors trades volume against bass.
    # now the bass starts at 37 Hz instead of 48 Hz. It additionally removes a minor
    # non-linearity in the high frequency.
    # You can generate eq parameters by measuring speakers with REW and tweaking suitable settings.
    echo "gain -9.0 highpass 38.0 6.30 eq 38.0 1.948 -7.2 eq 64.0 2.000 -1.6 eq 4194 5.000 -2.7 eq 7447 5.000 -2.8" > cms50-v3-37Hz.txt

    6. Disable built-in audio (if you use a sound card, which you probably do). I'd like to simplify things by just having the real audio device available.

    7. configure squeezelite to use the dsp output (Squeezelite Settings -> Output Setting).

    8. Optional: Configure mixer, my Justboom DAC has a hardware volume control. On the squeezelite tab set "Alsa volume control" = Digital and add "Various options" = -O hw:CARD=sndrpijustboomd,DEV=0



    How to build the package:


    Log into pcp

    # create and cd into directory for compilation
    cd /mnt/mnt/mmcblk0p2/source

    # get needed software
    tce-load -wi compiletc
    tce-load -wi git
    tce-load -wi squashfs-tools
    tce-load -wi libasound-dev
    tce-load -wi pcp-libffmpeg-dev
    tce-load -wi gmp-dev

    # get source
    git clone https://github.com/bmc0/dsp.git
    cd dsp
    # get ladspa.h header, its not packaged.
    sudo wget -O /usr/include/ladspa.h https://www.ladspa.org/ladspa_sdk/ladspa.h.txt

    export CFLAGS="-O2 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
    export CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig


    # configure and build
    ./configure --prefix=/usr/local
    mkdir install
    make
    make install_dsp install_ladspa_dsp DESTDIR=install

    # create tcz package
    mksquashfs install ladspa_dsp.tcz
    echo "libasound.tcz pcp-libffmpeg.tcz" > ladspa_dsp.tcz.dep
    Attached Files Attached Files
    Last edited by Engel; 2020-05-31 at 04:23. Reason: simplified build instructions

  2. #2
    Senior Member Greg Erskine's Avatar
    Join Date
    Sep 2006
    Location
    Sydney, Australia
    Posts
    1,839
    Thanks Engel for posting such a detailed post of your DSP work. It should help others.

    I'll leave it to the other pCP team members to get it into the pCP repositories. There does need to be a info file for each extension in the repositories.

  3. #3
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,185
    pkg-config works just fine.....as long as the -dev extensions are built properly. Which one was causing a problem? There are also specific compiler flags need for full cross platform compatibility
    Last edited by paul-; 2020-05-29 at 13:58.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  4. #4
    Junior Member
    Join Date
    Oct 2018
    Posts
    7
    Hi Paul,

    thanks for the comments. pcp-libmad didn't ship the pkg-config files, but I have removed it from the build now, as ffmpeg can also decode mp3.
    After additionally installing the ladspa.h header into /usr/include, the default ./configure works.

    I have added a info file and updated the first post, I hope its now in a good state.

    Best regards,
    Pablo

  5. #5
    Junior Member
    Join Date
    Oct 2018
    Posts
    7
    Quote Originally Posted by paul- View Post
    There are also specific compiler flags need for full cross platform compatibility
    Which ones are these? I compiled the package above with default flags on a 3A+

  6. #6
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,185
    libmad source doesn't include a pkg-config setup. I suppose we could create noted in lfs.

    Standard piCore/pCP compiler flags, such that we make sure all binaries work on all boards.

    Code:
    export CFLAGS="-O2 -pipe -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
    export CXXFLAGS="-O2 -pipe -fno-exceptions -fno-rtti -march=armv6zk -mtune=arm1176jzf-s -mfpu=vfp"
    export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/lib/pkgconfig
    Actually the Core Handbook would say to use -Os optimization.......
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  7. #7
    Junior Member
    Join Date
    Oct 2018
    Posts
    7
    Thanks Paul, I have compiled with the new flags and updated the binary in the first post.
    The dsp configure script did use pkg-config to check for libmad, it looks like other distros (I use fedora) have added a suitable mad.pc file. Anyway its not needed anymore for this package.

    Best regards,
    Pablo

  8. #8
    Senior Member
    Join Date
    Apr 2005
    Location
    Milan, Italy
    Posts
    617
    Following this. I'm considering building a new Squeezebox player using piCorePlayer and parametric equalization was big on my wishlist of stuff I hoped it could handle.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •