From owner-freebsd-questions Mon Apr 29 4:42:42 2002 Delivered-To: freebsd-questions@freebsd.org Received: from axel.truedestiny.net (a185066.upc-a.chello.nl [62.163.185.66]) by hub.freebsd.org (Postfix) with ESMTP id E921E37B405 for ; Mon, 29 Apr 2002 04:42:33 -0700 (PDT) Received: by axel.truedestiny.net (Postfix, from userid 1000) id 5C93749ABD; Mon, 29 Apr 2002 13:42:45 +0200 (CEST) Date: Mon, 29 Apr 2002 13:42:45 +0200 From: Axel Scheepers To: uwi mAn Cc: questions@freebsd.org Subject: Re: mpg123 Message-ID: <20020429134245.D61218@mars.thuis> Reply-To: Axel Scheepers References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from uwiman3k@hotmail.com on Thu, Apr 25, 2002 at 01:59:22PM -0400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thu, Apr 25, 2002 at 01:59:22PM -0400, uwi mAn wrote: > attempting to use mpg123 with cache: > mpg123 -b 1024 mp3 > results the following > > Yuck! Error in buffer handling....Undefined error:0 > > What can be done to solve the problem? Hi, Rather difficult to say, I looked into the source and it seems to go wrong on filling the buffer in time. buffer.c: ... if(!done) { cmd = xfermem_block(XF_READER, xf); switch(cmd) { /* More input pending. */ case XF_CMD_WAKEUP_INFO: continue; /* Yes, we know buffer is low but * know we don't care. */ case XF_CMD_WAKEUP: break; /* Proceed playing. */ case XF_CMD_TERMINATE: /* Proceed playing without * blocking any further. */ done=TRUE; break; case -1: if(errno==EINTR) continue; perror("Yuck! Error in buffer handling..."); done = TRUE; xf->readindex = xf->freeindex; xfermem_putcmd(xf->fd[XF_READER], XF_CMD_TERMINATE); break; ... The xfermem_block( XF_READER(1), xf) call goes wrong, so lets see what's in it: int xfermem_block (int readwrite, txfermem *xf) { int myfd = xf->fd[readwrite]; int result; xf->wakeme[readwrite] = TRUE; if (xf->wakeme[1 - readwrite]) xfermem_putcmd (myfd, XF_CMD_WAKEUP); result = xfermem_getcmd(myfd, TRUE); xf->wakeme[readwrite] = FALSE; return ((result <= 0) ? -1 : result); } That shows us that the call to xfermem_getcmd returns a negative value, indicating something went wrong. When you browse xfermem.c and xfermem.h you'll see it is trying to read and write to a file by issueing those calls, so it seems to me there's something wrong reading from the file. Does the problem occur on other mp3's as well? It might also help to compile it with the -g option, so that debug information is generated, then you can execute it using gdb: freebsd# gdb mpg123 gdb> run -s 1024 test.mp3 Program exited with error code -1 gdb> bt The output of the bt command shows us where exactly things start to go wrong, and might give some more clues about what is going on at the time. You can also set a breakpoint at the xfermem_block function, so you can step through the code and print the symbols values: freebsd# gdb mpg123 gdb> b xfermem_block Breakpoint set at 0x00231234 something gdb> run -s 1024 test.mp3 Breakpoint #1: xfermem_block gdb> print xf->fd[1] gdb> n int myfd = xf->fd[readwrite]; gdb> etc. ... gdb> > > > Thanks. > > > > _________________________________________________________________ > MSN Photos is the easiest way to share and print your photos: > http://photos.msn.com/support/worldwide.aspx > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message Hope it's helpfull, Gr, -- Axel Scheepers UNIX System Administrator email: axel@axel.truedestiny.net a.scheepers@iae.nl http://axel.truedestiny.net/~axel ------------------------------------------ Indifference will be the downfall of mankind, but who cares? ------------------------------------------ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message