From: Takashi Iwai Subject: Re: rate plugin issue Date: Tue, 13 Nov 2007 04:20:27 +0100 Message-ID: References: <4738A89D.9060601@aknet.ru> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 3DFF72464D for ; Tue, 13 Nov 2007 08:05:13 +0100 (CET) In-Reply-To: <4738A89D.9060601@aknet.ru> 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: Stas Sergeev Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Mon, 12 Nov 2007 22:25:17 +0300, Stas Sergeev wrote: > > Hello. > > Takashi Iwai wrote: > > I committed your patch now on HG tree, as it's likely OK from the > > possible breakage on other apps, too. > OK, first I have to apologize for > not providing a test-case - its still > in my todo if you need it. There are > still a few things unclear, like, for > example, how it fixes the portaudio, > if, as you say, such an apps are not > touching the code in question. > > Anyway... as I said already, there are > few more problems that were hidden > before and are not any more. (I really > tried to warn you :) > For example, mpg123 will now consume > 100% of CPU because of the nasty loop > in snd_pcm_write_areas()... > I am using something like the attached > patch, but maybe you can come up with > the better solution. > Quick summary: mpg123 sets avail_min=1, > so the loop spins without any rest. > Before, the value was "adjusted", so > it didn't spin that nasty way. The problem is that the condition of poll() is indeed broken without the hack. That is, it's no problem of snd_pcm_write_areas(). snd_pcm_write_areas() just calls snd_pcm_wait(), which calls nothing but poll(). If your program calls poll() by itself, you would see the similar problem. > > Anyway, I swear that I'll never read any mails during my next > > vacation. That was so exhausting to be dragged to a lengthy > > discussion for band-aiding a badly designed compoment... :) > But now, unfortunately, you won't get > away from that. :) > The hack used to cover more problems... True, it should be fixed in a better way. thanks, Takashi