From patchwork Sun Feb 18 07:41:25 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 13561723 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 86FCAC4829E for ; Sun, 18 Feb 2024 07:51:57 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id B71DCA4B; Sun, 18 Feb 2024 08:51:45 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz B71DCA4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708242715; bh=Fu3fdtS7oQgOWe/O3MBGdeO+WH/z2+AmZDVcBf+jPJw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ljxumwi3boh44ZU7T4447IdNfnj3vUiNw6wtVb7td7HYZOdjgokbzjfszPc5x29fZ EUq9omtlbHNseoM2O8QD2t3sc8pX6vfD9wKBNAmiLf8J+debwq6fzsmguXhE1PN6UT R2p4ewJs93NmvG8genKPB+xPFV4Fumm4tcijfKrA= Received: by alsa1.perex.cz (Postfix, from userid 50401) id C610EF80623; Sun, 18 Feb 2024 08:50:30 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 92FEEF805F7; Sun, 18 Feb 2024 08:50:28 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8C86DF804B0; Sun, 18 Feb 2024 08:44:58 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A34D0F8047D for ; Sun, 18 Feb 2024 08:41:37 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A34D0F8047D Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.a=rsa-sha256 header.s=fm1 header.b=g0Uewg3H; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=KUXus+Sb Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 5A0C15C006E; Sun, 18 Feb 2024 02:41:36 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 18 Feb 2024 02:41:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1708242096; x= 1708328496; bh=xfklvt63Cya7crTHMbBmSR2hu8vK8DoS/tjKNZFEIvM=; b=g 0Uewg3HXcfZlH9ZwKSAAT1pzO8VOOFtaUZhWAs2LTgQ/y1arIqRMlWihK9uk12Fm 0yoPw79Cr3juDccVaibeo8gf/AI9MRBcwDFIrqIjVYJTWxvtHWEHM9fHh64XY+VW WyV1xZ9bZHpqk4Z9DoOarGf6LjPPx5uoWPdueUvonco5feE0Z1NLn5lF6ESAIPCa jpdvG1tNKh97kC1WEhCaJ9W0thxYGYzDwNaawrPxJQoCuh8kr+gdYaDrDz8JhvuV hI7YdutvY1z3AaCpt8c6Fsv9DuPQLzaBH7HM0hCY2HW/SNLo5FVuQWOfQbTgkir3 +7bkXkQfddXC0eLDe/MhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708242096; x= 1708328496; bh=xfklvt63Cya7crTHMbBmSR2hu8vK8DoS/tjKNZFEIvM=; b=K UXus+SbLoj6qQzj5ePwzijntzNCUvJX+bgI591lhsyQWy9jqyamk0Q7UVTXEoEX1 RHSRFT41n3u5Ot3Py9TfaEXTS2zI8YxM+iNDNw8K5pV0xaR0rHaj+U+6Ka9bAKc1 WgqWJasjHuzEHVvTg08HXJ1ShCaRI+IXyM9Vw1/rKOTrp80TFTnnckTx2bD+Ea3R KVapqJ/EEfut9mp3DgdROacY1axeNQVsPCbKhSLHlMAfE9GK1OlPMMgyqfaIuC0X 32uFWUU3xypxw3vxyA167VOIBZL5BQcje8beLz0KgqnIP0YB43TX0dPHo8JpkRZg xHbTPS5kSI/x+ewmj6LxA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 02:41:35 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Cc: alsa-devel@alsa-project.org Subject: [PATCH 1/4] ALSA: oxfw: use const qualifier for immutable argument Date: Sun, 18 Feb 2024 16:41:25 +0900 Message-Id: <20240218074128.95210-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240218074128.95210-1-o-takashi@sakamocchi.jp> References: <20240218074128.95210-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Message-ID-Hash: YGSFURXDZACTR7522TIOA5P2YSGEL4SM X-Message-ID-Hash: YGSFURXDZACTR7522TIOA5P2YSGEL4SM X-MailFrom: o-takashi@sakamocchi.jp X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: In the helper function, the first argument is immutable, thus it is preferable to use const qualifier. Signed-off-by: Takashi Sakamoto --- sound/firewire/oxfw/oxfw-stream.c | 2 +- sound/firewire/oxfw/oxfw.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index f4a702def397..6d8722f9d3a5 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -515,7 +515,7 @@ int snd_oxfw_stream_get_current_formation(struct snd_oxfw *oxfw, * in AV/C Stream Format Information Specification 1.1 (Apr 2005, 1394TA) * Also 'Clause 12 AM824 sequence adaption layers' in IEC 61883-6:2005 */ -int snd_oxfw_stream_parse_format(u8 *format, +int snd_oxfw_stream_parse_format(const u8 *format, struct snd_oxfw_stream_formation *formation) { unsigned int i, e, channels, type; diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h index d728e451a25c..39316aeafeaa 100644 --- a/sound/firewire/oxfw/oxfw.h +++ b/sound/firewire/oxfw/oxfw.h @@ -136,7 +136,7 @@ struct snd_oxfw_stream_formation { unsigned int pcm; unsigned int midi; }; -int snd_oxfw_stream_parse_format(u8 *format, +int snd_oxfw_stream_parse_format(const u8 *format, struct snd_oxfw_stream_formation *formation); int snd_oxfw_stream_get_current_formation(struct snd_oxfw *oxfw, enum avc_general_plug_dir dir, From patchwork Sun Feb 18 07:41:26 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 13561722 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 06D1FC48BC4 for ; Sun, 18 Feb 2024 07:51:43 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 8D67D86F; Sun, 18 Feb 2024 08:51:30 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 8D67D86F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708242700; bh=AOVaQ5YGKkgnrRNpZ0b6UYjZgF5LpdiTlNskz7iNyX4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=gzW8BruKngvSmwmafZEwxzBoTEsUdUWoHBVfyX+/TGxOjntsskrVh4PZylZ2679HN 2mcWlLP5yJK54ZP+4uA+9iMKr6rlYTdX3AoAB+iCMTKSYlJD6MIWGA0PBjyT4W3kob qDGUm3Xl0Cwh8vO/CGEl6gUNhqVWPWNHs7Ngs+xU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id E6208F80617; Sun, 18 Feb 2024 08:50:29 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 9E3BDF80617; Sun, 18 Feb 2024 08:50:27 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id A2681F804CC; Sun, 18 Feb 2024 08:44:56 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 9A0DEF8019B for ; Sun, 18 Feb 2024 08:41:38 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 9A0DEF8019B Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.a=rsa-sha256 header.s=fm1 header.b=pkc4whEL; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=T6JBqpvu Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id C739C5C006D; Sun, 18 Feb 2024 02:41:37 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Sun, 18 Feb 2024 02:41:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1708242097; x= 1708328497; bh=0bqKb4iHHHHhoPr3Sb4CXuMDS1hoDWcvBFIABEkLLBA=; b=p kc4whELJ5lXbrdW7OlrtPWDZDqSqRoYH7XJq6kIBFouFnMlwJtO4gucqd8ddMimj 4UDxB7MlvWKDoPpGCb22rUoTjuX4amAv3P5EIogBVzYfRFfRChj4/nBh99Z0DX7R pOnwhwzL/p2s9STlYZuemJ8cXQvDgrMgQDFyueqrQKJyB2p18RQH46TfWj+vzlkH Ei5M0HE51Leymw7h59ml9uAXSzsxliZ7gIurPk1qCISClhjziqjqO4LixrpzpN3G u84R4PL7w4D0Tz7HHBhczcV7QF92GpOv6wI8xuoWsRLNfMQ+nnTi9r85Uv6wHxRA NBiOiJgLw8cjBYuPMBlTw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708242097; x= 1708328497; bh=0bqKb4iHHHHhoPr3Sb4CXuMDS1hoDWcvBFIABEkLLBA=; b=T 6JBqpvuEcCaCaIEaw74nzfmr2SdaS3ekHR2k8I5WmNljiCUxQPTvFX2mCuWZF90z tpdEtDvPY+Lg4zVzqNZZrKKhs9KLyfThpzVd+oHceJp48H36Fv9UEtDWB3T3GSSM 8nNV+DoUlqSnFAUTWLhy4GxwJBvjUkbgh+znBETH7MwkjUY7h6qbTj7Xq4HeD4E0 oyIfmBqtJ9uAetCQ/Uweb9VWAfG69IBhmOTvk+keoX8/RhBkBBZ073qfC+3RxyY4 E7ItWkuSDs9MgOXU7UJpolV6yONgiiXx13xJ17G9nfVi2M+qsL/j4oeQj3iPa20B DFtWM50j65w5G0X2vOV6w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 02:41:36 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Cc: alsa-devel@alsa-project.org Subject: [PATCH 2/4] ALSA: oxfw: support the case that AV/C Stream Format Information command is not available Date: Sun, 18 Feb 2024 16:41:26 +0900 Message-Id: <20240218074128.95210-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240218074128.95210-1-o-takashi@sakamocchi.jp> References: <20240218074128.95210-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Message-ID-Hash: TU2UXDLLMB3KS75RBFLAEAJXZVL2GWLV X-Message-ID-Hash: TU2UXDLLMB3KS75RBFLAEAJXZVL2GWLV X-MailFrom: o-takashi@sakamocchi.jp X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Miglia Harmony Audio does neither support AV/C Stream Format Information command nor AV/C Extended Stream Format Information command. This commit adds a workaround for the case and uses the hard-coded formats. Signed-off-by: Takashi Sakamoto --- sound/firewire/oxfw/oxfw-stream.c | 96 +++++++++++++++++++++++-------- sound/firewire/oxfw/oxfw.h | 2 + 2 files changed, 75 insertions(+), 23 deletions(-) diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index 6d8722f9d3a5..40716bb989c7 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -486,26 +486,57 @@ int snd_oxfw_stream_get_current_formation(struct snd_oxfw *oxfw, enum avc_general_plug_dir dir, struct snd_oxfw_stream_formation *formation) { - u8 *format; - unsigned int len; int err; - len = AVC_GENERIC_FRAME_MAXIMUM_BYTES; - format = kmalloc(len, GFP_KERNEL); - if (format == NULL) - return -ENOMEM; + if (!(oxfw->quirks & SND_OXFW_QUIRK_STREAM_FORMAT_INFO_UNSUPPORTED)) { + u8 *format; + unsigned int len; - err = avc_stream_get_format_single(oxfw->unit, dir, 0, format, &len); - if (err < 0) - goto end; - if (len < 3) { - err = -EIO; - goto end; + len = AVC_GENERIC_FRAME_MAXIMUM_BYTES; + format = kmalloc(len, GFP_KERNEL); + if (format == NULL) + return -ENOMEM; + + err = avc_stream_get_format_single(oxfw->unit, dir, 0, format, &len); + if (err >= 0) { + if (len < 3) + err = -EIO; + else + err = snd_oxfw_stream_parse_format(format, formation); + } + + kfree(format); + } else { + // Miglia Harmony Audio does not support Extended Stream Format Information + // command. Use the duplicated hard-coded format, instead. + unsigned int rate; + u8 *const *formats; + int i; + + err = avc_general_get_sig_fmt(oxfw->unit, &rate, dir, 0); + if (err < 0) + return err; + + if (dir == AVC_GENERAL_PLUG_DIR_IN) + formats = oxfw->rx_stream_formats; + else + formats = oxfw->tx_stream_formats; + + for (i = 0; (i < SND_OXFW_STREAM_FORMAT_ENTRIES); ++i) { + if (!formats[i]) + continue; + + err = snd_oxfw_stream_parse_format(formats[i], formation); + if (err < 0) + continue; + + if (formation->rate == rate) + break; + } + if (i == SND_OXFW_STREAM_FORMAT_ENTRIES) + return -EIO; } - err = snd_oxfw_stream_parse_format(format, formation); -end: - kfree(format); return err; } @@ -600,14 +631,33 @@ assume_stream_formats(struct snd_oxfw *oxfw, enum avc_general_plug_dir dir, unsigned int i, eid; int err; - /* get format at current sampling rate */ - err = avc_stream_get_format_single(oxfw->unit, dir, pid, buf, len); - if (err < 0) { - dev_err(&oxfw->unit->device, - "fail to get current stream format for isoc %s plug %d:%d\n", - (dir == AVC_GENERAL_PLUG_DIR_IN) ? "in" : "out", - pid, err); - goto end; + // get format at current sampling rate. + if (!(oxfw->quirks & SND_OXFW_QUIRK_STREAM_FORMAT_INFO_UNSUPPORTED)) { + err = avc_stream_get_format_single(oxfw->unit, dir, pid, buf, len); + if (err < 0) { + dev_err(&oxfw->unit->device, + "fail to get current stream format for isoc %s plug %d:%d\n", + (dir == AVC_GENERAL_PLUG_DIR_IN) ? "in" : "out", + pid, err); + goto end; + } + } else { + // Miglia Harmony Audio does not support Extended Stream Format Information + // command. Use the hard-coded format, instead. + buf[0] = 0x90; + buf[1] = 0x40; + buf[2] = avc_stream_rate_table[0]; + buf[3] = 0x00; + buf[4] = 0x01; + + if (dir == AVC_GENERAL_PLUG_DIR_IN) + buf[5] = 0x08; + else + buf[5] = 0x02; + + buf[6] = 0x06; + + *len = 7; } /* parse and set stream format */ diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h index 39316aeafeaa..3bf8d7bec636 100644 --- a/sound/firewire/oxfw/oxfw.h +++ b/sound/firewire/oxfw/oxfw.h @@ -52,6 +52,8 @@ enum snd_oxfw_quirk { // performs media clock recovery voluntarily. In the recovery, the packets with NO_INFO // are ignored, thus driver should transfer packets with timestamp. SND_OXFW_QUIRK_VOLUNTARY_RECOVERY = 0x20, + // Miglia Harmony Audio does not support AV/C Stream Format Information command. + SND_OXFW_QUIRK_STREAM_FORMAT_INFO_UNSUPPORTED = 0x40, }; /* This is an arbitrary number for convinience. */ From patchwork Sun Feb 18 07:41:27 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 13561719 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id C2F9EC4829E for ; Sun, 18 Feb 2024 07:50:56 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id AD3D2BC0; Sun, 18 Feb 2024 08:50:43 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz AD3D2BC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708242653; bh=a2736GuvevjxKu2DugmT3osmAD4m8ekkFwJXyTibR1o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ofd6J+P/1qLmpHRqdr7QcRjrq7mnIIE4TQjvt9jey0x/Z1ctyvlW2+k/I9Bu/WFOg zS325+QbAxecfB5jeLDBMFAVM7G3hqQ4VVg993zdjnLLEeSJ+F6ch1tb1L27qFgqEG DeBcjZ+QW7fd9I2oB+aZh1DMMTMTJP1QoecbAK0s= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 9A363F805AA; Sun, 18 Feb 2024 08:50:20 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 85761F805A8; Sun, 18 Feb 2024 08:50:19 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 350F0F80496; Sun, 18 Feb 2024 08:44:32 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CD6FEF80496 for ; Sun, 18 Feb 2024 08:41:40 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CD6FEF80496 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.a=rsa-sha256 header.s=fm1 header.b=Yz+aFdrn; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=W8WwA7kQ Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 4D0C15C0070; Sun, 18 Feb 2024 02:41:39 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 18 Feb 2024 02:41:39 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1708242099; x= 1708328499; bh=q2s75MGjAW5JOX5jbhZdViqawKA/HJYPnRCN4QVm5Yc=; b=Y z+aFdrnnEUM8bKJVfgzVLB9+tmP8xrnje8TlEkUIeSWB4idHMmINQjFxpTnHIDaU WoTWMm6YK0Da4QDBqdksgxos7h7UoEAdFjJWmil6/8sq1khKOkVxJ32bDmpFrNUi Kv1R7vdX5CFLjfnbfN4aas821JB5Onj+/3z7zlQVcPdJOgXoLoWx8DBe38LbWrMs oTh69pxqKnsHC08Ps5y6A03GAw46d61wKWbW8OyR7tBxLGedLk5VTaqVSYWAVIf9 7oXYFCnwwoqppckyPnDbCFL8KwLSdJ6Ux8GMJalzrxEcIjjqQ5McsLo9bU6A8VG0 mzIvBqjogufTNO6waYcLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708242099; x= 1708328499; bh=q2s75MGjAW5JOX5jbhZdViqawKA/HJYPnRCN4QVm5Yc=; b=W 8WwA7kQj2JLbRSf2hsLWttYd+4sK/P2/Gxv21TWukJzHnMlEYLbhpwxiJdXBxwXl fwZ/IVG9oYrmXbGWgVlUqGiZbynQFpMOqS+m4byM7HzoDOxIew4AQzAouKk/PhIl g57wW2eBg6al7wovGng7NMyGgrthu4zWkUlHX7gwkFLAL7eJzt9yAohCf3K/Au76 k220x1w0TqdoV8Reh3CA8Nd6JnqB2OCerOiCyrh8jNoc0U8LxaavSMfG2YKckX8k H37nPubwsTVoK98Hl2Ylxb/LkF3uEgf1mWfXGuyZcWT8RuJTxxjLseh7175CH8Th +Yrj/yV5jm8N8PV5aLyBg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehgdduudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 02:41:38 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Cc: alsa-devel@alsa-project.org Subject: [PATCH 3/4] ALSA: firewire-lib: handle quirk to calculate payload quadlets as data block counter Date: Sun, 18 Feb 2024 16:41:27 +0900 Message-Id: <20240218074128.95210-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240218074128.95210-1-o-takashi@sakamocchi.jp> References: <20240218074128.95210-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Message-ID-Hash: 66JL433DMJQFPVDK4NZ2X4KHWYGCGJUO X-Message-ID-Hash: 66JL433DMJQFPVDK4NZ2X4KHWYGCGJUO X-MailFrom: o-takashi@sakamocchi.jp X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Miglia Harmony Audio (OXFW970) has a quirk to put the number of accumulated quadlets in CIP payload into the dbc field of CIP header. This commit handles the quirk in the packet processing layer. Signed-off-by: Takashi Sakamoto --- sound/firewire/amdtp-stream.c | 12 ++++++++---- sound/firewire/amdtp-stream.h | 4 ++++ 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/sound/firewire/amdtp-stream.c b/sound/firewire/amdtp-stream.c index a13c0b408aad..9d5a025d2e96 100644 --- a/sound/firewire/amdtp-stream.c +++ b/sound/firewire/amdtp-stream.c @@ -773,10 +773,14 @@ static int check_cip_header(struct amdtp_stream *s, const __be32 *buf, } else { unsigned int dbc_interval; - if (*data_blocks > 0 && s->ctx_data.tx.dbc_interval > 0) - dbc_interval = s->ctx_data.tx.dbc_interval; - else - dbc_interval = *data_blocks; + if (!(s->flags & CIP_DBC_IS_PAYLOAD_QUADLETS)) { + if (*data_blocks > 0 && s->ctx_data.tx.dbc_interval > 0) + dbc_interval = s->ctx_data.tx.dbc_interval; + else + dbc_interval = *data_blocks; + } else { + dbc_interval = payload_length / sizeof(__be32); + } lost = dbc != ((*data_block_counter + dbc_interval) & 0xff); } diff --git a/sound/firewire/amdtp-stream.h b/sound/firewire/amdtp-stream.h index b7ff44751ab9..a1ed2e80f91a 100644 --- a/sound/firewire/amdtp-stream.h +++ b/sound/firewire/amdtp-stream.h @@ -37,6 +37,9 @@ * the value of current SYT_INTERVAL; e.g. initial value is not zero. * @CIP_UNAWARE_SYT: For outgoing packet, the value in SYT field of CIP is 0xffff. * For incoming packet, the value in SYT field of CIP is not handled. + * @CIP_DBC_IS_PAYLOAD_QUADLETS: Available for incoming packet, and only effective with + * CIP_DBC_IS_END_EVENT flag. The value of dbc field is the number of accumulated quadlets + * in CIP payload, instead of the number of accumulated data blocks. */ enum cip_flags { CIP_NONBLOCKING = 0x00, @@ -51,6 +54,7 @@ enum cip_flags { CIP_NO_HEADER = 0x100, CIP_UNALIGHED_DBC = 0x200, CIP_UNAWARE_SYT = 0x400, + CIP_DBC_IS_PAYLOAD_QUADLETS = 0x800, }; /** From patchwork Sun Feb 18 07:41:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Sakamoto X-Patchwork-Id: 13561720 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 0DD8BC4829E for ; Sun, 18 Feb 2024 07:51:14 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 16A4D9F6; Sun, 18 Feb 2024 08:51:02 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 16A4D9F6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1708242672; bh=dawZnq4u46P+YqsTtC7cIz0zKc0IN7gLvzYq9j14sgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=ErTa0mp3PpZQeOUStGM4KzNxssxS6eEZbW1mles/kO/ysXV55WpH6O44UyB5fmtSH ss7/nr0DW1AJvSoG7W/3aAY58uRZCjEi53RsYNz6wVjLCXTf0ahDkakAwXeqYysem+ /CHKANL9m0SRtISGpPqkGZR2jNg2swdGHxs6C9T8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DABB4F805C4; Sun, 18 Feb 2024 08:50:25 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 521DDF805D2; Sun, 18 Feb 2024 08:50:24 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AD102F80568; Sun, 18 Feb 2024 08:44:45 +0100 (CET) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id CC6AAF804CC for ; Sun, 18 Feb 2024 08:41:42 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz CC6AAF804CC Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.a=rsa-sha256 header.s=fm1 header.b=Uojw0EDP; dkim=pass (2048-bit key, unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm1 header.b=T9Q6fHpm Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id DDA885C0071; Sun, 18 Feb 2024 02:41:40 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Sun, 18 Feb 2024 02:41:40 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1708242100; x= 1708328500; bh=X3uHAM0FEYgvjXcOj8xfkn7M51HAJ4N/hout0BLOOd0=; b=U ojw0EDPfdzaFVXansMAmUaU9qqJqktdaH6n8yn0C7RU8LpASchwiIe3NHni9nn5D fyAAsRBPh0vbVBv9YIWirJXnU6PMIwQY2L5pmazJIMQb5S0RPrOiCELzVeNAkW51 y36PaQ3lK0oNNxsS52CueGbmcMDbi08c3M3V2sSVkJdN+10s//6x1YK6n32f85Pv P4NOOKvKB8A///bt2elGXeadN6IDgwuIyaauiymbb/1qFiu56a2GSGESiLIK7ORW Yh5LajajZLgDkJhdiI5eMVlGCLLOoI2kFdcKtK8DVpCCIJ/bmwpALePNhrsgwqmf b+B4LJcK0LPNvcQxt2v5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1708242100; x= 1708328500; bh=X3uHAM0FEYgvjXcOj8xfkn7M51HAJ4N/hout0BLOOd0=; b=T 9Q6fHpmtDxicJpfDlMY0TjgGe0CsgLu1KoEefb+Dd8ialVHDbI/RtVrYANo5O93h MUH/D883uLRPbZkcu1Ap9Ksa4Kzu6I/bw2CH46tsYRF0vVlE2Zh/hDmDbLAWmJvn 7hUdXRyJdaRMnv2ZZHPwAIoATSBxU4vK6l0pV+oPNwqBO4uZMPXCTlsuGkLFxGxP mel60+V0bwFGOPOVA269ymN9N9Q0/iEjZxT4tCFK/LEaDKQDkwL+i0Z8p0S1AI1j 9sFgHzaJ1/EURk29TaYR9T/5Q2MrpOvSFa56glBcfZVviviIfxWkQqSbKnXmz1OW cETw99+ZlqBhrPzgOTp+A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrvdehgdduuddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtke ertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghk rghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgje euvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhise hsrghkrghmohgttghhihdrjhhp X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 18 Feb 2024 02:41:39 -0500 (EST) From: Takashi Sakamoto To: tiwai@suse.de Cc: alsa-devel@alsa-project.org Subject: [PATCH 4/4] ALSA: oxfw: add support for Miglia Harmony Audio Date: Sun, 18 Feb 2024 16:41:28 +0900 Message-Id: <20240218074128.95210-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240218074128.95210-1-o-takashi@sakamocchi.jp> References: <20240218074128.95210-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Message-ID-Hash: A2LT2RNQSUQJJVLCEGN6OKPOUHLW577Y X-Message-ID-Hash: A2LT2RNQSUQJJVLCEGN6OKPOUHLW577Y X-MailFrom: o-takashi@sakamocchi.jp X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Miglia Technology ships Harmony Audio 2004. It uses Oxford Semiconductor OXFW970 for communication function in IEEE 1394 bus. This commit adds support for the model. In my opinion, the firmware of ASIC is really the initial stage, since it has the following quirks. * It skips several isochronous cycles to transmit isochronous packets when receiving any asynchronous transaction. * The value of dbc field in the transmitted packet is the number of accumulated quadlets in CIP payload, instead of the accumulated data blocks. Furthermore, the value includes the quadlets of CIP payload in the packet. * It neither supports AV/C Stream Format Information command nor AV/C Extended Stream Format Information command. * The vendor and model information in root directory of configuration ROM includes some mistakes. Additionally, when operating at 96.0 kHz, it often skips much isochronous cycles to transmit the isochronous packets. The issue is detected as cycle discontinuity and ALSA PCM application receives -EIO at any operation for PCM substream. I have never found any workaround yet. $ config-rom-pretty-printer < /sys/bus/firewire/devices/fw1/config_rom ROM header and bus information block ----------------------------------------------------------------- 1024 04249e04 bus_info_length 4, crc_length 36, crc 40452 1028 31333934 bus_name "1394" 1032 20ff5003 irmc 0, cmc 0, isc 1, bmc 0, cyc_clk_acc 255, max_rec 5 (64) 1036 0030e002 company_id 0030e0 | 1040 00454647 device_id 8594474567 | EUI-64 13757098081207879 root directory ----------------------------------------------------------------- 1044 00062d69 directory_length 6, crc 11625 1048 030030e0 vendor 1052 8100000a --> descriptor leaf at 1092 1056 1700f970 model 1060 81000011 --> descriptor leaf at 1128 1064 0c0083c0 node capabilities: per IEEE 1394 1068 d1000001 --> unit directory at 1072 unit directory at 1072 ----------------------------------------------------------------- 1072 00046ff9 directory_length 4, crc 28665 (should be 43676) 1076 1200a02d specifier id 1080 13010001 version 1084 1700f970 model 1088 8100000f --> descriptor leaf at 1148 descriptor leaf at 1092 ----------------------------------------------------------------- 1092 00085f8a leaf_length 8, crc 24458 1096 00000000 textual descriptor 1100 00000000 minimal ASCII 1104 4d69676c "Migl" 1108 69612054 "ia T" 1112 6563686e "echn" 1116 6f6c6f67 "olog" 1120 79204c74 "y Lt" 1124 642e0000 "d." descriptor leaf at 1128 ----------------------------------------------------------------- 1128 00040514 leaf_length 4, crc 1300 1132 00000000 textual descriptor 1136 00000000 minimal ASCII 1140 4f584657 "OXFW" 1144 20393730 " 970" descriptor leaf at 1148 ----------------------------------------------------------------- 1148 0005a1dc leaf_length 5, crc 41436 1152 00000000 textual descriptor 1156 00000000 minimal ASCII 1160 4861726d "Harm" 1164 6f6e7941 "onyA" 1168 7564696f "udio" Signed-off-by: Takashi Sakamoto --- sound/firewire/oxfw/oxfw-stream.c | 2 ++ sound/firewire/oxfw/oxfw.c | 10 +++++++++- sound/firewire/oxfw/oxfw.h | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/sound/firewire/oxfw/oxfw-stream.c b/sound/firewire/oxfw/oxfw-stream.c index 40716bb989c7..00f7feb91f92 100644 --- a/sound/firewire/oxfw/oxfw-stream.c +++ b/sound/firewire/oxfw/oxfw-stream.c @@ -177,6 +177,8 @@ static int init_stream(struct snd_oxfw *oxfw, struct amdtp_stream *stream) flags |= CIP_JUMBO_PAYLOAD; if (oxfw->quirks & SND_OXFW_QUIRK_WRONG_DBS) flags |= CIP_WRONG_DBS; + if (oxfw->quirks & SND_OXFW_QUIRK_DBC_IS_TOTAL_PAYLOAD_QUADLETS) + flags |= CIP_DBC_IS_END_EVENT | CIP_DBC_IS_PAYLOAD_QUADLETS; } else { conn = &oxfw->in_conn; c_dir = CMP_INPUT; diff --git a/sound/firewire/oxfw/oxfw.c b/sound/firewire/oxfw/oxfw.c index 241a697ce26b..98ae0e8cba87 100644 --- a/sound/firewire/oxfw/oxfw.c +++ b/sound/firewire/oxfw/oxfw.c @@ -21,6 +21,7 @@ #define VENDOR_TASCAM 0x00022e #define OUI_STANTON 0x001260 #define OUI_APOGEE 0x0003db +#define OUI_OXFORD 0x0030e0 #define MODEL_SATELLITE 0x00200f #define MODEL_SCS1M 0x001000 @@ -232,6 +233,11 @@ static int oxfw_probe(struct fw_unit *unit, const struct ieee1394_device_id *ent if (err < 0) goto error; + if (entry->vendor_id == OUI_OXFORD && entry->model_id == 0x00f970) { + oxfw->quirks |= SND_OXFW_QUIRK_STREAM_FORMAT_INFO_UNSUPPORTED | + SND_OXFW_QUIRK_DBC_IS_TOTAL_PAYLOAD_QUADLETS; + } + err = snd_oxfw_stream_discover(oxfw); if (err < 0) goto error; @@ -330,6 +336,9 @@ static const struct ieee1394_device_id oxfw_id_table[] = { // OXFW_DEV_ENTRY(VENDOR_GRIFFIN, 0x00f970, &griffin_firewave), OXFW_DEV_ENTRY(VENDOR_LACIE, 0x00f970, &lacie_speakers), + // Miglia HarmonyAudio (HA02). The numeric vendor ID is ASIC vendor and the model ID is the + // default value of ASIC. + OXFW_DEV_ENTRY(OUI_OXFORD, 0x00f970, NULL), // Behringer,F-Control Audio 202. The value of SYT field is not reliable at all. OXFW_DEV_ENTRY(VENDOR_BEHRINGER, 0x00fc22, NULL), // Loud Technologies, Tapco Link.FireWire 4x6. The value of SYT field is always 0xffff. @@ -337,7 +346,6 @@ static const struct ieee1394_device_id oxfw_id_table[] = { // Loud Technologies, Mackie Onyx Satellite. Although revised version of firmware is // installed to avoid the postpone, the value of SYT field is always 0xffff. OXFW_DEV_ENTRY(VENDOR_LOUD, MODEL_SATELLITE, NULL), - // Miglia HarmonyAudio. Not yet identified. // // OXFW971 devices: diff --git a/sound/firewire/oxfw/oxfw.h b/sound/firewire/oxfw/oxfw.h index 3bf8d7bec636..39ea9a6dde33 100644 --- a/sound/firewire/oxfw/oxfw.h +++ b/sound/firewire/oxfw/oxfw.h @@ -54,6 +54,9 @@ enum snd_oxfw_quirk { SND_OXFW_QUIRK_VOLUNTARY_RECOVERY = 0x20, // Miglia Harmony Audio does not support AV/C Stream Format Information command. SND_OXFW_QUIRK_STREAM_FORMAT_INFO_UNSUPPORTED = 0x40, + // Miglia Harmony Audio transmits CIP in which the value of dbc field expresses the number + // of accumulated payload quadlets including the packet. + SND_OXFW_QUIRK_DBC_IS_TOTAL_PAYLOAD_QUADLETS = 0x80, }; /* This is an arbitrary number for convinience. */