Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753064AbcLAHH6 (ORCPT ); Thu, 1 Dec 2016 02:07:58 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:37658 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbcLAHH5 (ORCPT ); Thu, 1 Dec 2016 02:07:57 -0500 Subject: Re: [PATCH 2/3 v2] ALSA: usb-audio: avoid setting of sample rate multiple times on bus To: Takashi Iwai References: <20161130075923.15205-1-jiada_wang@mentor.com> <20161130075923.15205-3-jiada_wang@mentor.com> CC: , , , , From: Jiada Wang Message-ID: <2c6bb9a2-89d8-f163-ec97-5d2feed858e9@mentor.com> Date: Thu, 1 Dec 2016 16:07:07 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2233 Lines: 74 Hi Takashi On 11/30/2016 05:51 PM, Takashi Iwai wrote: > On Wed, 30 Nov 2016 08:59:22 +0100, > Jiada Wang wrote: >> >> From: Daniel Girnus >> >> ALSA usually calls the prepare function twice before starting the playback: >> 1. On hw_params call from userland and >> 2. internally when starting the stream. >> Some device are not able to manage this and they will stop playback >> if the sample rate will be configured several times over USB protocol. >> >> Signed-off-by: Jens Lorenz >> Signed-off-by: Jiada Wang > > The sign-off from Daniel seems missing? > > The code change looks OK, but it'd be nice to mention in the changelog > that, after this patch, snd_usb_init_sample_rate() is still called > properly whenever the parameter is changed since ep->need_setup_ep is > set in snd_hsb_hw_params(). > I will add missing sign-off and related information in changelog in v2 Thanks, Jiada > > thanks, > > Takashi > >> --- >> sound/usb/pcm.c | 21 +++++++++++---------- >> 1 file changed, 11 insertions(+), 10 deletions(-) >> >> diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c >> index 44d178e..a522c9a 100644 >> --- a/sound/usb/pcm.c >> +++ b/sound/usb/pcm.c >> @@ -806,17 +806,18 @@ static int snd_usb_pcm_prepare(struct snd_pcm_substream *substream) >> if (ret < 0) >> goto unlock; >> >> - iface = usb_ifnum_to_if(subs->dev, subs->cur_audiofmt->iface); >> - alts = &iface->altsetting[subs->cur_audiofmt->altset_idx]; >> - ret = snd_usb_init_sample_rate(subs->stream->chip, >> - subs->cur_audiofmt->iface, >> - alts, >> - subs->cur_audiofmt, >> - subs->cur_rate); >> - if (ret < 0) >> - goto unlock; >> - >> if (subs->need_setup_ep) { >> + >> + iface = usb_ifnum_to_if(subs->dev, subs->cur_audiofmt->iface); >> + alts = &iface->altsetting[subs->cur_audiofmt->altset_idx]; >> + ret = snd_usb_init_sample_rate(subs->stream->chip, >> + subs->cur_audiofmt->iface, >> + alts, >> + subs->cur_audiofmt, >> + subs->cur_rate); >> + if (ret < 0) >> + goto unlock; >> + >> ret = configure_endpoint(subs); >> if (ret < 0) >> goto unlock; >> -- >> 2.9.3 >> >>