From patchwork Fri Jun 13 06:59:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey X-Patchwork-Id: 4347351 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1FD6D9F314 for ; Fri, 13 Jun 2014 07:00:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3542520265 for ; Fri, 13 Jun 2014 07:00:19 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id D2E22201B9 for ; Fri, 13 Jun 2014 07:00:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id C87BA2618ED; Fri, 13 Jun 2014 09:00:16 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,FROM_EXCESS_BASE64,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 13B5D261703; Fri, 13 Jun 2014 09:00:08 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 7E664261718; Fri, 13 Jun 2014 09:00:06 +0200 (CEST) Received: from f39.i.mail.ru (f39.i.mail.ru [94.100.178.227]) by alsa0.perex.cz (Postfix) with ESMTP id 2697F2616C9 for ; Fri, 13 Jun 2014 08:59:58 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mail.ru; s=mail2; h=References:In-Reply-To:Content-Transfer-Encoding:Content-Type:Message-ID:Reply-To:Date:Mime-Version:Subject:To:From; bh=iB1feHEO7ENyuYj17c75WYfd3dkDbtNFRWMjj0ourWs=; b=tG++saU5rNzTlsq3qwS+2wUvMKxXFZ2VcmEKx4FH6iPyB5Tf0LcCsjmiaJkmst5ILPONZZPDN5KzDhgBy4yuWqPA1Tc1QokzOJzY5zEh71cMQ4OwdQPACS31McACImRHLGIRxolx+YkcKQBk+m1otVDyxzsIiNy3TCop7RC9izM=; Received: from mail by f39.i.mail.ru with local (envelope-from ) id 1WvLSv-0006J5-IF for alsa-devel@alsa-project.org; Fri, 13 Jun 2014 10:59:57 +0400 Received: from [85.198.167.125] by e.mail.ru with HTTP; Fri, 13 Jun 2014 10:59:57 +0400 From: =?UTF-8?B?U2VyZ2V5?= To: =?UTF-8?B?YWxzYS1kZXZlbA==?= Mime-Version: 1.0 X-Mailer: Mail.Ru Mailer 1.0 X-Originating-IP: [85.198.167.125] Date: Fri, 13 Jun 2014 10:59:57 +0400 X-Priority: 3 (Normal) Message-ID: <1402642797.26748747@f39.i.mail.ru> X-Mras: Ok X-Spam: undefined In-Reply-To: <1402642371.496174944@f39.i.mail.ru> References: <1402642371.496174944@f39.i.mail.ru> Subject: [alsa-devel] =?utf-8?q?=5BPATCH_2/2=5D_aplay=3A_Escape_from_pcm?= =?utf-8?q?=5Fwrite=28=29_when_in=5Faborting_state?= X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: =?UTF-8?B?U2VyZ2V5?= List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP This patch fixes aplay freezing and not responding to Ctrl+C when playback pcm is stuck and returns 0 to write attempts: Example: # aplay -vvv /dev/zero pcm.!default { type plug slave.pcm { type null } slave.format S32_LE } --- aplay/aplay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aplay/aplay.c b/aplay/aplay.c index 77e40a3..a5b9c2a 100644 --- a/aplay/aplay.c +++ b/aplay/aplay.c @@ -1921,7 +1921,7 @@ static ssize_t pcm_write(u_char *data, size_t count) count = chunk_size; } data = remap_data(data, count); - while (count > 0) { + while (count > 0 && !in_aborting) { if (test_position) do_test_position(); check_stdin();