From patchwork Mon Nov 28 09:27:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jussi Laako X-Patchwork-Id: 9449433 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 94E3D600CB for ; Mon, 28 Nov 2016 12:10:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 855832787C for ; Mon, 28 Nov 2016 12:10:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7A14927C05; Mon, 28 Nov 2016 12:10:21 +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 962602787C for ; Mon, 28 Nov 2016 12:10:17 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 183C5266E2B; Mon, 28 Nov 2016 13:10:16 +0100 (CET) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id C3E6E266C87; Mon, 28 Nov 2016 13:07:56 +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 E1727266D36; Mon, 28 Nov 2016 10:27:50 +0100 (CET) Received: from mail.sonarnerd.net (rankki.sonarnerd.net [83.145.240.118]) by alsa0.perex.cz (Postfix) with ESMTP id 9CBF1266937 for ; Mon, 28 Nov 2016 10:27:46 +0100 (CET) Received: from [IPv6:fc00::2] (porkkala.uworld [IPv6:fc00::2]) by mail.sonarnerd.net (Postfix) with ESMTP id 7EBF22310F8; Mon, 28 Nov 2016 11:27:45 +0200 (EET) To: Takashi Iwai , michael@amarulasolutions.com, alsa-devel@alsa-project.org From: Jussi Laako Message-ID: Date: Mon, 28 Nov 2016 11:27:45 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 Subject: [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 When attempting to change sample rate for the interface after first set-play cycle, the change is not reflected to the hardware, while from user space everything seems to go fine. This patch fixes the issue and the driver now behaves the same way as for example the USB Audio Class driver. 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; -- 2.7.4