From: Takashi Iwai Subject: Recording problem with pulse plugin Date: Wed, 15 Oct 2008 12:14:19 +0200 Message-ID: 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 (cantor2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 250F0103806 for ; Wed, 15 Oct 2008 12:15:52 +0200 (CEST) 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: Lennart Poettering Cc: alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org Hi Lennart, I got a bug report about the recording with pulse alsa-plugin. It gets just -EIO error. I checked it, and can reproduce it actually. The problem appears to happen since 1.0.18rc1, and the affecting commit is: commit 90c32999189cf6f5c63f40dadb8076eca379713b Author: Lennart Poettering Date: Fri Jul 18 21:45:47 2008 +0200 send both an uncork and a trigger in _start() The problem is that pa_stream_trigger() returns NULL for capture. I made a quick fix for this (the patch attached below), but not entirely sure whether it's the right thing. Please check. thanks, Takashi diff --git a/pulse/pcm_pulse.c b/pulse/pcm_pulse.c index a5f794f..3d15ff0 100644 --- a/pulse/pcm_pulse.c +++ b/pulse/pcm_pulse.c @@ -145,18 +145,15 @@ static int pulse_start(snd_pcm_ioplug_t * io) u = pa_stream_trigger(pcm->stream, pulse_stream_success_cb, pcm->p); - if (!u) { - pa_operation_unref(o); - err = -EIO; - goto finish; - } pcm->underrun = 0; err_o = pulse_wait_operation(pcm->p, o); - err_u = pulse_wait_operation(pcm->p, u); + if (u) + err_u = pulse_wait_operation(pcm->p, u); pa_operation_unref(o); - pa_operation_unref(u); + if (u) + pa_operation_unref(u); if (err_o < 0 || err_u < 0) { err = -EIO;