From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Shane Blaser Newsgroups: gmane.comp.audio.sox.devel Subject: Re: Adjusting write buffer for recording Date: Sun, 11 Aug 2013 22:11:44 -0700 Message-ID: References: <20130811171034.GB26948@www.stare.cz> Reply-To: sox-devel@lists.sourceforge.net NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============7339399479028646973==" X-Trace: ger.gmane.org 1376284321 22059 80.91.229.3 (12 Aug 2013 05:12:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 Aug 2013 05:12:01 +0000 (UTC) To: sox-devel@lists.sourceforge.net Original-X-From: sox-devel-bounces@lists.sourceforge.net Mon Aug 12 07:12:03 2013 Return-path: Envelope-to: gcasd-sox-devel@m.gmane.org X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=PKBrlkfSYxqB/Nm/G1EamVJBJkTVrZjzvjvnvG+cA0k=; b=cEINYui2vTfZC1uwI1089gJZ1+kQPjfTjXxHnedmd5ka9EyuCqx7eb7gSTFOy8H7k7 vXs62iXl2Gh04b4pOUmlCqOnz27avQD/ZyB76mSHAO8BonUq37wXnJ0kmGNqdRMJYntA wX4sLROZXAWSSKBz7SczR5VITWp1wPOHViqJ2UsC+YSuuLbbCgLGsBFKvULepaf5+ZmO z7yP5pacXLJddPaorpuqqTAWylgCBvMkWp5GmxurKERSaC6UrqZdrCkwuL7jr73FBJ/l la4h1cD8z4nHn5j71VACWvdJUDrnZQcesQ1SZHLboK+4gUodpYIFcOiJNd2qjafhwhwe 8c9A== X-Gm-Message-State: ALoCoQlFyye5/XmB72xRxZ4d8ZYFPo2ZywyPYH1CD903KgCKaXg3+Z7v9ir39ktw0eLWQBezWAWX X-Received: by 10.66.182.229 with SMTP id eh5mr11948806pac.139.1376284305069; Sun, 11 Aug 2013 22:11:45 -0700 (PDT) In-Reply-To: <20130811171034.GB26948@www.stare.cz> X-Spam-Score: 1.0 (+) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.192.172 listed in list.dnswl.org] 1.0 HTML_MESSAGE BODY: HTML included in message X-Headers-End: 1V8kQ2-0000X9-VW X-BeenThere: sox-devel@lists.sourceforge.net X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: sox-devel-bounces@lists.sourceforge.net Xref: news.gmane.org gmane.comp.audio.sox.devel:311 Archived-At: Received: from lists.sourceforge.net ([216.34.181.88]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1V8kQE-0007lr-6J for gcasd-sox-devel@m.gmane.org; Mon, 12 Aug 2013 07:12:02 +0200 Received: from localhost ([127.0.0.1] helo=sfs-ml-4.v29.ch3.sourceforge.com) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V8kQ6-0006LT-4s; Mon, 12 Aug 2013 05:11:54 +0000 Received: from sog-mx-2.v43.ch3.sourceforge.com ([172.29.43.192] helo=mx.sourceforge.net) by sfs-ml-4.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1V8kQ4-0006LG-5I for sox-devel@lists.sourceforge.net; Mon, 12 Aug 2013 05:11:52 +0000 Received: from mail-pd0-f172.google.com ([209.85.192.172]) by sog-mx-2.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1V8kQ2-0000X9-VW for sox-devel@lists.sourceforge.net; Mon, 12 Aug 2013 05:11:52 +0000 Received: by mail-pd0-f172.google.com with SMTP id z10so2920931pdj.31 for ; Sun, 11 Aug 2013 22:11:45 -0700 (PDT) Received: by 10.70.10.67 with HTTP; Sun, 11 Aug 2013 22:11:44 -0700 (PDT) Received: by 10.70.10.67 with HTTP; Sun, 11 Aug 2013 22:11:44 -0700 (PDT) --===============7339399479028646973== Content-Type: multipart/alternative; boundary=047d7bb0440a1d2edc04e3b9295e --047d7bb0440a1d2edc04e3b9295e Content-Type: text/plain; charset=ISO-8859-1 Rec writes to a file I watch the file. I listen to the sound coming in and watch the file size. There is a period of silence then when volume rises the file is written to. But this introduces a delay I can not afford I have adjusted the buffer down to 128 ( below that I get constant overrun) I see no change in the file writing.... On Aug 11, 2013 10:10 AM, "Jan Stary" wrote: > On Aug 09 14:05:32, shane.blaser@callfire.com wrote: > > Hello I have an application that processes audio as rec writes the file. > > Does this mean that rec(1) writes into a pipe > and your application is reading that pipe? > > > rec is buffering the data before it writes and I get > > the updates about 2 or 3 seconds late. > > How do you know that? How exactly are you reading > what rec(1) is writing? > > > I have played with the --buffer pram and I not been able to see a > > difference. > > > > I would like to tell rec to write the data as soon as it gets it or > reduce > > the file write buffer size. > > That's what --buffer is supposed to do ... > > > I have silence detection on > > rec -c 1 -r 8000 --buffer 4096 currentRecording.wav silence 1 0.0001 > 2.1% 1 > > 15.0 2.6% > > > > The writes look like this > > > > Size of currentRecording.wav = 24576 Size of currentRecording.wav = > 36864 > > *Size* *of* *currentRecording.wav* *=* *45056* *Size* *of* * > > currentRecording.wav* *=* *77824* > > The steps are indeed multiples of 4096. > Can you try with other --buffer to see > if the data becomes available to your application > in the chunks that rec(1) is writing? > > > > ------------------------------------------------------------------------------ > Get 100% visibility into Java/.NET code with AppDynamics Lite! > It's a free troubleshooting tool designed for production. > Get down to code-level detail for bottlenecks, with <2% overhead. > Download for free and get started troubleshooting in minutes. > http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk > _______________________________________________ > SoX-devel mailing list > SoX-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/sox-devel > --047d7bb0440a1d2edc04e3b9295e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

Rec writes to a file I watch the file.

I listen to the sound coming in and watch the file size.=A0 = There is a period of silence then when volume rises the file is written to.= =A0 But this introduces a delay I can not afford

I have adjusted the buffer down to 128 ( below that I get co= nstant overrun)=A0 I see no change in the file writing....

On Aug 11, 2013 10:10 AM, "Jan Stary" = <hans@stare.cz> wrote:
On Aug 09 14:05:32, shane.blas= er@callfire.com wrote:
> Hello I have an application that processes audio as rec writes the fil= e.

Does this mean that rec(1) writes into a pipe
and your application is reading that pipe?

> rec is buffering the data before it writes and I get
> the updates about 2 or 3 seconds late.

How do you know that? How exactly are you reading
what rec(1) is writing?

> I have played with the --buffer pram and I not been able to see a
> difference.
>
> I would like to tell rec to write the data as soon as it gets it or re= duce
> the file write buffer size.

That's what --buffer is supposed to do ...

> I have silence detection on
> rec -c 1 -r 8000 --buffer 4096 currentRecording.wav silence 1 0.0001 2= .1% 1
> 15.0 2.6%
>
> The writes look like this
>
> =A0 Size of currentRecording.wav =3D 24576 =A0Size of currentRecording= .wav =3D 36864
> *Size* *of* *currentRecording.wav* *=3D* *45056* =A0*Size* *of* *
> currentRecording.wav* *=3D* *77824*

The steps are indeed multiples of 4096.
Can you try with other --buffer to see
if the data becomes available to your application
in the chunks that rec(1) is writing?


---------------------------------------------------------------------------= ---
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead.
Download for free and get started troubleshooting in minutes.
http://pubads.g.doubleclick.net/gam= pad/clk?id=3D48897031&iu=3D/4140/ostg.clktrk
_______________________________________________
SoX-devel mailing list
SoX-devel@lists.sourcefo= rge.net
https://lists.sourceforge.net/lists/listinfo/sox-devel
--047d7bb0440a1d2edc04e3b9295e-- --===============7339399479028646973== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------------ Get 100% visibility into Java/.NET code with AppDynamics Lite! It's a free troubleshooting tool designed for production. Get down to code-level detail for bottlenecks, with <2% overhead. Download for free and get started troubleshooting in minutes. http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk --===============7339399479028646973== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ SoX-devel mailing list SoX-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sox-devel --===============7339399479028646973==--