Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3506013ybi; Tue, 2 Jul 2019 08:52:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqxu21cF7z47isagYKsQ/b2RaaSUlcNJBqFRyKZNLetqMY+lWIKu8PC9XtNyH5Q/+eUxbj3y X-Received: by 2002:a17:902:7247:: with SMTP id c7mr35759807pll.202.1562082761488; Tue, 02 Jul 2019 08:52:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562082761; cv=none; d=google.com; s=arc-20160816; b=zH2Hor+bD8v9T2cWXxrUCpNu5quQ0adjil0fUghxRT03YLfFJMhOTBGKHbV9nrx7ib mjluB1fwgzGFRPhVDppJzlzt9IlJargq4WjaXbM7QsKI+A+4L73J1Md2ycEj2srxt6z6 tcoMUmTjjj44QVv/4nIQajixD5yNFcLBQAJlomz9LvqXCkseY1Z0FynrKWZ3+wChjVqr 7XhDlFJvkZdr1FABAh23x82DeQWLXzcdzRCwbnMUPj4UD9XBOraGNktSv+JGEnImryJV brwEGGph1CNMAJ3ALAYJ49yUJ7rn1qYTmJnzaCCIFSyNpFlpyLLHGuUwcYrdtqkA0Ota VybA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=n14B6+0Fl6N8F9ay53yN6oVGwn6aG20C/Sgu+qBo2Uc=; b=rFvog9KBzpjXHgHmmHM8j3ouFnuUK5Dob9cWaRrC8RENZZJ+8k12W7Pe82+BNwpHgN 2/xfkpiNWPWDydIAifMDxsGPGn5EcxEVX9Kdj3XGBkRgMPszxz10csslqCR6tRoahnEM p95RCQmy92s6wrNtu1buzthJt/tUKFdNMXVYwG/EbmSe/fX3hNYR/EZJPIC1CNwYTKs+ C/hraNuLbbXngfD09roS/o6Sw4uTwxzNztg7TZEGA2CaUXkpL46dCz1EBGzqOi0vw0iV lA0FXI2rQ7Y20zS5V16Mvu+Yj54vfwK1JXNIKka+EsrYBAackcHv7SZmqX/jW3aBy/88 aZwg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c21si12932826pls.414.2019.07.02.08.52.26; Tue, 02 Jul 2019 08:52:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727050AbfGBPwI (ORCPT + 99 others); Tue, 2 Jul 2019 11:52:08 -0400 Received: from mga07.intel.com ([134.134.136.100]:11936 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726150AbfGBPwI (ORCPT ); Tue, 2 Jul 2019 11:52:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 02 Jul 2019 08:52:07 -0700 X-IronPort-AV: E=Sophos;i="5.63,443,1557212400"; d="scan'208";a="157681050" Received: from mwasko-mobl.ger.corp.intel.com (HELO [10.249.140.55]) ([10.249.140.55]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/AES256-SHA; 02 Jul 2019 08:52:03 -0700 Subject: Re: [alsa-devel] [PATCH] ALSA: usb-audio: fix Line6 Helix audio format rates To: Takashi Iwai , Nicola Lunghi Cc: alsa-devel@alsa-project.org, info@jensverwiebe.de, Greg Kroah-Hartman , linux-kernel@vger.kernel.org, Jussi Laako , Richard Fontana , Thomas Gleixner , Allison Randal References: <20190702004439.30131-1-nick83ola@gmail.com> From: "Wasko, Michal" Message-ID: <4181a467-5332-c256-5124-513a0343ec70@linux.intel.com> Date: Tue, 2 Jul 2019 17:52:01 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/2/2019 4:37 PM, Takashi Iwai wrote: > On Tue, 02 Jul 2019 02:43:14 +0200, > Nicola Lunghi wrote: >> Line6 Helix and HX stomp don't support retrieving >> the number of clock sample rate. >> >> Add a quirk to return the default value of 48Khz. >> >> Signed-off-by: Nicola Lunghi > It's not particularly good place to put a quirk, but there seems no > other better place, unfortunately. Is this specific to certain unit > or all I/Os on the device suffer from this problem? > > In anyway, if the behavior is expected, we don't need to use > dev_warn() to annoy users unnecessarily. Replace it with dev_info(). > > Also, the code that creates a single 48k entry would be better to be > put into a function for readability. > > Could you resubmit with that change? > > > Thanks! > > Takashi If the listed USB devices do not support sample rate format retrieval then maybe it would be a better idea to perform below check before sending message? Have you also considered new function or macro that check device support? This would separate formatfunctionality code from routine that identifies applicable devices- in case if in future more devices will require quirk. Michal W. >> --- >> sound/usb/format.c | 28 +++++++++++++++++++++++++--- >> 1 file changed, 25 insertions(+), 3 deletions(-) >> >> diff --git a/sound/usb/format.c b/sound/usb/format.c >> index c02b51a82775..05442f6ada62 100644 >> --- a/sound/usb/format.c >> +++ b/sound/usb/format.c >> @@ -313,10 +313,32 @@ static int parse_audio_format_rates_v2v3(struct snd_usb_audio *chip, >> tmp, sizeof(tmp)); >> >> if (ret < 0) { >> - dev_err(&dev->dev, >> - "%s(): unable to retrieve number of sample rates (clock %d)\n", >> + switch (chip->usb_id) { >> + /* LINE 6 HX pedals don't support getting the clock sample rate. >> + * Set the framerate to 48khz by default >> + */ >> + case USB_ID(0x0E41, 0x4244): /* HELIX */ >> + case USB_ID(0x0E41, 0x4246): /* HX STOMP */ >> + dev_warn(&dev->dev, >> + "%s(): line6 helix: unable to retrieve number of sample rates. Set it to default value (clock %d).\n", >> __func__, clock); >> - goto err; >> + fp->nr_rates = 1; >> + fp->rate_min = 48000; >> + fp->rate_max = 48000; >> + fp->rates = SNDRV_PCM_RATE_48000; >> + fp->rate_table = kmalloc(sizeof(int), GFP_KERNEL); >> + if (!fp->rate_table) { >> + ret = -ENOMEM; >> + goto err_free; >> + } >> + fp->rate_table[0] = 48000; >> + return 0; >> + default: >> + dev_err(&dev->dev, >> + "%s(): unable to retrieve number of sample rates (clock %d)\n", >> + __func__, clock); >> + goto err; >> + } >> } >> >> nr_triplets = (tmp[1] << 8) | tmp[0]; >> -- >> 2.19.1 >> >> > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > https://mailman.alsa-project.org/mailman/listinfo/alsa-devel >