[PlanetCCRMA] ecasound control interface problem

francis keyes fkeymo at gmail.com
Tue Sep 2 13:15:40 PDT 2008

Hi All,

Sorry for the cross/multiple posts.  I have a C program that uses
libecasoundc to control 4 oscillators in ecasound.  I took a break from
developing this for about a year.  I have recently returned to it and I'm
finding that ecasound stops running very early in the program.    A year ago
this code was working very well on a Fedora core 5 machine with Planet ccrma
kernel and ecasound  Now I am running Fedora 8 with ccrma but the
same code only runs for about 5 seconds before ecasound stops.  I set the
ECASOUND_LOGFILE environment variable and found this after about 5 seconds
in operation:

[OBJECTS ] (eca-control) command: q <17850>

...after which there are a bunch of messages that indicate ecasound is
stoppng.  I definitely haven't programmed in that command.  Why would that
show up?
I've compiled the example c program from the ECI guide and found similar
behaviour.  I have included at the end of this email a small test c program
that produces these results on my system.

Any help is greatly appreciated.

Thanks a lot,

Current system info:

Hardware: Pentium 4, 1.5 G RAM
OS: Fedora 8, ccrma
#rpm -qa | grep ecasound:
libecasoundc- ccrma


#include <stdio.h>
#include <unistd.h>
#include <ecasoundc.h>
#include <unistd.h>             /*sleep */

//COMPILE: gcc -g -o example example.c `libecasoundc-config --cflags --lib`

main (int argc, char *argv[])

//start jack
  system ("jackd -R -dalsa -dhw:0 -r44100 -p1024 -n2 2>&1 &");
  sleep (3);
//ecasound stuff
  eci_init ();
  eci_command ("cs-add waveup_cs");

  //oscillator 1
  eci_command ("c-add osc1");
  eci_command ("ai-add null");
  eci_command ("ao-add jack_generic,osc1");
  eci_command ("cop-add -el:sine_fcac,0,0");
  eci_command ("copp-select 1");
  eci_command_float_arg ("copp-set", 440);
  eci_command ("copp-select 2");
  eci_command_float_arg ("copp-set", 5);
  eci_command ("cop-add -ea:150");
  eci_command ("ctrl-add -kos:1,25,50,1,0");
  eci_command ("ctrlp-select 4");
  eci_command_float_arg ("ctrlp-set", 1);

  eci_command ("cs-connect");
  eci_command ("start");
  usleep (500000);

  //connect jack outputs
  system ("jack_connect ecasound:osc1_1 alsa_pcm:playback_1");
  usleep (500000);

  while (1)
      int i;

      for (i = 60; i <= 400; i++)
      eci_command ("c-select osc1");
      eci_command ("cop-select 1");
      eci_command ("copp-select 1");
      eci_command_float_arg ("copp-set", i);
      for (i = 400; i >= 60;i--)
      eci_command ("c-select osc1");
      eci_command ("cop-select 1");
      eci_command ("copp-select 1");
      eci_command_float_arg ("copp-set", i);

      eci_command ("engine-status");
      if (strcmp (eci_last_string (), "running") != 0) {
        puts ("ECASOUND STOPPED!");

  eci_command ("stop");
  eci_command ("cs-disconnect");
  eci_command ("cop-status");
  printf ("Chain operator status: %s", eci_last_string ());
  eci_cleanup ();

  return (0);
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://ccrma-mail.stanford.edu/pipermail/planetccrma/attachments/20080902/a1b604ee/attachment.html 

More information about the PlanetCCRMA mailing list