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 3853AC001DF for ; Mon, 31 Jul 2023 08:10:49 +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 9FAAE82B; Mon, 31 Jul 2023 10:09:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 9FAAE82B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1690791047; bh=p2Rvfw2SQhBfkZaMV8APah4QsQbk8URNr6pqE768AY4=; h=Date:Subject:To:References:Cc:From:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=r3Me4YFcrY+6N0jIigf9vFl26hWQXfE9nqV+RZq8/Ld8kiVSNaLgeXCpEY3WTdFi+ bnxCPTPSyWFvVwpbV1O4ORzqs1ohtmF8eSZCFO/4zPUNeQ9TlWFSRhkUmc+8QDyMh3 JdtzBxWNdzZcMgaJAPRR/nQB3DxS2Mr97l6vlBvY= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 78BF5F80535; Mon, 31 Jul 2023 10:09:34 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id E1550F8025A; Mon, 31 Jul 2023 10:09:33 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5BDE5F8016D; Mon, 31 Jul 2023 10:09:28 +0200 (CEST) Received: from asave03.hostfactory.ch (asave03.hostfactory.ch [185.16.174.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id BE70AF8015B for ; Mon, 31 Jul 2023 10:09:18 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz BE70AF8015B Received: from server11.hostfactory.ch ([185.117.169.60]) by asave03.hostfactory.ch with esmtps (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qQNxr-0002nm-TE; Mon, 31 Jul 2023 10:09:18 +0200 Received: from [192.168.0.84] (156.14.3.213.static.wline.lns.sme.cust.swisscom.ch [213.3.14.156]) (Authenticated sender: michele.perrone@weiss.ch) by server11.hostfactory.ch (Postfix) with ESMTPSA id 709534992C743; Mon, 31 Jul 2023 10:09:14 +0200 (CEST) Message-ID: <7a0cf3fd-9e31-45e1-7aa4-97cab27dafa7@weiss.ch> Date: Mon, 31 Jul 2023 10:09:14 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] ALSA: dice: add stream format parameters for Weiss devices Content-Language: en-US To: Takashi Sakamoto References: <24703333-9250-40bf-e736-a5f3c4862034@weiss.ch> <20230728131308.GA142765@workstation.local> Cc: Takashi Iwai , alsa-devel@alsa-project.org, Rolf Anderegg , Isabelle Kernhof From: Michele Perrone In-Reply-To: <20230728131308.GA142765@workstation.local> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-PPP-Message-ID: <169079095479.15375.221983064967477986@server11.hostfactory.ch> X-PPP-Vhost: weiss.ch X-Originating-IP: 185.117.169.60 X-SpamExperts-Domain: outboundprotection.hostfactory.ch X-SpamExperts-Username: 185.117.169.60 Authentication-Results: hostfactory.ch; auth=pass smtp.auth=185.117.169.60@outboundprotection.hostfactory.ch X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Outgoing-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UA3EXwVZsUrO1pQLFulr+0XJFLCc5JBDg/DuVS+6bxvXd/7 letIjrtpibSb/SyV2tgPvU99YyY/YbCBRYqzuKqmj3A3J8ouFAUyHyD8hLK/N/PWsNsAev5dTaeU 7SGsgkr4dGkXW6U4t9vNE4trlxFztZQ7GV5HQgbCLag5FuwzUW6yemp60T2QcASMfkrWmSkl0pF8 dj8luXC7km26QtXP9s02LA== X-Report-Abuse-To: spam@asave01.hostfactory.ch Message-ID-Hash: LZX5B42ALESGDYBWP4CQPNMY6CDHK6K4 X-Message-ID-Hash: LZX5B42ALESGDYBWP4CQPNMY6CDHK6K4 X-MailFrom: michele.perrone@weiss.ch 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.8 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: Dear Mr. Sakamoto, thank you very much for the prompt feedback, and also for your contributions to the Linux audio Firewire stack during the last decade. We at Weiss Engineering would like to improve Linux support for our Firewire devices in order to extend their lifetimes. We have also occasionally received requests for Linux compatibility from some customers. This is also motivated by the fact that the old DICE Apple driver, which was originally developed by TCAT, is not maintained anymore and does not work on Apple Silicon computers. Therefore, we would like to give the alternative of running our devices on Linux if the customers decide to do. We are also working on a update for our old music archive network player (MAN301), which uses a DICE chip to interface with its DAC; so it seemed only fair that owners of all Weiss devices based on DICE benefited from this. Sorry for mistakes 1, 2, and 3 (you can tell it's my first kernel patch). And I indeed forgot to include the snd_dice_detect_weiss_formats() prototype into the patch submittal. About the 4th issue, yes, the 'category_id' is still correct [1]. About the 5th issue, you are right both about the wrong tx/rx direction and the absence of isochronous packets from the device. I checked the DICE firmware code for the INT202 and we are indeed sending isochronous packets from the device. Therefore, the correct stream formats should look like this: +/* Weiss INT202: 192kHz unidirectional 2-channel digital Firewire interface */ +static const struct dice_weiss_spec int202 = { +    .tx_pcm_chs = {{2, 2, 2}, {0, 0, 0} }, +    .rx_pcm_chs = {{2, 2, 2}, {0, 0, 0} }, +    .has_midi   = false +}; I tested this configuration with XLR and RCA outputs, and it works correctly. Sorry for the mistake, I don't have a deep knowledge about the old DICE firmware because I've started working at Weiss Engineering only recently. About the configuration ROMs, that shouldn't be an issue; let me get back to you as soon as I speak with my colleague, Rolf Anderegg. He has worked on our DICE devices in the past but he's on vacation right now. Yet another topic is AVC support. We used to have support for it for the DICE driver in the 3.x kernel, and we are in the process of re-adapting that code. But this should be probably discussed in a separate e-mail. [1]: https://github.com/torvalds/linux/commit/a471fcde8c2c4b65f110bb4210af3513ee4deeb8 Kind regards, Michele Perrone On 28/07/23 15:13, Takashi Sakamoto wrote: > ei, > > On Fri, Jul 28, 2023 at 11:16:11AM +0200, Michele Perrone wrote: >> Hard-coded stream format parameters are added for Weiss Engineering >> FireWire devices. When the device vendor and model match, the parameters >> are copied into the stream format cache. This allows for setting all >> supported sampling rates up to 192kHz, and consequently adjusting the >> number of available I/O channels. >> >> Signed-off-by: Rolf Anderegg >> Signed-off-by: Michele Perrone >> --- >>  sound/firewire/dice/Makefile     |   2 +- >>  sound/firewire/dice/dice-weiss.c | 120 +++++++++++++++++++++++++++++++ >>  sound/firewire/dice/dice.c       |  72 +++++++++++++++++++ >>  3 files changed, 193 insertions(+), 1 deletion(-) >>  create mode 100644 sound/firewire/dice/dice-weiss.c > Thanks for the patch. I've been waiting so long for such patches to > support Weiss models. I welcome them. > > As long as reviewing, I found some format and technical issues on the > patches: > > Format issues: > 1.unexpected line break > 2.tab indentations are replaced with spaces > > Technical issues: > 3.build error due to missing snd_dice_detect_weiss_formats() > * prototype of snd_dice_detect_weiss_formats() should be in dice.c > 4. category_id in GUID > 5.stream formats for INT202 > > I can correct 1st, 2nd, and 3rd issues. You can find the revised patch > in the top-most of my remote repository[1]. > > Let me confirm the 4th issue. TCAT defines 'category_id' field in GUID > value of devices. As long as I know, Weiss engineers uses 0x00 in the > field[2]. Is it still correct for the devices supported in the patch? > > Next, let us discuss about INT202 stream formats. > > + > +/* Weiss INT202: 192kHz unidirectional 2-channel digital Firewire interface > */ > +static const struct dice_weiss_spec int202 = { > +    .tx_pcm_chs = {{2, 2, 2}, {0, 0, 0} }, > +    .rx_pcm_chs = {{0, 0, 0}, {0, 0, 0} }, > +    .has_midi   = false > +}; > > (tx/rx should be device-oriented, tx = from device, rx = to device, > please correct) > > I assume all of the DICE devices transmit isochronous packets to deliver > presentation time stamp and events (= PCM frames). Then driver software > utilizes the presentation time stamp and the amount of events to construct > payload of isochronous packets into the device. > > I program ALSA dice driver based on the assumption, thus ALSA dice driver > doesn't work well without receiving any isochronous packet from the > device. However, the stream formats for INT202 device looks to support > uni-directional operation. Weiss engineers really use DICE chipset like > that? If so, I need to integrate the driver to support the case. > > > As another topic. I make collection of configuration ROMs[3] to make better > support for the devices in Linux system[4]. I'm pleased if you pick them > up from your devices and dedicate them for the collection. > > [1] https://github.com/takaswie/sound/tree/topic/dice/weiss-support > [2] https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git/tree/sound/firewire/dice/dice.c?h=v6.4#n59 > [3] https://github.com/takaswie/am-config-roms/ > [4] https://github.com/systemd/systemd/blob/main/hwdb.d/80-ieee1394-unit-function.hwdb > > > Thanks > > Takashi Sakamoto