From mboxrd@z Thu Jan 1 00:00:00 1970 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 DF787C77B73 for ; Mon, 22 May 2023 10:33:25 +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 D5AF13E7; Mon, 22 May 2023 12:32:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz D5AF13E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1684751602; bh=81hCSt8+B0uByXWcx/eG15X//leyMcS/VqPcJT0Flec=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=c8M9v8wQQsixsJevLWJoOvw6gGbjP52dFhHRZLluy86p9XHYfrkDXGLJojIPEMJue J/urJsf64haT6Tmp0NMhMMeup2XucmEh9tOCFlqgyTiGY6rcKSgaDVBseGU4e+MRG4 wJn+z6hqgiDIlEYykz8cptU8gKHOWH+vXbsUJFEs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 70766F80086; Mon, 22 May 2023 12:31:57 +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 CC58FF80086; Mon, 22 May 2023 12:31:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D8E1DF8024E; Mon, 22 May 2023 12:31:52 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (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 5C19FF8016A for ; Mon, 22 May 2023 12:31:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 5C19FF8016A Authentication-Results: alsa1.perex.cz; dkim=pass (1024-bit key, unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=JWKOUhPD; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=GQjHxhdj Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id B1B161FDBB; Mon, 22 May 2023 10:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684751507; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YuKTCvKe7x62a/fstls2qgjAFO+8ikAQTzZ5OA2WZpA=; b=JWKOUhPDbmwuTp8TYdV2P0Ge52HjOifoC09t095JgB/TI20amNNVg+5euKs4NMqDjF5NaJ lCEc13W939JhawvMG2Ya2+V2BGeHXarYlZzmC572EQt9yv9r5KjA/VgzVpmyeI28NIGpFD iXMGInURxBSbIAqN+qwY6t5OxKMVM7A= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684751507; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=YuKTCvKe7x62a/fstls2qgjAFO+8ikAQTzZ5OA2WZpA=; b=GQjHxhdj2GpEkzLx/ZX2DT4KEhLFDPgYhhHFYGulpr/OOg7evQ7IkYEfylwwWscv7Y9zlq ekbPyfAkNINm3QAg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 93F2213776; Mon, 22 May 2023 10:31:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id JZpDI5NEa2StFgAAMHmgww (envelope-from ); Mon, 22 May 2023 10:31:47 +0000 Date: Mon, 22 May 2023 12:31:47 +0200 Message-ID: <87h6s4y7vw.wl-tiwai@suse.de> From: Takashi Iwai To: Jaroslav Kysela Cc: alsa-devel@alsa-project.org Subject: Re: [PATCH 24/36] ALSA: seq: Add UMP support In-Reply-To: <87jzx0yevr.wl-tiwai@suse.de> References: <20230519093114.28813-1-tiwai@suse.de> <20230519093114.28813-25-tiwai@suse.de> <643cd65f-74f3-97b8-f48a-6cb25772095d@perex.cz> <87jzx0yevr.wl-tiwai@suse.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII Message-ID-Hash: Z3MKYVCWWZHJLQL65OJFMRQZFTPGWTBC X-Message-ID-Hash: Z3MKYVCWWZHJLQL65OJFMRQZFTPGWTBC X-MailFrom: tiwai@suse.de 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: On Mon, 22 May 2023 10:00:40 +0200, Takashi Iwai wrote: > > On Mon, 22 May 2023 09:34:45 +0200, > Jaroslav Kysela wrote: > > > > On 19. 05. 23 11:31, Takashi Iwai wrote: > > > Starting from this commit, we add the basic support of UMP (Universal > > > MIDI Packet) events on ALSA sequencer infrastructure. The biggest > > > change here is that, for transferring UMP packets that are up to 128 > > > bits, we extend the data payload of ALSA sequencer event record when > > > the client is declared to support for the new UMP events. > > > > > > A new event flag bit, SNDRV_SEQ_EVENT_UMP, is defined and it shall be > > > set for the UMP packet events that have the larger payload of 128 > > > bits, defined as struct snd_seq_ump_event. > > > > > > For applications that want to access the UMP packets, first of all, a > > > sequencer client has to declare the user-protocol to match with the > > > latest one via the new SNDRV_SEQ_IOCTL_USER_PVERSION; otherwise it's > > > treated as if a legacy client without UMP support. > > > > > > Then the client can switch to the new UMP mode (MIDI 1.0 or MIDI 2.0) > > > with a new field, midi_version, in snd_seq_client_info. When switched > > > to UMP mode (midi_version = 1 or 2), the client can write the UMP > > > events with SNDRV_SEQ_EVENT_UMP flag. For reads, the alignment size > > > is changed from snd_seq_event (28 bytes) to snd_seq_ump_event (32 > > > bytes). When a UMP sequencer event is delivered to a legacy sequencer > > > client, it's ignored or handled as an error. > > > > The internal struct snd_seq_event_cell is also extended by 4 bytes. I > > think that it is worth to note this in this commit (the memory > > footprint is slightly growing). > > Yes, will do that. But note that the size growth of > snd_seq_event_cell happens only for 32bit archs (there was already > padding on 64bit archs). > > > Maybe handle !SND_UMP here, but we can > > wait, if someone really requires this optimization. > > Right, I began with that, but I threw it away in the end as it becomes > unnecessarily complex. Actually the optimization with CONFIG_SND_SEQ_UMP was already done; unless CONFIG_SND_SEQ_UMP is set, the old size of snd_seq_event_cell is still kept. The definition of union __snd_seq_event in seq_memory.c takes care of the conditional builds. What I meant was to adjust the cell size dynamically depending on the supported midi_version, and this will make things too flaky. Takashi