All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jussi Laako <jussi@sonarnerd.net>
To: Takashi Iwai <tiwai@suse.de>,
	michael@amarulasolutions.com, alsa-devel@alsa-project.org
Subject: [PATCH] hiface: Fix sample rate changes
Date: Mon, 28 Nov 2016 11:27:45 +0200	[thread overview]
Message-ID: <ee24b066-41d2-ad24-8598-f15a26a743a8@sonarnerd.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 296 bytes --]

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.



[-- Attachment #2: 0001-Fix-M2Tech-hiFace-driver-sampling-rate-change.patch --]
[-- Type: text/x-patch, Size: 1005 bytes --]

>From f4eec5602d86b5f938abed48a5725f59141d32cd Mon Sep 17 00:00:00 2001
From: Jussi Laako <jussi@sonarnerd.net>
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 <jussi@sonarnerd.net>
---
 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


[-- Attachment #3: Type: text/plain, Size: 0 bytes --]



             reply	other threads:[~2016-11-28  9:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28  9:27 Jussi Laako [this message]
2016-11-28  9:51 ` [PATCH] hiface: Fix sample rate changes Michael Trimarchi
2016-11-28  9:55   ` Jussi Laako
2016-11-28 10:09     ` Michael Trimarchi
2016-11-28 14:11       ` Takashi Iwai
2016-12-12 21:49         ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ee24b066-41d2-ad24-8598-f15a26a743a8@sonarnerd.net \
    --to=jussi@sonarnerd.net \
    --cc=alsa-devel@alsa-project.org \
    --cc=michael@amarulasolutions.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.