From patchwork Tue Mar 18 22:13:02 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Henningsson X-Patchwork-Id: 3849621 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 DCBD09F369 for ; Tue, 18 Mar 2014 22:13:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 08F60202EB for ; Tue, 18 Mar 2014 22:13:24 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 6BADA202A1 for ; Tue, 18 Mar 2014 22:13:22 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 70605264F19; Tue, 18 Mar 2014 23:13:20 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 46509261B2A; Tue, 18 Mar 2014 23:13:10 +0100 (CET) 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 7D2AA2625CF; Tue, 18 Mar 2014 23:13:09 +0100 (CET) Received: from youngberry.canonical.com (youngberry.canonical.com [91.189.89.112]) by alsa0.perex.cz (Postfix) with ESMTP id 152B1261B20 for ; Tue, 18 Mar 2014 23:13:03 +0100 (CET) Received: from hd9483857.selulk5.dyn.perspektivbredband.net ([217.72.56.87] helo=[192.168.8.102]) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1WQ2Fq-0003mL-IY; Tue, 18 Mar 2014 22:13:02 +0000 Message-ID: <5328C4EE.4010807@canonical.com> Date: Tue, 18 Mar 2014 23:13:02 +0100 From: David Henningsson User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: Takashi Iwai References: <1395152876-28480-1-git-send-email-tiwai@suse.de> <53287211.1040803@canonical.com> In-Reply-To: Cc: alsa-devel@alsa-project.org Subject: Re: [alsa-devel] [PATCH] pcm: route: Don't handle no matching chmap as a serious error X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list 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 On 03/18/2014 05:34 PM, Takashi Iwai wrote: > At Tue, 18 Mar 2014 17:19:29 +0100, > David Henningsson wrote: >> >> On 03/18/2014 03:27 PM, Takashi Iwai wrote: >>> When find_matching_chmap() returns an error for the non-matching >>> chmap, the caller, snd_pcm_route_open(), also returns an error >>> although it shouldn't be handled as the fatal error. This results in >>> the probe error with PulseAudio and it gives no real output in the >>> end. >> >> Hmm, could you give a more specific example? In case the driver does not >> support channel maps at all, that case is handled in the beginning of >> the function. > > Well, the problem is that PulseAudio doesn't work at all with the > current alsa-lib git prior to the commit in some cases. That is, the > commit brought some incompatibility. Hmm, then the error should be somewhere in determine_chmap instead. tt_chmap should be NULL (i e, find_matching_chmap is never called) for using the standard number syntax instead of the new chmap syntax. What about the patch attached instead (untested) ? >> So this only happens if the driver supports channel maps, but only >> non-compatible with the requested map. In which case I believe it's >> correct that the probing should fail...? > > Could you check whether PA 5.0 works as is with alsa-lib git (before > the last fix)? It could be seen on some desktop machines. Let me know if the attached patch works for you. In case it does not I will do this testing later. > > > Takashi > >> >>> >>> Signed-off-by: Takashi Iwai >>> --- >>> src/pcm/pcm_route.c | 4 +--- >>> 1 file changed, 1 insertion(+), 3 deletions(-) >>> >>> diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c >>> index ab17fa78be2c..ac11bdc8adfd 100644 >>> --- a/src/pcm/pcm_route.c >>> +++ b/src/pcm/pcm_route.c >>> @@ -940,10 +940,8 @@ static int find_matching_chmap(snd_pcm_t *spcm, snd_pcm_chmap_t *tt_chmap, >>> >>> snd_pcm_free_chmaps(chmaps); >>> >>> - if (*found_chmap == NULL) { >>> + if (*found_chmap == NULL) >>> SNDERR("Found no matching channel map"); >>> - return -EINVAL; >>> - } >>> return 0; >>> } >>> >>> >> >> >> >> -- >> David Henningsson, Canonical Ltd. >> https://launchpad.net/~diwic >> > From 746358818ead057a32330f7c8510cb65a7059e86 Mon Sep 17 00:00:00 2001 From: David Henningsson Date: Tue, 18 Mar 2014 23:07:19 +0100 Subject: [PATCH] route: Return NULL in case of zero found channels in determine_chmap This should fix the problem where the old route syntax can no longer be opened. Signed-off-by: David Henningsson --- src/pcm/pcm_route.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pcm/pcm_route.c b/src/pcm/pcm_route.c index ac11bdc..a9097ca 100644 --- a/src/pcm/pcm_route.c +++ b/src/pcm/pcm_route.c @@ -883,7 +883,10 @@ static int determine_chmap(snd_config_t *tt, snd_pcm_chmap_t **tt_chmap) } } - + if (chmap->channels == 0) { + free(chmap); + chmap = NULL; + } *tt_chmap = chmap; return 0; -- 1.7.9.5