Re: [ecasound] Multiple Instances running concurrently scaling...

From: Brian Hogg <brian@email-addr-hidden>
Date: Wed Feb 15 2006 - 15:40:16 EET

Hi Richard,

I had a similar problem with getting it to work from php. Obviously the
web user needs write access to the dir, but otherwise you need to put
this in front of the ecasound command in exec or system:

exec("export TERM=vt100; ecasound -a:1 .... ") ;

Don't ask me why. I found the TERM variable not found error in a log
file somewhere, and found a thread
http://www.eca.cx/ecasound-list/2002/08/0005.html with a similar
problem.

Regarding scaling, I contacted Tony who used to maintain the PHP
'module' for ecasound, but that hasn't been updated in a couple years
and probably won't compile against the newest versions of ecasound/php.
He did suggest to use system()/exec(), or else we could "fork a new
process and let the child interact with ecasound" depending on our
programming skills.

Of course I found when using exec or system calls, if the user hits
'stop', ecasound is still running in the background until completion.
I'm guessing if you hit refresh a couple of times fun things will
happen. My thought was wrapping the call in some sort of check, perhaps
session variables with a MySQL database, so I can have unique output
file names (no conflict with other users doing the same thing), and
checking to see if they already started producing that song file. The
original php script which is still exec'ing in the background would add
a flag to the database record when it's done, and the user could
immediately download the song if they hit refresh.

Mixing and saving a full song on my server takes at least 10 seconds,
which is quite a while for a user to wait. Have a few people doing it,
I can only imagine the server speed.

I'd be open to working together on a solution, since we both have
essentially the same goals but with different ecasound commands. Of
course, if someone on the list has a better suggestion than using
ecasound in the first place, I'd love to hear it?

And, if your final file output is not really slow (sounds like a record
on reduced speed), let me know. For some reason mine is after getting
the php portion to work and I have no idea why.

Brian

On Wed, 2006-02-15 at 02:46 -0800, Richard McCluskey wrote:
> Hello,
>
> I am a LAMP programmer writing a 'Fair Trade' digital download service,
> in PhP, for independent musicians ( www.mysongstore.com ), and I would
> like to use ecasound in one part of my system ( a part that creates a 20
> - 30 second sound clip from a 'user uploaded' file). I have some
> questions regarding ecasound's abilities and a weird execution problem.
> Please excuse me if I am overly verbose, I tried many things before I
> took to writing here... :)
>
> Here is the use overview
> ---------------------------
> I will have many simultaneous users uploading mp3s to my system, and
> each one needs to have a clip created from it, on the fly, immediately
> after PhP has passed the uploaded file to its destination directory. I
> read through your user guide and the tutorial, and got this so far :
>
> ecasound -i /path/to/upLoadedFile.mp3 -y:60
> -o /same/path/clip-upLoadedFile.mp3 -t:30
>
> (I will eventually, hopefully, also be able to create a fade-in at the
> beginning and a fade-out at the end, but I haven't figured out how to do
> that part in ecasound yet)
>
> I am then using this in my PhP program, passed to the command line
> using exec(). The clip should be created, and all good, but .....
>
> The Problem
> ------------------------
> no file is created, and nothing is logged. I have run the exact same PhP
> program from the command line itself and ecasound performed correctly
> and created the clip. However, the very same program run as a web app
> fails to create a file, a log, an error, it dies silently.
>
> the research
> -------------
> I found a wrapper for ecasound as a module for PhP
> (http://pecl.php.net/package/ecasound), but it required a PhP recompile,
> and said that it will fail if it ran in multiple instances.... which
> renders it useless for me and made me wonder if ecasound can actually do
> what I would like it to...
>
>
> Finally the questions ...
> -------------------------------------------
> 1. can ecasound handle more than one instance, like in daemon mode?
> (could it handle the simultaneous clip creations)
>
> 2. what is the memory footprint like when it scales if point 1 is true?
>
> 3. any idea why the web app fails ?
>
> 4. Am I nutz for trying in the first place ? If so can you steer me to
> somewhere I might find an app that does what I need ?
>
> thank you for any time you put to this. I understand htat I am not using
> ecasound in the manner for which it was intended, but it could really
> help me if I could get it to work. I would love to use it for
> mysongstore.com.
>
>
> best regards,
>
> Richard
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
> for problems? Stop! Download the new AJAX search engine that makes
> searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
> _______________________________________________
> Ecasound-list mailing list
> Ecasound-list@email-addr-hidden
> https://lists.sourceforge.net/lists/listinfo/ecasound-list

-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Wed Feb 15 16:15:06 2006

This archive was generated by hypermail 2.1.8 : Wed Feb 15 2006 - 16:15:06 EET