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: 84385 Delivered-To: patch@linaro.org Received: by 10.182.1.168 with SMTP id 8csp1606698obn; Mon, 28 Nov 2016 04:10:17 -0800 (PST) X-Received: by 10.194.148.4 with SMTP id to4mr18466755wjb.194.1480335017684; Mon, 28 Nov 2016 04:10:17 -0800 (PST) Return-Path: Received: from alsa0.perex.cz (alsa0.perex.cz. [77.48.224.243]) by mx.google.com with ESMTP id ay9si54208935wjc.120.2016.11.28.04.10.17; Mon, 28 Nov 2016 04:10:17 -0800 (PST) Received-SPF: pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) client-ip=77.48.224.243; Authentication-Results: mx.google.com; spf=pass (google.com: domain of alsa-devel-bounces@alsa-project.org designates 77.48.224.243 as permitted sender) smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 1B049266E21; Mon, 28 Nov 2016 13:10:15 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS autolearn=disabled version=3.4.0 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 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. _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel >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