From mboxrd@z Thu Jan 1 00:00:00 1970 From: Raymond Yau Subject: Re: Hang in snd_pcm_writei with alsa-pulse plugin Date: Tue, 2 Nov 2010 16:23:58 +0800 Message-ID: References: <20101101013819.GA22823@flim.org> <4CCEF918.90807@colin.guthr.ie> <20101102044421.GA2588@flim.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-ey0-f179.google.com (mail-ey0-f179.google.com [209.85.215.179]) by alsa0.perex.cz (Postfix) with ESMTP id 6F4E11037F3 for ; Tue, 2 Nov 2010 09:23:58 +0100 (CET) Received: by eyg24 with SMTP id 24so3451488eyg.38 for ; Tue, 02 Nov 2010 01:23:58 -0700 (PDT) In-Reply-To: <20101102044421.GA2588@flim.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org 2010/11/2 Matthew Gregan > At 2010-11-02T10:43:54+0800, Raymond Yau wrote: > > No much response because there are bugs in atest2.c > > > > /* prefill sound buffers and begin playback */ > > fill(pcm); > > > > while (++count) { > > > > The program had filled the buffer but the output does not indicate those > > write > > This doesn't affect the result of the testcase. count is only used to > pause > and resume less frequently than every iteration of the write loop. > > > I can confirm that the program seem hang after a few pause/unpause when > > using alsa-pulse plugin > > > > However it assert when using hw device > > > > assert(bsize / psize >= 4); > > The assert is present because I've only tested on systems where this > assertion holds true. It's likely that the loop timing would need to be > changed to work correctly in other cases. > > Thanks for confirming that you can reproduce the problem. I've since > discovered that it's possible to produce the same problem with the > PulseAudio API directly, so I'll take this up on pulseaudio-discuss@. > > Cheers, > -mjg > The interesting thing is it did not hang when I increase the sleep time to one period /* sleep for half a period */ + usleep(psize * 1000000 / RATE ); - usleep(psize * 1000000 / RATE /2 );