Ecasound DSP startup difficulties

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I intend to make a DSP by using ecasound based on the guide of Digital Crossover/EQ with Open-Source Software: HOWTO | Richard's Stuff. My first goal is to filter a single stereo signal.

In Ubuntu on a laptop I installed alsa and ecasound. I can easily playback a wav file and listen to it using headphones and the onboard soundcard. Unfortunately I have problems with mp3 files. I tried different instructions like 'ecasound song.mp3' or 'ecasound -i song.mp3 -o alsa,MID', but in every case I get the message 'ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-MP3... Can't open song.mp3 for reading."'

My first thought was I missed a mp3 converter but I checked mpg123 that is there and mpg321could be installed but doesn't change anything. I searched for this error message but couldn't the right solution. What is wrong?

The tutorial of Taylor gives examples of multichannel filters. Based on this information I tried to configure a chainset as initial step for a single/stereo filter:

Code:
ecasound -z:mixmode,sum -x \          
-a:pre -i: song.wav -pf:pre.ecp -o:loop,1 \     
-a:pre -f:16,4,44100 -o:alsa,surround51:MID
The chainset seems to be succesfull but I get the message below:

ecasound: ERROR: [ECA-SESSION] : "Audio object "" does not match any of the known audio device types or file formats. You can check the list of supported audio object types by issuing the command 'aio-register' in ecasound's interactive mode."

I checked the aio-register but found no errors. What could be wrong with the script?
 
Last edited:
I intend to make a DSP by using ecasound based on the guide of Digital Crossover/EQ with Open-Source Software: HOWTO | Richard's Stuff. My first goal is to filter a single stereo signal.

In Ubuntu on a laptop I installed alsa and ecasound. I can easily playback a wav file and listen to it using headphones and the onboard soundcard. Unfortunately I have problems with mp3 files. I tried different instructions like 'ecasound song.mp3' or 'ecasound -i song.mp3 -o alsa,MID', but in every case I get the message 'ERROR: Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-MP3... Can't open song.mp3 for reading."'

My first thought was I missed a mp3 converter but I checked mpg123 that is there and mpg321could be installed but doesn't change anything. I searched for this error message but couldn't the right solution. What is wrong?

The tutorial of Taylor gives examples of multichannel filters. Based on this information I tried to configure a chainset as initial step for a single/stereo filter:

Code:
ecasound -z:mixmode,sum -x \          
-a:pre -i: song.wav -pf:pre.ecp -o:loop,1 \     
-a:pre -f:16,4,44100 -o:alsa,surround51:MID
The chainset seems to be succesfull but I get the message below:

ecasound: ERROR: [ECA-SESSION] : "Audio object "" does not match any of the known audio device types or file formats. You can check the list of supported audio object types by issuing the command 'aio-register' in ecasound's interactive mode."

I checked the aio-register but found no errors. What could be wrong with the script?

I think Jerms is correct - the syntax of the input specifier seems wrong. I believe that when you use it with a colon, it should be like this:
Code:
-i:some_song.wav
You cannot have a space between the -i: input specifier (with a colon after the i) part and the input target, some_song.wav. Otherwise a blank field is passed to ecasound for the input target, giving you the error you encountered. There is also the format "-i input_target" (without the colon) and in that case you must have a space between the "-i" and the target. Those two different ways to specify inputs are described in the ecasound man page, which has lots of other useful info about the program.

But I think you also have some other errors:
1. you send the output of chain "pre" to "loop,1". This is never used again, so why send the output there? You can eliminate that.
2. You are formatting the audio (the -f: command) as 4 channel audio but are sending it to a 6 channel output device (surround51 has 6 total channels). It's a good idea to keep the number of channels consistent with what the output expects. It is no problem if there are unused channels. Ecasound just fills them with zeros (silence). I would change your format command to:
Code:
-f:16,6,44100
3. If this is all you want to do, I think you can combine the lines into one. There isn't really a need to redeclare the chain "pre". Something like this:
Code:
ecasound -B:rt -z:mixmode,sum -x \          
-a:pre -i:song.wav -pf:pre.ecp -f:16,6,44100 -o:alsa,surround51:MID
I also included a buffer type (real time buffering) so that latency will be low. It's a good habit to always use -B:rt when playing audio.

As you get more complicated you need to use more chains like in RTaylor's examples. The above would be sufficient for applying global EQ to the audio channels in the wave file, e.g. as a tone control or to correct for baffle step, etc.
 
Last edited:
I think Jerms is correct - the syntax of the input specifier seems wrong. I believe that when you use it with a colon, it should be like this:
Code:
-i:some_song.wav
You cannot have a space between the -i: input specifier (with a colon after the i) part and the input target, some_song.wav. Otherwise a blank field is passed to ecasound for the input target, giving you the error you encountered. There is also the format "-i input_target" (without the colon) and in that case you must have a space between the "-i" and the target. Those two different ways to specify inputs are described in the ecasound man page, which has lots of other useful info about the program.

But I think you also have some other errors:
1. you send the output of chain "pre" to "loop,1". This is never used again, so why send the output there? You can eliminate that.
2. You are formatting the audio (the -f: command) as 4 channel audio but are sending it to a 6 channel output device (surround51 has 6 total channels). It's a good idea to keep the number of channels consistent with what the output expects. It is no problem if there are unused channels. Ecasound just fills them with zeros (silence). I would change your format command to:
Code:
-f:16,6,44100
3. If this is all you want to do, I think you can combine the lines into one. There isn't really a need to redeclare the chain "pre". Something like this:
Code:
ecasound -B:rt -z:mixmode,sum -x \          
-a:pre -i:song.wav -pf:pre.ecp -f:16,6,44100 -o:alsa,surround51:MID
I also included a buffer type (real time buffering) so that latency will be low. It's a good habit to always use -B:rt when playing audio.

As you get more complicated you need to use more chains like in RTaylor's examples. The above would be sufficient for applying global EQ to the audio channels in the wave file, e.g. as a tone control or to correct for baffle step, etc.
Thanks for your extensive answer. I spend much time doing experiments with this but unfortunately I don't have much progress. I had some problems using my laptop so now I use Ubuntu MATE on a RPI with a simple USB 2 channel soundcard.

I found different instructions how to setup the environment with ecasound, alsa and ldaspa, but for some reason there seems to be something wrong with this. The only way I can get sound is by using simple 'ecasound song.wav'. I still can't playback mp3 files (I tried to install lame and mpg321 without result).

Using more steps in the playback gives various errors in the chainsetup. One of the things I'm wondering is if this could be caused by the surround51 part in the last code fragment you gave me as my soundcard has just two channels. I ordered a usb 5.1 soundcard so probably I have to wait till this arrives before I continue with this. Or do you have other suggestions?
 
Last edited:
Check your permissions. particularly to "sound" type groups. Maybe try running ecasound through "sudo".

Have you tried different ".mp3" files or just the song.mp3 file? Have you tried other players for mp3? have you tried giving full path to the song.mp3 to mpg123 or mpg321?
 
Last edited:
I really appreciate the help of all of you. Althoungh the instructions of Richard Taylor seem to be relatively simple it's not plug and play. Although I can get complicated things to work under R and Python this thing has a high learning curve for me and I know I am not the only one.

Try using the plug plugin of alsa ALSA project - the C library reference: PCM (digital audio) plugins . It will handle all the necessary conversions (inc. channels count) automatically.

Try -o:alsa,plug:surround51:MID

I don't know what you mean with the link, I already installed alsa with sudo. I implemented your suggestion in a simplified phrase and runned it under the root. Below the result.

Code:
root@name-desktop:/home/name/Music# ecasound -B:rt -z:mixmode,sum -x -i:Flute.wav -f:16,2,44100 -o:alsa,plug:surround:Device
**************************************************************************
*        ecasound v2.9.1 (C) 1997-2014 Kai Vehmanen and others    
**************************************************************************
(eca-chainsetup-parser) Buffering mode 'rt' selected.
(eca-chainsetup-parser) Enabling 'sum' mixmode.
(eca-chainsetup-parser) Truncating outputs (overwrite-mode).
(eca-chainsetup) Chainsetup "untitled-chainsetup"
(eca-chainsetup) "rt" buffering mode selected.
(eca-chainsetup) Opened input "Flute.wav", mode "read". Format: s16_le,
... channels 2, srate 44100, interleaved (locked params).
Bus error

@Jerms I tried different mp3 files that play well elsewhere. I tried them on vlc player in Ubuntu and they play well too. But for some reason Rythmbox doesn't recognize mp3. Might this be a related issue?
 
Last edited:
taita;5300543Using more steps in the playback gives various errors in the chainsetup. One of the things I'm wondering is if this could be caused by the surround51 part in the last code fragment you gave me as my soundcard has just two channels. I ordered a usb 5.1 soundcard so probably I have to wait till this arrives before I continue with this. Or do you have other suggestions?[/QUOTE said:
If you use the option "-ddd" with ecasound it will produce the maximum amount of debug and error messages. It might help you figure out the problem.

It is very possible that your 2-channel soundcard includes a 5.1 channel surround mode as part of the ALSA interface, however, if you actually try to play audio using that it may only produce an error because of the mismatch in the channel count.
 
If you use the option "-ddd" with ecasound it will produce the maximum amount of debug and error messages. It might help you figure out the problem.

It is very possible that your 2-channel soundcard includes a 5.1 channel surround mode as part of the ALSA interface, however, if you actually try to play audio using that it may only produce an error because of the mismatch in the channel count.

I received my 5.1 soundcard today and tested it with different scripts but nothing works. I am getting the bus error and resources seem to be locked. Even the simple ecasound sound.wav failed. I think I have broken the environment with my attempts to solve things.

So I plan to do it all over again and install a fresh iso. One important question comes to my mind. What do I have to do in advance of installing the libraries. Do I have to do this in root mode (sudo su) or can I just do this under the initial user?

The steps to install things on linux seem easy but just for confirmation I repeat them. In terminal enter:

Code:
sudo apt-get install alsa alsa-base alsa-utils alsa-tools libasound2-plugins
sudo apt-get install ecasound
sudo apt-get install ladspa-sdk

For the filters I use the instructions on Richard Taylors page Richard Taylor -- Thompson Rivers University

This should be sufficient to set up the environment and get sound out of my soundcard?
 
I received my 5.1 soundcard today and tested it with different scripts but nothing works. I am getting the bus error and resources seem to be locked. Even the simple ecasound sound.wav failed. I think I have broken the environment with my attempts to solve things.

So I plan to do it all over again and install a fresh iso. One important question comes to my mind. What do I have to do in advance of installing the libraries. Do I have to do this in root mode (sudo su) or can I just do this under the initial user?

The steps to install things on linux seem easy but just for confirmation I repeat them. In terminal enter:

Code:
sudo apt-get install alsa alsa-base alsa-utils alsa-tools libasound2-plugins
sudo apt-get install ecasound
sudo apt-get install ladspa-sdk

For the filters I use the instructions on Richard Taylors page Richard Taylor -- Thompson Rivers University

This should be sufficient to set up the environment and get sound out of my soundcard?

OK, we can help you. Please post the output of the following commands:
Code:
aplay -l
That is a lower case "L" in the command, above. Make sure your new soundcard is connected before running the command.
Code:
ecasound --version
Code:
echo $LADSPA_PATH
Code:
listplugins

The output will help us to check that everything is installed and configured properly.

Also, please post the ecasound commands that you are trying to run, and the output. I am sure we can get it working for you. You are very likely doing something wrong.
 
OK, we can help you. Please post the output of the following commands:
Code:
aplay -l
That is a lower case "L" in the command, above. Make sure your new soundcard is connected before running the command.
Code:
ecasound --version
Code:
echo $LADSPA_PATH
Code:
listplugins

The output will help us to check that everything is installed and configured properly.

Also, please post the ecasound commands that you are trying to run, and the output. I am sure we can get it working for you. You are very likely doing something wrong.

Thanks for your quick respons. Do you want me to do the commands in the old version or do I have to install a new iso first? Are root right needed or can I do the commonds just with my active user?
 
Run the commands as a regular user. Root level privilege should not be needed for any of this stuff and could possibly be the source of your problem. I will explain later.

Do this for whatever setup you want to investigate.

Code:
aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Device [USB Sound Device], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

ecasound --version
ecasound v2.9.1
Copyright (C) 1997-2014 Kai Vehmanen and others.
Ecasound comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of ecasound under the terms of the GNU
General Public License. For more information about these matters, see
the file named COPYING.

echo $LADSPA_PATH

listplugins
Warning: You do not have a LADSPA_PATH environment variable set.
/usr/lib/ladspa/amp.so:
    Mono Amplifier (1048/amp_mono)
    Stereo Amplifier (1049/amp_stereo)
/usr/lib/ladspa/delay.so:
    Simple Delay Line (1043/delay_5s)
/usr/lib/ladspa/sine.so:
    Sine Oscillator (Freq:audio, Amp:audio) (1044/sine_faaa)
    Sine Oscillator (Freq:audio, Amp:control) (1045/sine_faac)
    Sine Oscillator (Freq:control, Amp:audio) (1046/sine_fcaa)
    Sine Oscillator (Freq:control, Amp:control) (1047/sine_fcac)
/usr/lib/ladspa/noise.so:
    White Noise Source (1050/noise_white)
/usr/lib/ladspa/filter.so:
    Simple Low Pass Filter (1041/lpf)
    Simple High Pass Filter (1042/hpf)
echo $LADSPA_PATH gives no result.
I know I can use export LADSPA_PATH=/usr/local/lib/ladspa:/usr/lib/ladspa to store the path. But for some or another reason I have to do this every time after a rebooth.

When I do export the path and I try again to play something I get

Code:
speaker-test -D surround51:Device -c 6 -t wav
speaker-test 1.1.0

Playback device is surround51:Device
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
Playback open error: -16,Device or resource busy

Well I hope this gives the information for the right root cause.
 
Last edited:
You either have to set the LADSPA_PATH evironmental variable each time after a reboot, or you need to put it into some file that is read/run at bootup. Try putting
export LADSPA_PATH=/usr/local/lib/ladspa:/usr/lib/ladspa
at the end of your .profile file in the user home directory.

It might be that some other process is already using the soundcard or you are referring to it incorrectly. Could you please run the command:
aplay -L
This will generate more output. It is a list of all the output modes of all the soundcards. You can post all of that, or just the section for your USB soundcard.

You can also try to unplug the soundcard, wait a few seconds, and then plug it back in. This would cause any process that is using it to be terminated.

Also, what is the OS that you are using?
 
Last edited:
Code:
aplay -L
default
    Playback/recording through the PulseAudio sound server
null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions
sysdefault:CARD=Device
    USB Sound Device, USB Audio
    Default Audio Device
front:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Front speakers
surround21:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Direct sample mixing device
dsnoop:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Direct sample snooping device
hw:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Device,DEV=0
    USB Sound Device, USB Audio
    Hardware device with all software conversions
The OS is a recent version of Ubuntu mate on a RPI.

Some succes: I disconnected the soundcard and did
Code:
speaker-test -D surround51:Device -c 6 -t wav
The test played well and I could hear the test from the soundcard. But to stop the process I used ctrl Z, but that seems not to be the right method as I got errors again.
 
Last edited:
What happens if you try this:
Code:
ecasound -B:rt -i:tone,sine,400 -o:alsa,surround51:CARD=Device,DEV=0
That works well, but how do I terminate the playing?

Code:
ecasound -B:rt -z:mixmode,sum -x -i:Flute.wav -f:16,2,44100 -o:alsa,plug:surround:Device
**************************************************************************
*        ecasound v2.9.1 (C) 1997-2014 Kai Vehmanen and others    
**************************************************************************
(eca-chainsetup-parser) Buffering mode 'rt' selected.
(eca-chainsetup-parser) Enabling 'sum' mixmode.
(eca-chainsetup-parser) Truncating outputs (overwrite-mode).
(eca-chainsetup) Chainsetup "untitled-chainsetup"
(eca-chainsetup) "rt" buffering mode selected.
(eca-chainsetup) WARNING: Couldn't lock all memory!
(eca-chainsetup) Opened input "Flute.wav", mode "read". Format: s16_le,
... channels 2, srate 44100, interleaved (locked params).
ALSA lib pcm.c:2266:(snd_pcm_open_noupdate) Unknown PCM surround:Device
ERROR:  Connecting chainsetup failed: "Enabling chainsetup: AUDIOIO-ALSA:
... Unable to open ALSA-device for playback; error: No such file or
... directory"
 
Last edited:
"Device busy" is simple - your soundcard is taken by another process. In 99.9% it is pulseaudio. IMO that is also the cause for the "bus error" of ecasound.

Run

Code:
sudo lsof /dev/snd/*

and you will see your soundcard device is open by pulseaudio process.

One-time solution - run several times the command

Code:
killall pulseaudio

untill the lsof command lists no pulseaudio processes holding your soundcards.

Permanent solution - disable the soundcard in pulseaudio:

pavucontrol -> tab Settings -> choose Off for the cards you do not want pulseaudio to touch.

[xubuntu] How to make Pulseaudio use only a specific device - Page 2
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.