diyAudio logo

LINUX Audio Ecasound


Ecasound

Rev.1 3/19/2009 :
Rev.2 6/22/2009 : liboil for sse optimizations added, stripped down compile option for Alsa only output

Ecasound is a commandline music production tool. It is optimized for realtime operation.
It allows for routing and mixing of traffic and of course comes with a great set of manipulation features.

Sonically it is the best audio tool under Linux. It allows for lowest latency operation. It can easily be integrated with
Jack.It can also be used as an alternative output engine for music player daemon

You`ll find it here: https://ecasound.seul.org/ecasound/

Read the documentation and example section at the side to get an idea what can be done with ecasound.

Installation:

I strongly recommend to install it from sources, as usual the Ubuntu repo is at least two releases behind the latest stable release offered by ecasound:

1. Repo install : sudo apt-get install ecasound

2. Install all needed dev-libraries (below libs pretty much cover everything needed to get most of the audio software compiled from sources also sox, alsa...)


sudo apt-get install module-assistant build-essential fakeroot dh-make debhelper debconf libstdc++5 linux-headers-$(uname -r) kernel-package libncurses5-dev bin86 \
libncursesw5-dev smbfs nfs-common dkms git-core fftw3 subversion flex smbfs w32codecs libdvdcss2 \
cpufrequtils fftw3-dev flex libbio2jack0 libbio2jack0-dev samplerate-programs prelink powertop \
alsa-base alsa-oss alsa-utils alsa-tools alsa-tools-gui libasound2 libasound2-dev libasound2-plugins aconnectgui \
libavcodec-dev libavformat-dev libavutil-dev libmpeg4ip-dev liba52-0.7.4-dev \
sox ecasound libsysfs-dev libncurses5-dev gettext python-all-dev xmlto libpulse-dev libspeex-dev \
libavcodec-dev libavformat-dev libavutil-dev libmpeg4ip-dev liba52-0.7.4-dev \
flac libflac++-dev libflac++6 libflac-dev libflac8 libmad0 libmad0-dev libnjb5 \
libogg-dev libogg0 libao-dev libao2 libsamplerate0-dev libwavpack-dev libwavpack1 libpng12-0 libpng12-dev \
fop libsaxon-java xalan mikmod mp3-encoder mpg321 mp3-decoder swh-plugins ladspa-plugin timidity vorbis-tools libasound2-doc \
libglib2.0-doc libraw1394-doc libsox-fmt-all autoconf libcurl3 libcurl3-dev \
libpulse-dev libshout3-dev libspeex-dev libjack0.100.0-dev libbio2jack0-dev libmikmod2-dev zlib1g-dev libid3tag0-dev \
libavcodec-dev libavformat-dev libavutil-dev libmp4v2-dev libmpeg4ip-dev liba52-0.7.4-dev libmad0-dev libaudio-dev \
libglib2.0-dev libogg-dev libfaac-dev libfaad-dev libflac-dev libflac++-dev libaudiofile-dev libmp3lame-dev libmpcdec-dev \
libmms-dev cvs libsndfile-dev liboil-dev

See also here: https://ecasound.seul.org/ecasound/requirements.php

3. Tarball install
cd /usr/src
Download: https://ecasound.seul.org/ecasound/download.php
cd ecsound-2.6.0
sudo ./configure --prefix=/usr
sudo make
sudo make install

4. Git install (read notes first):
cd /usr/src
sudo git-clone https://ecasound.seul.org/ecasound.git ecasound-git
cd ecasound-git
sudo autogen-vc.sh
sudo ./configure --prefix=/usr --enable-liboil
sudo make
sudo make install

Note1: use the liboil flag. It'll enable processor relevant optimisations such as sse. ( install liboil: "sudo apt-get install liboil-dev" first)
Note2: I had problems to get ecasound compiled due to some python problems. Add "--disable-pyecasound" to above "sudo ./configure ....." line


My stripped down Alsa-Only configure string:

./configure --prefix=/usr --disable-ncurses --disable-pyecasound --disable-oss --disable-arts --disable-osstrigger --disable-check --disable-largefile --disable-dbc --without-pic --disable-jack --disable-audiofile --disable-sndfile --disable-rubyecasound --disable-libsamplerate --enable-liboil


5. Configuration example music player daemon /etc/mpd.conf

audio_output {
type "pipe"
name "Pipe-eca1644"
command "ecasound -q -f:s16_le,2,44100,i -b 256 -i:stdin -o:alsaplugin,0 2>/dev/null"
enable "no"
}



6. Remote interaction

Ecasound allows remote interaction via TCP. It needs to be started in server mode. This way you can change e.g. volume during playback.


Example: ( valid for ecasound >v2.7.0-dev git)

Startstring:
ecasound --server --server-tcp-port=2868 -B:rt -b:256 -r:80 -f:$format -i:<your>.wav -o alsaplugin,0

Controlstring:
echo -e "-eadb:-6\r\n" | nc -w1 localhost 2868

-eadb:0 gets you back to 0db level!

(Note: volume control with option "-eadb" is a brandnew feature introduced in latest git (2.7.0-dev snapshot). You need to install ecasound as described in the git install section"

Lookup man pages for others options to choose from for remote interaction you can use all options as you'd use them in interactive mode..

As you can see this works on localhost and port 2868. You can also run it from a remote host, just enter the remote hostname.
You can define the remote hostname as alias in /etc/hosts on the client and server or just the enter the plain IP address ( type "ifconfig" to find out about it)

I'd recommend to configure static IP adresses, if you work in a network with permanent clients anyhow. It'll make live much easier to setup
scripted application controls and hostname aliases.

You can write a simple script to get the volume easily controlled (remove the backslashes at the beginning of the lines if you want to use below example):

\#!/bin/bash
\#
\# vol: a script to change remotely via tcp the volume of ecasound v.2.7.0-dev
\# Usage:
\# vol -6 reduces volume by 6db
\# vol 0 gets you back to 0db
\#
\# replace localhost with your musicserver ip-address or hostname alias, if you want to control ecasound from a remote machine


echo -e "-eadb:$1\r\n" | nc -w1 localhost 2868
exit 0

\# script end