From patchwork Mon Nov 28 09:55:23 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jussi Laako X-Patchwork-Id: 9449573 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3A22260235 for ; Mon, 28 Nov 2016 14:16:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2938F27CEA for ; Mon, 28 Nov 2016 14:16:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D8DA27D0C; Mon, 28 Nov 2016 14:16:19 +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=-1.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 61B8E27CEA for ; Mon, 28 Nov 2016 14:16:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 5DB4A266E6D; Mon, 28 Nov 2016 15:16:16 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 62A47266E76; Mon, 28 Nov 2016 15:13:58 +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 5E37A266D5B; Mon, 28 Nov 2016 10:55:26 +0100 (CET) Received: from mail.sonarnerd.net (rankki.sonarnerd.net [83.145.240.118]) by alsa0.perex.cz (Postfix) with ESMTP id A7707266D44 for ; Mon, 28 Nov 2016 10:55:24 +0100 (CET) Received: from [IPv6:fc00::2] (porkkala.uworld [IPv6:fc00::2]) by mail.sonarnerd.net (Postfix) with ESMTP id ED8242310F8; Mon, 28 Nov 2016 11:55:23 +0200 (EET) To: Michael Trimarchi , Antonio Ospite References: From: Jussi Laako Message-ID: Date: Mon, 28 Nov 2016 11:55:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Cc: Takashi Iwai , "alsa-devel@alsa-project.org" Subject: Re: [alsa-devel] [PATCH] hiface: Fix sample rate changes 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 Hi, > Can you please sent it inline? Not having access at the hardware now > but Antonio should have it Sure! I have tested this with my hiFace... - Jussi From f4eec5602d86b5f938abed48a5725f59141d32cd Mon Sep 17 00:00:00 2001 From: Jussi Laako Date: Mon, 28 Nov 2016 01:11:46 +0200 Subject: [PATCH] Fix M2Tech hiFace driver sampling rate change Sampling rate changes after first set one are not reflected to the hardware, while driver and ALSA think the rate has been changed. Fix the problem by properly stopping the interface at the beginning of prepare call, allowing new rate to be set to the hardware. This keeps the hardware in sync with the driver. Signed-off-by: Jussi Laako --- sound/usb/hiface/pcm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index 2c44139..33db205 100644 --- a/sound/usb/hiface/pcm.c +++ b/sound/usb/hiface/pcm.c @@ -445,6 +445,8 @@ static int hiface_pcm_prepare(struct snd_pcm_substream *alsa_sub) mutex_lock(&rt->stream_mutex); + hiface_pcm_stream_stop(rt); + sub->dma_off = 0; sub->period_off = 0;