From patchwork Mon Jan 13 08:46:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11329797 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 83ACC138D for ; Mon, 13 Jan 2020 08:48:32 +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 19AC9207FF for ; Mon, 13 Jan 2020 08:48:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="aZqQ6tLg"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="NY0tLvHk"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CBsSJfk2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 19AC9207FF 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 4CBEA1607; Mon, 13 Jan 2020 09:47:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4CBEA1607 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578905310; bh=dshAH0CuNcayudZ8hoRstG7Oartgyh7QFtfdIb14qWs=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=aZqQ6tLgX8gHY+BQapVNRm4atBTAMPSjBShspjQgBP6Px53Kr7iQjnPfgFGOZjdNp agTyFFSEysIaraAgQ2MHeXJ/JrulOS3lTSVPYbRlPFSIyzpJom3G4Kmh/fMRY5Tg99 Ua0HYgEm44G8cZVnjG7+c3IBTIvDCXjnPYNlIyPs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 4EB31F8014B; Mon, 13 Jan 2020 09:46:46 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 2DC05F800B9; Mon, 13 Jan 2020 09:46:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 22509F80122 for ; Mon, 13 Jan 2020 09:46:36 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 22509F80122 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="NY0tLvHk"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="CBsSJfk2" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id BC04021EE9; Mon, 13 Jan 2020 03:46:35 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 13 Jan 2020 03:46:35 -0500 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=fm3; bh=rhuVkKtv5umrP EeEXUwkoXh28X3nBK7ZAdb/LzUkY+w=; b=NY0tLvHkIFB737ZP7E1v5mFdboHu/ FojrK5ciPW69c4Fvvu6vhE5m/bZS6gIhpdtEt+V9olyo5JC+KTGj3/JVXNHUJg00 +TjkSZYYN0FkDheCanqSx9KGAUvheefvtXgBrNHHZK9VECmfQMgZm8G1sxCkQZ73 eg1DA7xaT8jKTeCUbpNRjhYwo+/4xdLCU5dWWKM6KGE6hitGCkfp5eFAcVXy9r80 0rleOcxyTi6u8NHTVtRmpYHPBluQhsj8J/CGWiKjZRbWpLXyn9Q+SUg4SH68Y+Dy f8A9u8cKi2DuXHOGM7jhDxtX3Ej+LoOtac46/HVuMUUq2zJAyuUIUQdMg== 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= fm1; bh=rhuVkKtv5umrPEeEXUwkoXh28X3nBK7ZAdb/LzUkY+w=; b=CBsSJfk2 afPbLWsVLtu/IApiXEZ83rVB6Il4ysK6A0tDWJFDTNrNp9URfOpSyFw0shOoM2OD sbmmASedIVCB6Qv+OsJehudV+GwuzB1yQFZQpb6yKfHWtPo9RIEbiOVTxbC0AIAE b0LKRCESKjBloOjlsM+DVQWvjVww4adxA3lYxZhx2lzqoRdaN9QIZ5RrC+aKH+zM 5IGDxaA55DkNks/BsyQRVF8QOdgVmiUIVZzF6Xtm7XvXxkRs1QBuzuJdDYDQX/DQ w1zpMnsOq+ea81SoUQahZLVBFZCVuOkVVdbTAWMUjD6W89lxQjL792q5i1+Wzfzy 5b1kMY4kaha2Pw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeiledguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 9DE5530607B4; Mon, 13 Jan 2020 03:46:34 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Date: Mon, 13 Jan 2020 17:46:28 +0900 Message-Id: <20200113084630.14305-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200113084630.14305-1-o-takashi@sakamocchi.jp> References: <20200113084630.14305-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org, stable@vger.kernel.org Subject: [alsa-devel] [PATCH 1/3] dice: fix fallback from protocol extension into limited functionality 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" At failure of attempt to detect protocol extension, ALSA dice driver should be fallback to limited functionality. However it's not. This commit fixes it. Cc: # v4.18+ Fixes: 58579c056c1c9 ("ALSA: dice: use extended protocol to detect available stream formats") Signed-off-by: Takashi Sakamoto --- sound/firewire/dice/dice-extension.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sound/firewire/dice/dice-extension.c b/sound/firewire/dice/dice-extension.c index a63fcbc875ad..02f4a8318e38 100644 --- a/sound/firewire/dice/dice-extension.c +++ b/sound/firewire/dice/dice-extension.c @@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice) int j; for (j = i + 1; j < 9; ++j) { - if (pointers[i * 2] == pointers[j * 2]) + if (pointers[i * 2] == pointers[j * 2]) { + // Fallback to limited functionality. + err = -ENXIO; goto end; + } } } From patchwork Mon Jan 13 08:46:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11329799 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E1381930 for ; Mon, 13 Jan 2020 08:49:24 +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 767A2207FF for ; Mon, 13 Jan 2020 08:49:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="sSg7RnQ+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="zFLRPveE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZNVhJpr0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 767A2207FF 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 D30A01667; Mon, 13 Jan 2020 09:48:32 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D30A01667 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578905362; bh=uBclgG+mWUlWHp6tsEwqt21+Fke2yV+exfc1jv4oKyM=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=sSg7RnQ+7OUjml6DgNPA2izsGAv1ptXtn46nFaFofH81T8pY4okDjhJBBaHxbA3F3 cR76qS2LHZ9ohLmCn+hCX2vo3O935kYaVmEvLHnUrc7FLJ8RMNdUvtuv1o6zXG6EVZ OYP49dDM4XT+TcUQNk/II7+QLqn/2kHD54qshGNU= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 320F9F80274; Mon, 13 Jan 2020 09:46:48 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3D339F80227; Mon, 13 Jan 2020 09:46:43 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9A8D3F8014B for ; Mon, 13 Jan 2020 09:46:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9A8D3F8014B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="zFLRPveE"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZNVhJpr0" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id EC3A322015; Mon, 13 Jan 2020 03:46:36 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 13 Jan 2020 03:46:36 -0500 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=fm3; bh=v8OgXzbeCcKFo FG1ZVh0kIlliEtxH3Bv3UMR5RkbquI=; b=zFLRPveEtmbhkYS753LP7IsnsPjTt R1ohg3CfMigH3lQVZ2ck3WLPUF2hYuQwUilf571BcNKO8N9LZwjiF4ihO0iCrH/x U0cxcy89reYl4jjp32HIe/3Irt+VKCgaQs1u1M45eAv5az6JkKfcFe2wizgdy8ZC Mcg3yWlNF4Ku1Tvs+Wo2wwzDeLm7usAAaevyh4ser2Z+ZtoigMeXvDie91Lc9QIm L/Hmd4tCwdaoqNlK2R/viZJM3Bjf3cR/THM/yGBP7wcI0ffygefUyQxX2fjP2mXE +hxnACVyGlGZ0oXgbJ94yIm2AM6VpABLpJOcXfWJn5IJadbUMCunpkQ9Q== 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= fm1; bh=v8OgXzbeCcKFoFG1ZVh0kIlliEtxH3Bv3UMR5RkbquI=; b=ZNVhJpr0 +c45y7+xO0TIWCUS73P+d5PIBpRZXMqdV9TSCQCE08OZftm5rd/ebTl70LuHc+kD e5uRmP2dnkvyePiJyFraHn9TZRdve6IO7HdESbqpaVOvNWsGHFOKsGf1Gtp0Cyfn aoZWxuG/93g67vtGxp6eoGCgpf2tZu1Y+bkb3rrDIbAcP+AK/InYqIDXtSVW4PWK K9RzySrDFI93BCiDyK5CbuiaBC73C8GyhWJibEmlr39sto+ZvM3LuYbF1n0I8ZBw XoqPQtZqjFZyDf2kUp5BqsgGRtMViOhdj3aEm4g5GVJSpOun9A3ByUUFUXnIQqN1 pMJeSHVebzSnKw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeiledguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpedt X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 0219430607B4; Mon, 13 Jan 2020 03:46:35 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Date: Mon, 13 Jan 2020 17:46:29 +0900 Message-Id: <20200113084630.14305-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200113084630.14305-1-o-takashi@sakamocchi.jp> References: <20200113084630.14305-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 2/3] dice: loosen stream format check for MIDI conformant data channel 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" ALSA dice driver expects devices to multiplex MIDI messages into first port of isochronous communication. Actually devices perform for it. However, check of stream format is invalid for second port of isochronous communication. As a result, when the device supports two ports for isochronous communication and the stream format is hard-coded, ALSA dice driver fails to start packet streaming. This commit loosens stream format check for MIDI conformant data channel. Signed-off-by: Takashi Sakamoto --- sound/firewire/dice/dice-stream.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sound/firewire/dice/dice-stream.c b/sound/firewire/dice/dice-stream.c index 6a3d60913e10..8e0c0380b4c4 100644 --- a/sound/firewire/dice/dice-stream.c +++ b/sound/firewire/dice/dice-stream.c @@ -224,7 +224,6 @@ static int keep_dual_resources(struct snd_dice *dice, unsigned int rate, struct amdtp_stream *stream; struct fw_iso_resources *resources; unsigned int pcm_cache; - unsigned int midi_cache; unsigned int pcm_chs; unsigned int midi_ports; @@ -233,7 +232,6 @@ static int keep_dual_resources(struct snd_dice *dice, unsigned int rate, resources = &dice->tx_resources[i]; pcm_cache = dice->tx_pcm_chs[i][mode]; - midi_cache = dice->tx_midi_ports[i]; err = snd_dice_transaction_read_tx(dice, params->size * i + TX_NUMBER_AUDIO, reg, sizeof(reg)); @@ -242,7 +240,6 @@ static int keep_dual_resources(struct snd_dice *dice, unsigned int rate, resources = &dice->rx_resources[i]; pcm_cache = dice->rx_pcm_chs[i][mode]; - midi_cache = dice->rx_midi_ports[i]; err = snd_dice_transaction_read_rx(dice, params->size * i + RX_NUMBER_AUDIO, reg, sizeof(reg)); @@ -253,10 +250,10 @@ static int keep_dual_resources(struct snd_dice *dice, unsigned int rate, midi_ports = be32_to_cpu(reg[1]); // These are important for developer of this driver. - if (pcm_chs != pcm_cache || midi_ports != midi_cache) { + if (pcm_chs != pcm_cache) { dev_info(&dice->unit->device, - "cache mismatch: pcm: %u:%u, midi: %u:%u\n", - pcm_chs, pcm_cache, midi_ports, midi_cache); + "cache mismatch: pcm: %u:%u, midi: %u\n", + pcm_chs, pcm_cache, midi_ports); return -EPROTO; } From patchwork Mon Jan 13 08:46:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 11329801 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CA18B138D for ; Mon, 13 Jan 2020 08:50:08 +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 60393207FF for ; Mon, 13 Jan 2020 08:50:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="FZ6Ub9ZN"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="uHcMwzC6"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KwVirmWj" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 60393207FF 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 ABD5186F; Mon, 13 Jan 2020 09:49:16 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz ABD5186F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1578905406; bh=imguVCRxFKALYYcyXeJvyju+FvgPgqvOWBsBBDKFVuw=; h=From:To:Date:In-Reply-To:References:Cc:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=FZ6Ub9ZN821P+zVm0UP/FWkRF4DVejI513k9sUDFokMPJwe72iezBGTqa85lDroTJ UGhuv0Q/q0eEyjYiQhSKjjFVBsEDNz6RoHWHki0upQsfxTkMYeIB7E0C8tmKl3N+9T K62JjC/4aHNWuHSn5fljljk5naqKXQV+4K1/5YRs= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 48356F8027D; Mon, 13 Jan 2020 09:46:49 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa1.perex.cz (Postfix, from userid 50401) id 671C3F801F7; Mon, 13 Jan 2020 09:46:44 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on alsa1.perex.cz X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,SPF_HELO_PASS,SPF_PASS,SURBL_BLOCKED,URIBL_BLOCKED autolearn=disabled version=3.4.0 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9C0A5F801F7 for ; Mon, 13 Jan 2020 09:46:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9C0A5F801F7 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="uHcMwzC6"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="KwVirmWj" Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 20ADD21C29; Mon, 13 Jan 2020 03:46:38 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Mon, 13 Jan 2020 03:46:38 -0500 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=fm3; bh=BsyZbZCrzJkjx nB3ZVt/jUv7SRpCLvPP/Oiq/RXnzm4=; b=uHcMwzC6rVBvhuCWb0QL0AuDObD/m QeaEMkRgqZy0FIBTFI4DYSbLSBlp9BeQj9aQ9tScZBpJDiWDPG4eg32OtV3zjOAy P8D2TFHxOG335DIR9dImB2cxXQVe74FziWsALLOSWE467yApID39sApqG3WbY5fd ZNTrjiQgnliL+es6SFyiFMxd6mROQGw7txGTFH4RFJDWbz05KMggpT5iccsOkb8o I+hsDIV7RVG8/KSgnZa1zM7GiaUPckvEhEDQayhCvGz0+VM11n/JXliU04/1AyI0 Ek9U5c8VVgFjgELamTMP+fTdDcMLHZRBvDdfAdm/5h11ZZsCtxFh0XxOg== 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= fm1; bh=BsyZbZCrzJkjxnB3ZVt/jUv7SRpCLvPP/Oiq/RXnzm4=; b=KwVirmWj GADNhLFNgQQQPvbiltf0rY5Frb3jG6jj3fVM3+EkTTJy4oROCB0VMquL6m7NAQyw KKeTtZlqGJuKTpVTUPoVIaD3qoGc2Z/iBmdEHjoCBaPldixoIQTH6e7cI4LpA0XK CMoTre03J/4Ey+3H5io4wJz5FvTF0Td3VRVi3u+pfDhdQ7ELsGm2OqT7HwMxrxFo re2tVsx8qmoqtIJBBX939qszsszBypMQ4/xQyRoFUmYzxbpCkqbRZcl9KkjbV9cC KQZ/iw2h1xOV9wFKze3PsinKWJEyMc86PJP2HUJxWXhlqaYb8I5CpTuOJgduhgO5 g4YZQZaaS3OeGg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedufedrvdeiledguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucfkphepudegrdefrdejhedrudekud enucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihesshgrkhgrmhhotggt hhhirdhjphenucevlhhushhtvghrufhiiigvpedv X-ME-Proxy: Received: from workstation.flets-east.jp (ae075181.dynamic.ppp.asahi-net.or.jp [14.3.75.181]) by mail.messagingengine.com (Postfix) with ESMTPA id 2D2043060783; Mon, 13 Jan 2020 03:46:36 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Date: Mon, 13 Jan 2020 17:46:30 +0900 Message-Id: <20200113084630.14305-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200113084630.14305-1-o-takashi@sakamocchi.jp> References: <20200113084630.14305-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH 3/3] dice: add support for Alesis MasterControl 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" Alesis MasterControl was shipped 2009 and already discontinued. This model consists of: * TSB41AB2 for physical layer of IEEE 1394 * WaveFront Dice II STD for link layer and protocol implementation * FreeScale DSPB56374AE Although the firmware of this model can respond against read transaction to address space for TCAT extension protocol, the content is not valid for protocol extension. This results in sound card without any PCM/MIDI interfaces. $ ./firewire-request /dev/fw1 read 0xffffe0200000 0x48 result: 000: 00 00 00 20 00 00 04 94 00 00 04 b4 00 00 00 b4 result: 010: 00 00 05 68 00 00 00 24 00 00 05 8c 00 00 00 48 result: 020: 00 00 00 20 00 00 00 08 00 00 00 20 00 00 00 20 result: 030: 00 00 00 10 00 00 00 08 00 00 00 08 00 00 00 04 result: 040: 00 00 00 00 00 00 00 00 This commit adds support the model by adding hard-coded stream formats. $ python3 ~/git/linux-firewire-utils/src/crpp < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 400 04041ad7 bus_info_length 4, crc_length 4, crc 6871 404 31333934 bus_name "1394" 408 e0ff8112 irmc 1, cmc 1, isc 1, bmc 0, pmc 0, cyc_clk_acc 255, max_rec 8 (512), max_rom 1, gen 1, spd 2 (S400) 40c 00059504 company_id 000595 | Alesis Corporation 410 008003f5 device_id 04008003f5 | EUI-64 00059504008003f5 root directory ----------------------------------------------------------------- 414 0006a620 directory_length 6, crc 42528 418 03000595 vendor: Alesis Corporation 41c 8100000a --> descriptor leaf at 444 420 17000002 model 424 8100000d --> descriptor leaf at 458 428 0c0087c0 node capabilities per IEEE 1394 42c d1000001 --> unit directory at 430 unit directory at 430 ----------------------------------------------------------------- 430 00041b9f directory_length 4, crc 7071 434 12000595 specifier id: Alesis Corporation 438 13000001 version: audio 43c 17000002 model 440 8100000d --> descriptor leaf at 474 descriptor leaf at 444 ----------------------------------------------------------------- 444 000494c2 leaf_length 4, crc 38082 448 00000000 textual descriptor 44c 00000000 minimal ASCII 450 416c6573 "Ales" 454 69730000 "is" descriptor leaf at 458 ----------------------------------------------------------------- 458 0006c2ec leaf_length 6, crc 49900 45c 00000000 textual descriptor 460 00000000 minimal ASCII 464 4d617374 "Mast" 468 6572436f "erCo" 46c 6e74726f "ntro" 470 6c000000 "l" descriptor leaf at 474 ----------------------------------------------------------------- 474 0006c2ec leaf_length 6, crc 49900 478 00000000 textual descriptor 47c 00000000 minimal ASCII 480 4d617374 "Mast" 484 6572436f "erCo" 488 6e74726f "ntro" 48c 6c000000 "l" Signed-off-by: Takashi Sakamoto --- sound/firewire/dice/dice-alesis.c | 24 ++++++++++++++++++++++++ sound/firewire/dice/dice.c | 8 ++++++++ sound/firewire/dice/dice.h | 1 + 3 files changed, 33 insertions(+) diff --git a/sound/firewire/dice/dice-alesis.c b/sound/firewire/dice/dice-alesis.c index f5b325263b67..0916864511d5 100644 --- a/sound/firewire/dice/dice-alesis.c +++ b/sound/firewire/dice/dice-alesis.c @@ -50,3 +50,27 @@ int snd_dice_detect_alesis_formats(struct snd_dice *dice) return 0; } + +int snd_dice_detect_alesis_mastercontrol_formats(struct snd_dice *dice) +{ + int i; + + dice->tx_pcm_chs[0][SND_DICE_RATE_MODE_LOW] = 16; + dice->tx_pcm_chs[1][SND_DICE_RATE_MODE_LOW] = 12; + dice->tx_pcm_chs[0][SND_DICE_RATE_MODE_MIDDLE] = 12; + dice->tx_pcm_chs[1][SND_DICE_RATE_MODE_MIDDLE] = 4; + dice->tx_pcm_chs[0][SND_DICE_RATE_MODE_HIGH] = 8; + dice->tx_pcm_chs[1][SND_DICE_RATE_MODE_HIGH] = 0; + + for (i = 0; i < SND_DICE_RATE_MODE_COUNT; ++i) { + dice->rx_pcm_chs[0][i] = 6; + dice->rx_pcm_chs[1][i] = 0; + } + + for (i = 0; i < MAX_STREAMS; ++i) { + dice->tx_midi_ports[i] = 2; + dice->rx_midi_ports[i] = 2; + } + + return 0; +} diff --git a/sound/firewire/dice/dice.c b/sound/firewire/dice/dice.c index 13eeb3f52bb6..06c94f009dfb 100644 --- a/sound/firewire/dice/dice.c +++ b/sound/firewire/dice/dice.c @@ -355,6 +355,14 @@ static const struct ieee1394_device_id dice_id_table[] = { .model_id = MODEL_ALESIS_IO_BOTH, .driver_data = (kernel_ulong_t)snd_dice_detect_alesis_formats, }, + // Alesis MasterControl. + { + .match_flags = IEEE1394_MATCH_VENDOR_ID | + IEEE1394_MATCH_MODEL_ID, + .vendor_id = OUI_ALESIS, + .model_id = 0x000002, + .driver_data = (kernel_ulong_t)snd_dice_detect_alesis_mastercontrol_formats, + }, /* Mytek Stereo 192 DSD-DAC. */ { .match_flags = IEEE1394_MATCH_VENDOR_ID | diff --git a/sound/firewire/dice/dice.h b/sound/firewire/dice/dice.h index 16366773e22e..7fbffcab94c2 100644 --- a/sound/firewire/dice/dice.h +++ b/sound/firewire/dice/dice.h @@ -229,6 +229,7 @@ int snd_dice_create_midi(struct snd_dice *dice); int snd_dice_detect_tcelectronic_formats(struct snd_dice *dice); int snd_dice_detect_alesis_formats(struct snd_dice *dice); +int snd_dice_detect_alesis_mastercontrol_formats(struct snd_dice *dice); int snd_dice_detect_extension_formats(struct snd_dice *dice); int snd_dice_detect_mytek_formats(struct snd_dice *dice); int snd_dice_detect_presonus_formats(struct snd_dice *dice);