Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp2725240ybi; Mon, 1 Jul 2019 17:46:54 -0700 (PDT) X-Google-Smtp-Source: APXvYqyw+8tr4htlyOrBhCtOqSFuxEVCW0r9CjdF9+ytBSofupt2CPHHYilHwm2NPPc0znfk/vht X-Received: by 2002:a17:90a:26ea:: with SMTP id m97mr2320872pje.59.1562028413948; Mon, 01 Jul 2019 17:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562028413; cv=none; d=google.com; s=arc-20160816; b=savFITwZqsqvxqArjHJ5kIKJkQRMjqXatyiIR2tDEhLI1DJCsMVe7l9odS/p3FQQ/8 qxvOT5tdqEFreWXQfur/HPRS3KjqKUxbch2ayh3oouwgKhrv5KQ/BoIqHki7HfQxW397 kLrxyGZaNiFFKlRpYNA95oTGYS2ykZd82mvlpYo8tmHCjeZp2IE3wogCCzS+24+6yzbB aMhaYX8lYXcXoXe4rwFSiqjjhWCuSnrQL3NIOAFStxO2rwe1CzWk/s+7VCNuyGWtKm0r 9wqqr+vwUxk3N2NGJTFTVgMkPCLGRngdtEJjvvJwi+f0DvEkU9PRL4VnXJ4I9+KV9gQJ HpZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=f9XoDf2UqqqVQm4eFJ4Eg/g7JLrPNXPmegTV8b0b65c=; b=m4WFkapX02286ii3TrmB7AvEQzdx36WZAowxYUizjNY8+ExYo0FkZzLiDK49mfeT2K rRVT56kv+tlTF1Nh+y+yIT4RrxkJj12QZ2QALxcY5IKfR9lJ9T4XK+kLv87tLOrGzXYh NkdgML3sgBADoGPaeY7RteiR1uSGRfaj3yV8CyILRAQJSzGdcGEYs0cb+THLfxV+mk2U 6mW/TbYZUSNj8ogXazUoeWtNdjPcY5MGrIHM+wBAM1/fl3npPzuOVEwmBptadT5hqMhY 1A+OPGjXIvy5nndGW6U82FV1+nIudd2umlDjVp5FYFsVsa64pynSAvb1t60KYy0YDUlf pruA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CyahivUA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si11508215plp.329.2019.07.01.17.46.38; Mon, 01 Jul 2019 17:46:53 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CyahivUA; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727076AbfGBApl (ORCPT + 99 others); Mon, 1 Jul 2019 20:45:41 -0400 Received: from mail-ed1-f68.google.com ([209.85.208.68]:45007 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726966AbfGBApk (ORCPT ); Mon, 1 Jul 2019 20:45:40 -0400 Received: by mail-ed1-f68.google.com with SMTP id k8so25555110edr.11 for ; Mon, 01 Jul 2019 17:45:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f9XoDf2UqqqVQm4eFJ4Eg/g7JLrPNXPmegTV8b0b65c=; b=CyahivUA8ly8coHmyiKLvnegSPHmgWJ4cnXAJWYEWTWp1DomBmBPid5QNe434kTCP9 54k+ymolVc/Swe523+LJJjmPKDK8PsUpW8kGdxgwOvVKraJ1hKZgPt2epINFImSRZcJG kmiLcQs+Td5++2Gif2HP3ohW55ZCSrQGHiimvLIbIg7Q34shUxX8lkDQBax7yki52p85 ValukBaG5zNBarrQnU9BSVPSPa/xLJup9dCtNq+CkbduGw03xj8hTnSXRNmeIgZNaNpd YA3uMoMDqtLn7fvyDlu5PdXxlgjMZ74PFrot9pepql5VBZBLi1KKZK2rXsHlu9kQG8l8 BduA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=f9XoDf2UqqqVQm4eFJ4Eg/g7JLrPNXPmegTV8b0b65c=; b=hE+QC/kiOcUxWRh3tp4hSkJtxrYWY9BgS8E4vQY8h+nrqP3PJh+CuptjyYzmEwAGeO A2FtTmqUkPfXyq71ci0LzPMOALITDIT7t4VZOl45mxsS3tWDieSebK3dBRiHWGtmHlWz fVX/UXHDreJwcHVOS2t6xPyuE3yCAAEaf6YlBbSPah1PPo/aHqutn3mCgknkL3vyga+/ 8Ht/EEcP2rj6tPTTcpY4SLkJ4aNlaR8om1CQujMMawkGgsrR3qNV3is7tGv19lStSwbz XoF3dIw3DjWSPO9GBuFum9+SBw/B6zTiK5ZA34QTEbVfLKlgGLFE2aSv5FBE78Yllg+l iWHQ== X-Gm-Message-State: APjAAAVc4HHLVjDwuxOwbeHO1S8qaEkfkCE4i/YksH6xSTUKEOpJ+NxP E5dx7s369uSz07upAy2xu3M= X-Received: by 2002:a17:906:3497:: with SMTP id g23mr26064074ejb.70.1562028338994; Mon, 01 Jul 2019 17:45:38 -0700 (PDT) Received: from localhost.localdomain ([89.100.119.28]) by smtp.gmail.com with ESMTPSA id x4sm4256392eda.22.2019.07.01.17.45.37 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Mon, 01 Jul 2019 17:45:38 -0700 (PDT) From: Nicola Lunghi To: alsa-devel@alsa-project.org Cc: info@jensverwiebe.de, Nicola Lunghi , Jaroslav Kysela , Takashi Iwai , Allison Randal , Greg Kroah-Hartman , Richard Fontana , Thomas Gleixner , Jussi Laako , linux-kernel@vger.kernel.org Subject: [PATCH] ALSA: usb-audio: fix Line6 Helix audio format rates Date: Tue, 2 Jul 2019 01:43:14 +0100 Message-Id: <20190702004439.30131-1-nick83ola@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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