bdejong
Posts: 4
Joined: Thu May 02, 2013 12:12 pm

ALSA + LADSPA

Thu Jun 13, 2013 3:12 pm

Hello all,

Following many many guides throughout the internet I've been trying to get ALSA to load up a LADSPA plugin on a Pi. Simply put, I'm trying to get this .asoundrc to work:

Code: Select all

pcm.Amp {
        type ladspa
        slave.pcm "plughw:0,0";
        path "/usr/lib/ladspa";
        plugins [
                {
                        id 1049
                       label amp_stereo
                       input {
                                controls [ 6 ]
                        }
                }
        ]
}

pcm.!default {
  type plug
  slave.pcm "Amp"
}
However, no matter what I try I always get:

Code: Select all

[email protected] ~ $ aplay piano2.wav 
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM Amp
aplay: main:682: audio open error: File exists
I tried to run the actual plugin like so:

Code: Select all

[email protected] ~ $ applyplugin piano2.wav piano2_out.wav amp.so amp_stereo 6
Peak output: 117816
[email protected] ~ $ applyplugin piano2.wav piano2_out.wav amp.so amp_stereo 12
Peak output: 235632
And as you can see that also works just fine.

If anyone has any idea why this isn't working or how I could possibly debug this problem (as nothing shows up in the logs)... let me know!


- Bram

User avatar
AutoStatic
Posts: 326
Joined: Tue Jan 01, 2013 10:27 pm
Contact: Website

Re: ALSA + LADSPA

Thu Jun 13, 2013 7:18 pm

Hallo Bram,

According to http://alsa.opensrc.org/Ladspa_%28plugin%29 you need to invoke aplay like this (translated to your situation):

Code: Select all

aplay -Dplug:Amp piano2.wav
Groet,

Jeremy
RPi and real-time, low-latency audio: http://wiki.linuxaudio.org/wiki/raspberrypi
RPi audio repository: http://rpi.autostatic.com/
RPi and audio blog: https://autostatic.com/tag/raspberrypi/

bdejong
Posts: 4
Joined: Thu May 02, 2013 12:12 pm

Re: ALSA + LADSPA

Thu Jun 13, 2013 9:10 pm

My appologies, I didn't paste part of the config... I did set it to the default ALSA device too.

In any case, without slaving it to the default device I get the error too if I play it like you mention:

Code: Select all

[email protected] ~ $ aplay -Dplug:Amp piano2.wav
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM Amp
If I create a device that replaces the default:

Code: Select all

pcm.!default {
    type plug
    slave.pcm "Amp";
}
I get exactly the same error when playing without the -D parameter (which is logical, if it doesn't work as a plug it won't work as a slave)

- bram

bdejong
Posts: 4
Joined: Thu May 02, 2013 12:12 pm

Re: ALSA + LADSPA

Fri Jun 14, 2013 9:29 am

If anyone is interested in the solution to this problem: it looks like when both pulse and alsa are installed thed .asoundrc is loaded twice: once by the pulse configs and once by the alsa config. Commenting out

Code: Select all

#                       "/etc/asound.conf"
#                       "~/.asoundrc"
in /usr/share/alsa/alsa.conf

fixed the problem.

yay!

- bram

Onlyfuckup
Posts: 1
Joined: Sun Jun 16, 2019 4:49 pm

Re: ALSA + LADSPA

Mon Jun 17, 2019 10:10 am

Have made a whole way to change the audio pitch without a decimal fraction but the Linux OS may have to be customized from the brainwaves program that there is for it to fully function.

https://drive.google.com/file/d/14htiD1 ... sp=sharing

https://www.dropbox.com/s/shnpj32eno8t2 ... .docx?dl=0

https://www.dropbox.com/s/3zjx7lyv18s8h ... .docx?dl=0

Return to “Graphics, sound and multimedia”