From: Takashi Iwai Subject: Re: [patch] problem w/ arecord "split interleaved files" feature Date: Wed, 26 Apr 2006 16:11:19 +0200 Message-ID: References: <1145943804.2670.43.camel@flanders> <1145999255.7045.27.camel@flanders> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Return-path: In-Reply-To: <1145999255.7045.27.camel@flanders> Sender: alsa-devel-admin@lists.sourceforge.net Errors-To: alsa-devel-admin@lists.sourceforge.net List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , List-Archive: To: Dave Maley Cc: alsa-devel@lists.sourceforge.net List-Id: alsa-devel@alsa-project.org At Tue, 25 Apr 2006 17:07:35 -0400, Dave Maley wrote: > > Thanks for the quick response ... > > > > [dave@flanders ~]$ arecord -q -t wav -f dat -d 10800 | sox -t wav -r > > > 48000 -c 2 - -t wav -r 44100 -c 2 foo.wav resample > > > > > > > > > It seems this new split feature doesn't work properly when writing to a > > > pipe (or at least when piping to sox). A quick look at an strace shows > > > constant write errors, and foo.wav grows in size until the disk is full. > > > > I guess it's rather a bug of sox. arecord quits when the data size > > reaches to max_filesize in the case of pipe output (since obviously > > you cannot split the output). sox should quits, too, when receiving > > EPIPE error. > > Hmm, this doesn't seem to match the behavior I'm seeing. It's very > possible I'm misunderstanding something here, but this is what I see: > > Using the above arecord | sox command when the foo.wav file reaches > 2000000000 in size and the split occurs it'll actually be split into > foo-01.wav and foo-02.wav, and I believe that this rename of foo.wav to > foo-01.wav is where the problem may be occurring. I can capture strace > output at the time of the split, if it's at all helpful. I found a stupid bug there. arecord doesn't quit properly at max_filesize due to a wrong comparison. The fix patch is below. > > > A quick fix for this is to set max_filesize to 2147483648. Not sure if > > > this is a "proper" fix however I have tested it and it seems to work > > > just fine for me. Please consider the attached patch. > > > > Well, I'm not sure whether exactly 2GB is allowed. > > If not then I'd be happy with just increasing this max_filesize to > 2073600044 as that's what my 180 minute 48KHz files end up being ... 8) Maybe 2GB is OK. I'll fix it too. Takashi diff -r 2dacb18877f3 aplay/aplay.c --- a/aplay/aplay.c Wed Apr 19 12:29:49 2006 +0200 +++ b/aplay/aplay.c Wed Apr 26 16:07:21 2006 +0200 @@ -2165,13 +2165,15 @@ static void capture(char *name_) 2) all requested samples/bytes have been captured (cur>0) 3) filesize threshold was reached (fdcount0 && fdcount0 && + fdcount=fmt_rec_table[file_type].max_filesize); + } while((file_type == FORMAT_RAW && !timelimit) || + fdcount < fmt_rec_table[file_type].max_filesize); } void playbackv_go(int* fds, unsigned int channels, size_t loaded, off64_t count, int rtype, char **names) ------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642