From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C0C13C433F5 for ; Wed, 29 Sep 2021 07:43:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A6618613C8 for ; Wed, 29 Sep 2021 07:43:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244666AbhI2HpN (ORCPT ); Wed, 29 Sep 2021 03:45:13 -0400 Received: from mail-bn8nam12on2075.outbound.protection.outlook.com ([40.107.237.75]:55360 "EHLO NAM12-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S243252AbhI2HpK (ORCPT ); Wed, 29 Sep 2021 03:45:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oWspvIjuNodJ3guQKiF+r1fVuSMHDYCahBwMvRzhOwXeKqiXAXTjVcLNy1pEJK5v38tgXvfXrXHHBgJtCjuBnWWKA1lzwsr1YLMdhAvnNp2SBLsZY6xDt+skTGHk4RrOpc61MwJUwxHmSiWT7OibUuJvN/m+FBjMwKTXPcL4AANUomqP0Sa4cdMyE4G8JbbBxCi9hgble+7yPShdH90nDDR8tl074GhiQU00USKBPlyYf1sh2Ojz7J2E4eIG2X9ogNzWmr91VDoQWy/Ev8A+BrhEiFbhvs3LdABivl5t9d8mbr0nZuD/U6LCpx6Msqi+UJRQh4tGuxsTKHSmN3/KIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=JRgW6tpG1ufXex/XtDOEJsOCf3pNHD4BhIX3F6yGQFA=; b=b9GmkAWy5Dpi8Ka48mB+Qe7nCybVjcDkOA60p+FUgrSv8lNvh+wV/30/nFnxZElvHahjNbAuzarM5OOMSio6WzwnMjZMe1qifNDcsix2Hde8heVBlYobsxAZA209KnOBNexuCf0DVMe3SgVJzUJRtdUKtN0EzBL3OWnAL0LpSTS6Ph+H3YpBkB8PgRMfvSm52DXBLeZXGIk9lUyZ9usNBAKpIFOPr+2gBLsTgOB1Gs0n8d114cox8K6DKM/hOPnUo7hXIUix0EJKTfCyO52NeZVTscuKe6ydbj+HCa4gRIoliToezsr4AbAo4dZzjXOPkO3IyThrSi3xN5nuDK1nSg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.112.35) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=nvidia.com; dmarc=pass (p=quarantine sp=none pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JRgW6tpG1ufXex/XtDOEJsOCf3pNHD4BhIX3F6yGQFA=; b=MY5UGHaG02v39lxKcwjsiwFIwTlctLCs4rAYYpAraPSAuUyqS5Z3woXDm8b+rX8E62nUNslrSVYPRpC4af3TyxAJzF/Y+aR8RDsc9MAHF985OmUwmD50q+ZLNVd4vC7+TgzxWbqyE9iNJxfYY7yPqn1kJEUp8K6w9EmjU7fDF6G0TqMm1YuF2QG6WaWDbU3ZKrVEwqZOvO9VTOmvSOem/OHjl/0TsgJ5UNEfIkkMqsdBxX6jSbMTN1uSB8qLLblHm4dnQeeYLNmM3DY/rre2kE+Why2E6VYCPO/B91ZmAL1YE9mFCwrBimMD/UyyoqguqhwdCIZtpDgKFqAKbp1f4A== Received: from CO1PR15CA0085.namprd15.prod.outlook.com (2603:10b6:101:20::29) by DM8PR12MB5399.namprd12.prod.outlook.com (2603:10b6:8:34::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.14; Wed, 29 Sep 2021 07:43:28 +0000 Received: from CO1NAM11FT051.eop-nam11.prod.protection.outlook.com (2603:10b6:101:20:cafe::8c) by CO1PR15CA0085.outlook.office365.com (2603:10b6:101:20::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4566.13 via Frontend Transport; Wed, 29 Sep 2021 07:43:28 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.112.35) smtp.mailfrom=nvidia.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 216.228.112.35 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.112.35; helo=mail.nvidia.com; Received: from mail.nvidia.com (216.228.112.35) by CO1NAM11FT051.mail.protection.outlook.com (10.13.174.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4566.14 via Frontend Transport; Wed, 29 Sep 2021 07:43:27 +0000 Received: from DRHQMAIL107.nvidia.com (10.27.9.16) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Sep 2021 07:43:27 +0000 Received: from [10.25.99.231] (172.20.187.6) by DRHQMAIL107.nvidia.com (10.27.9.16) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 29 Sep 2021 07:43:22 +0000 Subject: Re: [PATCH 01/13] ASoC: soc-pcm: Don't reconnect an already active BE To: Pierre-Louis Bossart , , , , , , , , , , CC: , , , , , References: <1630056839-6562-1-git-send-email-spujar@nvidia.com> <1630056839-6562-2-git-send-email-spujar@nvidia.com> From: Sameer Pujar Message-ID: <70422e52-89d2-d926-b3f9-be59780d464e@nvidia.com> Date: Wed, 29 Sep 2021 13:13:19 +0530 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-GB X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To DRHQMAIL107.nvidia.com (10.27.9.16) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bd6ae3ec-5093-4aad-9366-08d9831cd36a X-MS-TrafficTypeDiagnostic: DM8PR12MB5399: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ELPoJionqhUIrWNjEfQ2Jyjsel5Apr2qE492pZUguaxqw72ObFXln5rjJR7Xqtyxy8OI4bkLOX4ux6ZdjTvAX8Q2fVIcV9Ek0+tLJ6r2+Za4uD23oUXuupvjWnLg1S63i8vHB7oNBFdh4DzL+iGKLd4ssTPDfUF5kUBSiM4YP/dPJiOXiP/vsAhjk20RELI03M6aJIzorTRNWc0ED/tNEYv2VhIVbfvzhLB3eOo9j+MTPZq6WUsDUxLFyeu+jQC2KhhLlRNtpE3WSndtlGmHj8D+w5wCTGMhitEzhYA+JM7uwb0ffpkbKDSHPt3yPnRT0361mC9aZDEukN3P1FsPA/RtasRx+ta0l97KxQjZzdSQ28mMaNCxAZfan/fz6BQyWocLWIskZkOkfm7HxqM7zPwiRqB78YBINgLiskUtQumX1APJBGpvPtaMdmma17gEOYg77+JiPB5iCAMbakBb6JkkBKSDHGftmU4IVXT+oESMPgE/7qmxMWVvcQfLDlmOElH/i1b7lI9Hsf31PD0WQsBIYXXK8UzG4FCmP96EZvRG8ajOSZdvS3kXJDLrVpwMCdlIr+hAzgrsoeESbEUopaixDMv0TTkmOyIWMZCxTWgLOXKDvoZuzmMj9ucFOwO4c4Qqvabr1RXQ9J/2M5RtM6E3KKclx4xn9uwHKeyskT8UfTVXZlpQAJ+FQNBkje+PpzQeWMtMVeaiA0eKsGSSUri/e1u++ltjPUUy9GQKuxwhn0UHHQ5TVRqw7YqQsuEO X-Forefront-Antispam-Report: CIP:216.228.112.35;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:mail.nvidia.com;PTR:schybrid02.nvidia.com;CAT:NONE;SFS:(4636009)(46966006)(36840700001)(5660300002)(83380400001)(426003)(36860700001)(31696002)(70586007)(70206006)(47076005)(6666004)(31686004)(86362001)(8936002)(54906003)(186003)(508600001)(8676002)(16526019)(36756003)(2616005)(4326008)(7416002)(336012)(26005)(921005)(316002)(53546011)(16576012)(110136005)(82310400003)(356005)(2906002)(7636003)(43740500002);DIR:OUT;SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Sep 2021 07:43:27.7778 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bd6ae3ec-5093-4aad-9366-08d9831cd36a X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a;Ip=[216.228.112.35];Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT051.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM8PR12MB5399 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/29/2021 2:55 AM, Pierre-Louis Bossart wrote: > On 8/27/21 4:33 AM, Sameer Pujar wrote: [...] > But in addition we'd need to agree on what an 'active BE' is. Why can't > we connect a second stream while the first one is already in HW_PARAMS > or PAUSED or STOP? It's perfectly legal in ALSA/ASoC to have multiple > HW_PARAMS calls, and when we reach STOP we have to do a prepare again. > > And more fundamentally, the ability to add a second FE on a 'active' BE > in START state is a basic requirement for a mixer, e.g. to play a > notification on one FE while listening to music on another. What needs > to happen is only to make sure that the FE and BE are compatible in > terms of HW_PARAMS and not sending a second TRIGGER_STOP, only checking > the BE NEW or CLOSE state is way too restrictive. Sorry for the trouble to your system. Idea was to avoid reconfiguration of the same BE DAI again, but not to stop the provision to add a subsequent FE. In fact I had tested mixing of streams coming from 10 different FEs. In your case, because of this patch, looks like the subsequent FE is not finding a BE DAI since it is already active due to a prior FE. The reason it works at my end is because the mixer input and output DAIs are separated. Any new FE would just configure the mixer input DAI to which it is attached and skip already running/configured output DAI. I am just curious to know, if originally you were reconfiguring the BE DAI again with same parameters (for a second FE) or some additional configuration is done? > I can send a revert with the explanations in the commit message if there > is a consensus that this patch needs to be revisited. May be this can be revisited since it appears to be a critical problem for your system. But I hope this discussion can be alive on following points for a better fix. 1. The original issue at my end was not just a configuration redundancy. I realize now that with more stream addition following error print is seen.    "ASoC: too many users playback at open 4"    This is because the max DPCM users is capped at 8. Increasing this may help (need to see what number is better), but does not address the redundancy problem. 2. If reconfiguration of the same BE is not necessary for a subsequent FE run, shouldn't we avoid the reconfig itself and somehow avoid FE failure?