From patchwork Fri May 4 09:57:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 10380297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 241D460353 for ; Fri, 4 May 2018 10:07:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0D888291FB for ; Fri, 4 May 2018 10:07:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01B1F292E9; Fri, 4 May 2018 10:07:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D6BD9291FB for ; Fri, 4 May 2018 10:07:32 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 63B3F267235; Fri, 4 May 2018 11:58:56 +0200 (CEST) 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 89467267265; Fri, 4 May 2018 11:58:53 +0200 (CEST) Received: from mail-pg0-f66.google.com (mail-pg0-f66.google.com [74.125.83.66]) by alsa0.perex.cz (Postfix) with ESMTP id 0806A266C1C for ; Fri, 4 May 2018 11:58:49 +0200 (CEST) Received: by mail-pg0-f66.google.com with SMTP id g20-v6so8451408pgv.1 for ; Fri, 04 May 2018 02:58:49 -0700 (PDT) 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; bh=UFoCThdfyVrCqllBqKTg5jE7NSzFQ0VnN2nxoKLZolc=; b=VbrT7mxysNW9wDOQ9yLN9CFlQkbV+WqHWBHGpod5vIFoucs/83WQ6WIQ/PFWPwA2Kh GhI+p5LCxZ5vGT6MN5ejqigCMWI5VAI5LUETTl5vycraGrfZ8zHwOmw0cfrH4N8qXHa5 Izze/XjH299ubu5KJI3mQ1cf+XCHjRfLqrTlTGIF4qZSuZXdRdSbyaxvVcLAWUFsWX5i y7zTPb9tKrKNGGqC/X1aKJeTO+Ss6Bv4wM8QKGXPmmqsj0T1xifOr5BHdovuvT8YQrFq kUa7nw+BQUQL8OwwMK/UZfPzCD/MFFVWJ84WApdc7m5yKW+0ut+IKcp9QO3rmAV52Ark B73g== X-Gm-Message-State: ALQs6tB2Ev45KOIrVAAd+fC/WGBOqi8eapnyFNEzJrmKeWrK6swZI7kQ 0cix9sm+7Ueu/C1WT7t2ipg= X-Google-Smtp-Source: AB8JxZriLldlYHGYaexGM0skKrHadHU9fz+7XDPNYQuGKHpqIymkJNF+0C3o0qEiJQ25r11g2D2uiw== X-Received: by 2002:a17:902:1c7:: with SMTP id b65-v6mr27205115plb.298.1525427928208; Fri, 04 May 2018 02:58:48 -0700 (PDT) Received: from localhost.localdomain (i196238.dynamic.ppp.asahi-net.or.jp. [61.125.196.238]) by smtp.gmail.com with ESMTPSA id y18sm15227976pfi.104.2018.05.04.02.58.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 May 2018 02:58:47 -0700 (PDT) From: Takashi Sakamoto To: clemens@ladisch.de, tiwai@suse.de Date: Fri, 4 May 2018 18:57:17 +0900 Message-Id: <20180504095717.25036-1-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.14.1 Cc: alsa-devel@alsa-project.org, ffado-devel@lists.sourceforge.net Subject: [alsa-devel] [PATCH] ALSA: dice: support transmission mode at 176.4/192.0 kHz for M-Audio 610/2626 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: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP At highest sampling transmission frequency, ALSA dice driver detects jumbo payload in tx packets from M-Audio 610/2626. $ dmesg snd_dice fw1.0: Detect jumbo payload: 0388 0348 Usual dice devices have a quirk called as dual-wire incompliant to IEC 61883-6 at highest sampling transmission frequency. On the other hand, M-Audio 610/2626 is compliant. This is a reason of the detection of jumbo payload. This commit adds support compliant transmission mode. For these devices, tx packets are correctly handled by this driver, while rx packets can't make these devices generate sound, unfortunately. The other factor affects it. Signed-off-by: Takashi Sakamoto --- sound/firewire/dice/dice-stream.c | 6 +++++- sound/firewire/dice/dice.c | 9 +++++++++ sound/firewire/dice/dice.h | 2 ++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c index 422a1ab1ddf5..e3dbe357b4fa 100644 --- a/sound/firewire/dice/dice-stream.c +++ b/sound/firewire/dice/dice-stream.c @@ -204,7 +204,11 @@ static int keep_resources(struct snd_dice *dice, * For this quirk, blocking mode is required and PCM buffer size should * be aligned to SYT_INTERVAL. */ - double_pcm_frames = rate > 96000; + if (rate < 176400 || dice->no_dualwire) + double_pcm_frames = false; + else + double_pcm_frames = true; + if (double_pcm_frames) { rate /= 2; pcm_chs *= 2; diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c index 40f7a32e4893..8baad7704bf0 100644 --- a/sound/firewire/dice/dice.c +++ b/sound/firewire/dice/dice.c @@ -236,6 +236,15 @@ static int dice_probe(struct fw_unit *unit, (snd_dice_detect_formats_t)entry->driver_data; } + /* + * M-Audio units are compliant to IEC 61883-6 at high sampling + * transmission frequency thus don't support 'dualwire' quirk. These + * units have 0x0100d1 in its version field in config ROM, against + * the value of DICE_INTERFACE. + */ + if (entry->vendor_id == OUI_MAUDIO) + dice->no_dualwire = true; + spin_lock_init(&dice->lock); mutex_init(&dice->mutex); init_completion(&dice->clock_accepted); diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h index 505b79fea6d9..66e7a277ab68 100644 --- a/sound/firewire/dice/dice.h +++ b/sound/firewire/dice/dice.h @@ -113,6 +113,8 @@ struct snd_dice { bool global_enabled; struct completion clock_accepted; unsigned int substreams_counter; + + bool no_dualwire; }; enum snd_dice_addr_type {