Re: [ecasound] schedule effects

From: Kai Vehmanen <kvehmanen@email-addr-hidden>
Date: Thu Jun 04 2009 - 00:54:13 EEST


On Wed, 3 Jun 2009, laurent schwartz wrote:
> I tried the following line to process recording input and, unfortunately, it freezes my computer ...
> ecasound  \
>  -a:1,2 -i alsahw,1,0,0
>  -a:1 -ea:100 -klg:1,0,100,5,0,1,5,1,5.67,0,30.67,0,31,1\
>  -a:2 -etd:250,2,2,50,50 -ea:200 -klg:1,0,100,5,0,0,18,0,18.67,1,25.67,1,26,0\
>  -a:all -o alsahw,1,0,0
> When i kill pulseaudio and i use alsahw,0,0,0 instead it works fine

if you want ecasound to access ALSA directly ("alsa,hw", "alsahw" et al),
you must stop audio servers - like Pulseaudio and JACK - that take
exclusive ownership of the audio devices. Then above command shoudl work.
If it still freezes the computer, then I suspect there is a bug in the
kernel drivers for "alsahw,1" (i.e. whatever is card #1 in your system ->
check "cat /proc/asound/cards").

In theory ecasound should play nicely with "alsa,pulse" (or "alsa,default"
if pulse is set to be the default in ~/asoundrc), but this is not widely
tested yet. There have been many bugs in the ALSA pulseaudio plugin, but
many of them have been fixed in recent releases. If you want to debug this
further, it's probably best to test playback and recording separately with
pulse to figure out what goes wrong. One practical problem can be for
instance scheduling -- if ecasound uses real-scheduing, but pulseaudio
daemon does not, this won't work at all (can freeze the whole computer).
You can disable real-time scheduling with "-r:-1" ecasound option.

> (apart from some overrun) with the following command line:
> ecasound\
>  -a:1 -i alsahw,0,0,0  -pf test.ecp\
>  -a:all -o alsahw,1,0,0
> But i suppose overrun are normal because i'm using two audio cards in the same session (synchronization problem).

Yes. Unless the sample clocks of the PCM devices are somehow synced,
there is bound to be drift and this shows up as xruns (ecasound cannot
handle the drift). For instance in studios word clock cables are used for
this purpose:

.. with PC sound cards, and internal chips, this is usually not an option,
although various DIY solutions have been tried and tested (see archives of
linux-audio-user and linux-audio-dev lists). There are also some apps that
can compensate the drift in software (e.g. jack-diplomat:

For many practical needs, just using a single multichannel soundcard is a
lot easier (and more robust) solution than trying to sync multiple cards
and/or computer. But if you really want ultracheap solutions, or are
building really huge and complex setups, or need to distribute processing
across multiple separte nodes, then you need to dive into these more
complicated solutions. Although apparently at least jack-diplomat is quite
easy to set up (but I haven't tried myself, so I could be very wrong on
this).. definitely a cool app!

OpenSolaris 2009.06 is a cutting edge operating system for enterprises
looking to deploy the next generation of Solaris that includes the latest
innovations from Sun and the OpenSource community. Download a copy and
enjoy capabilities such as Networking, Storage and Virtualization.
Go to:

Ecasound-list mailing list
Received on Thu Jun 4 04:15:01 2009

This archive was generated by hypermail 2.1.8 : Thu Jun 04 2009 - 04:15:02 EEST