From patchwork Mon Jul 22 07:24:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 11051719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B3D28138D for ; Mon, 22 Jul 2019 07:25:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 998EB28595 for ; Mon, 22 Jul 2019 07:25:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DE1722362; Mon, 22 Jul 2019 07:25:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id EE03B28574 for ; Mon, 22 Jul 2019 07:25:05 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id E59C8173C; Mon, 22 Jul 2019 09:24:13 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E59C8173C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1563780304; bh=7lRSvtlxWR5rLsMocMYvuTZu+hfFtRhkX8Em6cNozAg=; h=From:To:Date:Cc:Subject:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=A+BJ//8gSFixT1z1t+JwCts+mmD0TZ+u2zyBBeBXcbnN6sX5MIJeF2B0nPTXZEYQv c1s4xFmmnXP7g+UGFhdyv2usizyB/xllZRC5tMCvQiEnPM5cQIxhS4ytIXDr6+HgOg vPdaFPNc4hz7N8eHGVYpdIM2olRqLmnmh6fqjN1A= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 3C2E7F803F3; Mon, 22 Jul 2019 09:24:13 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id D633AF803D7; Mon, 22 Jul 2019 09:24:11 +0200 (CEST) Received: from relay1.mentorg.com (relay1.mentorg.com [192.94.38.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 08CC2F803D1 for ; Mon, 22 Jul 2019 09:24:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 08CC2F803D1 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hpSfy-0002G4-5N from Jiada_Wang@mentor.com ; Mon, 22 Jul 2019 00:24:02 -0700 Received: from jiwang-OptiPlex-980.tokyo.mentorg.com (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Mon, 22 Jul 2019 00:23:58 -0700 From: Jiada Wang To: , , , , Date: Mon, 22 Jul 2019 16:24:00 +0900 Message-ID: <20190722072403.11008-1-jiada_wang@mentor.com> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Cc: jiada_wang@mentor.com, twischer@de.adit-jv.com, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v1 0/3] Allow reconfiguration of clock rate X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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" X-Virus-Scanned: ClamAV using ClamSMTP There is use case in Gstreamer ALSA sink, in case of changed caps Gsreatmer reconfigs and it calls snd_pcm_hw_free() before snd_pcm_prepre(). See gstreamer1.0-plugins-base/ gst-libs/gst/audio/gstaudiobasesink.c: gst_audio_base_sink_setcaps(): - gst_audio_ring_buffer_release() - gst_audio_sink_ring_buffer_release() - gst_alsasink_unprepare() - snd_pcm_hw_free() is called before - gst_audio_ring_buffer_acquire() - gst_audio_sink_ring_buffer_acquire() - gst_alsasink_prepare() - set_hwparams() - snd_pcm_hw_params() - snd_pcm_prepare() But with current implementation after clock rate is started in .prepare reconfiguration of clock rate is not allowed, unless the stream is stopped. This patch set by move stop of clock to .hw_free callback, to allow reconfiguration of clock rate. Jiada Wang (1): ASoC: rsnd: call .hw_{params,free} in pair for same stream Timo Wischer (2): ASoC: rsnd: Support hw_free() callback at DAI level ASoC: rsnd: Allow reconfiguration of clock rate sound/soc/sh/rcar/core.c | 22 +++++++++++++-- sound/soc/sh/rcar/rsnd.h | 36 ++++++++++++++++++++---- sound/soc/sh/rcar/ssi.c | 61 +++++++++++++++++++++++++++++----------- sound/soc/sh/rcar/ssiu.c | 3 +- 4 files changed, 96 insertions(+), 26 deletions(-)