From patchwork Mon May 24 03:13:46 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 446481 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AE2DC47080 for ; Mon, 24 May 2021 03:16:39 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CB9696101E for ; Mon, 24 May 2021 03:16:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB9696101E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 5DC40836; Mon, 24 May 2021 05:15:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 5DC40836 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1621826197; bh=hRatnXg7jqCuPaLs6n449MH3ZPeX9RziChkj871bb7A=; h=From:To:Subject:Date:In-Reply-To:References:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=XBknahj1vWsO05m6G3KzfffBTpEYQnbgpKBeI+LGFyyOauOWt1A+8WtVhfyVzjNSh 81Rq2AREh21ji3rGnrWonCORW7JVrguNs2uJA7lPvy4LKv4ExsDgYLofiWjmCLgRoH HQzP/uFKDJ0uJgjqe06vjuUFTebbzOQBnr5zYTGg= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 32F70F8049C; Mon, 24 May 2021 05:14:08 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7A5AFF80137; Mon, 24 May 2021 05:14:06 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 71EE8F80260 for ; Mon, 24 May 2021 05:13:59 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 71EE8F80260 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="WkjZYZnS"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="vXLpxxiU" Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id B249B5C011B; Sun, 23 May 2021 23:13:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Sun, 23 May 2021 23:13:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm1; bh=t1orP0CsnTksR Db98nAaKJLpKlhFXWDERsIQfcjRKl4=; b=WkjZYZnSAnA1T9sQQd5msLHn91i8J 4JpFf2USMcupe77ODEFGkQwMy+ELklBuCgJdmH17893dtj+Nrw2FmqiebCIAitOp F0/iyvGDEvoTndmI64ed7i/ofRQvwoi+IOT9M5fL8WJf+mJumOGRpFJsEV5B64nE iPjokSdBngXsE9snpN8nnOfm8PXRlLo2zTM8FQmqluUYrswlK+cnnKxTXowSrFsx Mo2TDCeqbr6wJnJ3i+g3hGzdK9T7+JWaSH1wBniQ18F1jyrHaMpOMZ54ljSedtXk ZHtDUX0bbaqK+3tatwQr30/Yiq7SL1H9/rnmAtT0iNGnrWc9pmgl7gpyQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=t1orP0CsnTksRDb98nAaKJLpKlhFXWDERsIQfcjRKl4=; b=vXLpxxiU nSQ/a83g2WjPU/JHsmWj8DYdP+Hj6OlOVSbh/pB3Z/2CmGn68R0rWORzpgi7Vd6C Y/pZvmcRKFMbSUfKllqPG4uuX/ZN2BJW2ifynbN6MH5YW43RUJCDYs16rjUGuMRZ 7TXPvagF9D4HoUymB+kCBsm+aTfQ77w8WlP7KI5cbhy15fHRUikcUphCAgDn7jdc 7s/mgGTCYd9V7TJ/fRiCu0nPXe3Lr0qTaH+EErF7Vjlmgs6kXHzBad1l7cS3dvxa Q4GB3TA2daZKMHi7eo85OZHJQCO+qAKcgxUow0Tqb4SJmJUsAZlL6CuVsGH+GuIw OfoKg7r4p9KPCw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejkedgfeejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecuggftrfgrthhtvghrnhepveefffefke etgfevgeefleehfffhueejtdejveethfekveektdejjedvtdejhfejnecukfhppedugedr fedrieehrddujeehnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhirdhjph X-ME-Proxy: Received: from workstation.flets-east.jp (ae065175.dynamic.ppp.asahi-net.or.jp [14.3.65.175]) by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 23 May 2021 23:13:57 -0400 (EDT) From: Takashi Sakamoto To: tiwai@suse.de Subject: [PATCH v2 4/4] ALSA: bebob: distinguish M-Audio ProFire Lightbridge quirk Date: Mon, 24 May 2021 12:13:46 +0900 Message-Id: <20210524031346.50539-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20210524031346.50539-1-o-takashi@sakamocchi.jp> References: <20210524031346.50539-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, clemens@ladisch.de X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 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: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" In former commit, ALSA IEC 61883-1/6 packet streaming engine drops initial tx packets till the packet includes any event. This allows ALSA bebob driver not to give option to skip initial packet since the engine does drop the initial packet. However, M-Audio ProFire Lightbridge has a quirk to stop packet transmission after start multiplexing event to the packet. After several thousands cycles, it restart packet transmission again. This commit specializes the usage of initial skip option for the model. Additionally, this commit expands timeout enough to wait processing content of tx packet. Signed-off-by: Takashi Sakamoto --- sound/firewire/bebob/bebob.c | 10 +++++++++- sound/firewire/bebob/bebob.h | 1 + sound/firewire/bebob/bebob_stream.c | 12 +++++++----- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/sound/firewire/bebob/bebob.c b/sound/firewire/bebob/bebob.c index 90e98a6d1546..5938aa325f5e 100644 --- a/sound/firewire/bebob/bebob.c +++ b/sound/firewire/bebob/bebob.c @@ -64,6 +64,7 @@ static DECLARE_BITMAP(devices_used, SNDRV_CARDS); #define MODEL_MAUDIO_AUDIOPHILE_BOTH 0x00010060 #define MODEL_MAUDIO_FW1814 0x00010071 #define MODEL_MAUDIO_PROJECTMIX 0x00010091 +#define MODEL_MAUDIO_PROFIRELIGHTBRIDGE 0x000100a1 static int name_device(struct snd_bebob *bebob) @@ -210,6 +211,13 @@ do_registration(struct work_struct *work) if (err < 0) goto error; + // M-Audio ProFire Lightbridge has a quirk to transfer packets with discontinuous cycle or + // data block counter in early stage of packet streaming. The cycle span from the first + // packet with event is variable. + if (bebob->entry->vendor_id == VEN_MAUDIO1 && + bebob->entry->model_id == MODEL_MAUDIO_PROFIRELIGHTBRIDGE) + bebob->discontinuity_quirk = true; + err = snd_bebob_stream_init_duplex(bebob); if (err < 0) goto error; @@ -476,7 +484,7 @@ static const struct ieee1394_device_id bebob_id_table[] = { /* M-Audio NRV10 */ SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010081, &maudio_nrv10_spec), /* M-Audio, ProFireLightbridge */ - SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x000100a1, &spec_normal), + SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_PROFIRELIGHTBRIDGE, &spec_normal), /* Firewire 1814 */ SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, 0x00010070, NULL), /* bootloader */ SND_BEBOB_DEV_ENTRY(VEN_MAUDIO1, MODEL_MAUDIO_FW1814, diff --git a/sound/firewire/bebob/bebob.h b/sound/firewire/bebob/bebob.h index 4e0ed84adbee..cba6793bfdb2 100644 --- a/sound/firewire/bebob/bebob.h +++ b/sound/firewire/bebob/bebob.h @@ -115,6 +115,7 @@ struct snd_bebob { /* For BeBoB version quirk. */ unsigned int version; + bool discontinuity_quirk; struct amdtp_domain domain; }; diff --git a/sound/firewire/bebob/bebob_stream.c b/sound/firewire/bebob/bebob_stream.c index 975670a29a72..91306da1bafe 100644 --- a/sound/firewire/bebob/bebob_stream.c +++ b/sound/firewire/bebob/bebob_stream.c @@ -7,7 +7,7 @@ #include "./bebob.h" -#define READY_TIMEOUT_MS 2500 +#define READY_TIMEOUT_MS 4000 /* * NOTE; @@ -644,12 +644,14 @@ int snd_bebob_stream_start_duplex(struct snd_bebob *bebob) if (err < 0) goto error; - // Some devices transfer isoc packets with discontinuous counter in the beginning - // of packet streaming. - if (bebob->version < 2) - tx_init_skip_cycles = 3200; + if (!bebob->discontinuity_quirk) + tx_init_skip_cycles = 0; else tx_init_skip_cycles = 16000; + + // MEMO: In the early stage of packet streaming, the device transfers NODATA packets. + // After several hundred cycles, it begins to multiplex event into the packet with + // syt information. err = amdtp_domain_start(&bebob->domain, tx_init_skip_cycles); if (err < 0) goto error;