From patchwork Thu Mar 27 18:05:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthias Larisch X-Patchwork-Id: 3899071 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 31797BF540 for ; Thu, 27 Mar 2014 18:05:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C80792021C for ; Thu, 27 Mar 2014 18:05:50 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 1D3E320034 for ; Thu, 27 Mar 2014 18:05:49 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 73C77265484; Thu, 27 Mar 2014 19:05:47 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 25A5A265471; Thu, 27 Mar 2014 19:05:37 +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 CABC226546E; Thu, 27 Mar 2014 19:05:35 +0100 (CET) Received: from mail.mlh-server.de (mail.mlh-server.de [5.9.104.232]) by alsa0.perex.cz (Postfix) with ESMTP id DAF7E26546E for ; Thu, 27 Mar 2014 19:05:28 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.mlh-server.de (Postfix) with ESMTP id 3209530082C; Thu, 27 Mar 2014 19:05:26 +0100 (CET) Received: from mail.mlh-server.de ([127.0.0.1]) by localhost (mail.mlh-server.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id NRL6z_K2cwM3; Thu, 27 Mar 2014 19:05:26 +0100 (CET) Received: from purefruit (dslb-188-096-069-245.pools.arcor-ip.net [188.96.69.245]) (Authenticated sender: mail@matthias-larisch.de) by mail.mlh-server.de (Postfix) with ESMTPSA id A2EA130032B; Thu, 27 Mar 2014 19:05:25 +0100 (CET) Date: Thu, 27 Mar 2014 19:05:10 +0100 From: Matthias Larisch To: Message-ID: <20140327190510.5cf481d0@purefruit> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.22; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Cc: Takashi Iwai Subject: [alsa-devel] [PATCH] src/pcm/pcm_ladspa.c: Delay LADSPA plugin activate call 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 Some LADSPA Plugins rely on connected control ports on activate call. While this is not okay by spec, the spec also encourages the activate call happening as late as possible. Signed-off-by: Matthias Larisch --- src/pcm/pcm_ladspa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pcm/pcm_ladspa.c b/src/pcm/pcm_ladspa.c index 9ce5242..7d1e3df 100644 --- a/src/pcm/pcm_ladspa.c +++ b/src/pcm/pcm_ladspa.c @@ -645,8 +645,6 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l return -EINVAL; } list_add_tail(&instance->list, &plugin->instances); - if (plugin->desc->activate) - plugin->desc->activate(instance->handle); if (plugin->policy == SND_PCM_LADSPA_POLICY_DUPLICATE) { err = snd_pcm_ladspa_connect_plugin_duplicate(plugin, &plugin->input, &plugin->output, instance, idx); if (err < 0) { @@ -664,6 +662,8 @@ static int snd_pcm_ladspa_allocate_instances(snd_pcm_t *pcm, snd_pcm_ladspa_t *l assert(err >= 0); err = snd_pcm_ladspa_connect_controls(plugin, &plugin->output, instance); assert(err >= 0); + if (plugin->desc->activate) + plugin->desc->activate(instance->handle); } err = snd_pcm_ladspa_check_connect(plugin, &plugin->input, &instance->input, depth); if (err < 0)