From patchwork Wed Jun 19 15:28:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 806745 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 CA8F5C27C53 for ; Wed, 19 Jun 2024 15:30:00 +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 37DA9E9A; Wed, 19 Jun 2024 17:29:49 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 37DA9E9A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718810999; bh=Q+I7QMz5d2GPBZlf9ga12Rx0I8x2FTczsKdUVlPXiuY=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=SfB99ygifuyT+tcI5hWZU/mXW45LRus3BVDbNjRkbl6rdaUuE0V9tohV4j03xL2AC wKCX6fbD/N9/awNnPBbH9ADTAZ3YGb3Hy7I84qbRvNfxrtIK7lDtbWGO6kI47Ckb67 bdzdgqMdYJj8oJS0DY1LWs3bX06H7WzxPPd6Qqa0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 22A33F80609; Wed, 19 Jun 2024 17:29:00 +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 867B2F805FA; Wed, 19 Jun 2024 17:29:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id BDE0AF805E3; Wed, 19 Jun 2024 17:28:55 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 D7444F8023A for ; Wed, 19 Jun 2024 17:28:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz D7444F8023A 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=ZeEovv6Q; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=93DIMXLJ; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=ZeEovv6Q; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=93DIMXLJ Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id 0BBDC21A2C; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2LnqGy5ovUhK0PBDXZ0fw0CRxxl2UWlUISV4j/LbwSk=; b=ZeEovv6Q//DgZTvkEl3HhTv3gDCiLIAFL3eQ7xBuLwuxfceWVT4qFzNXJl9+/kZSOvN23D r0pr+U/gmQ4o1sqyNZcqi6t/stvoQLTi+k8hGCOORMjKcTYm1LDP5qtJYaNY8lLUqp5in9 Z9rU0Ez/CpZsJk5TgoITaGskBOPmb9U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2LnqGy5ovUhK0PBDXZ0fw0CRxxl2UWlUISV4j/LbwSk=; b=93DIMXLJzKiV6eG82mBxKbB30sCMkSNK7+wm1eMj4kiE90yUzPVtRb9QfH2k5mb8bL88L1 xBjN7i8nkQQZRvAQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=ZeEovv6Q; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=93DIMXLJ DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2LnqGy5ovUhK0PBDXZ0fw0CRxxl2UWlUISV4j/LbwSk=; b=ZeEovv6Q//DgZTvkEl3HhTv3gDCiLIAFL3eQ7xBuLwuxfceWVT4qFzNXJl9+/kZSOvN23D r0pr+U/gmQ4o1sqyNZcqi6t/stvoQLTi+k8hGCOORMjKcTYm1LDP5qtJYaNY8lLUqp5in9 Z9rU0Ez/CpZsJk5TgoITaGskBOPmb9U= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=2LnqGy5ovUhK0PBDXZ0fw0CRxxl2UWlUISV4j/LbwSk=; b=93DIMXLJzKiV6eG82mBxKbB30sCMkSNK7+wm1eMj4kiE90yUzPVtRb9QfH2k5mb8bL88L1 xBjN7i8nkQQZRvAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id E367813AAA; Wed, 19 Jun 2024 15:28:30 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id GHUKNh75cmYRJAAAD6G6ig (envelope-from ); Wed, 19 Jun 2024 15:28:30 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH alsa-lib 1/4] ump: Add missing *_set variants for snd_ump_endpoint_info and snd_ump_block_info Date: Wed, 19 Jun 2024 17:28:50 +0200 Message-ID: <20240619152855.6809-2-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619152855.6809-1-tiwai@suse.de> References: <20240619152855.6809-1-tiwai@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_TLS_ALL(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; TO_DN_NONE(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo, imap1.dmz-prg2.suse.org:rdns] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 0BBDC21A2C Message-ID-Hash: 3D7BQIIKZ4N74SG4FIXPCDBN32FIJQ6I X-Message-ID-Hash: 3D7BQIIKZ4N74SG4FIXPCDBN32FIJQ6I 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.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: The API functions to fill the data on snd_ump_endpoint_info and snd_ump_block_info were missing. Let's add them. They can be used to construct a virtual UMP endpoint and block. Signed-off-by: Takashi Iwai --- include/ump.h | 30 ++++- src/rawmidi/ump.c | 304 ++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 322 insertions(+), 12 deletions(-) diff --git a/include/ump.h b/include/ump.h index 1e5e053454b3..45b3ad270db7 100644 --- a/include/ump.h +++ b/include/ump.h @@ -77,6 +77,7 @@ size_t snd_ump_endpoint_info_sizeof(void); #define snd_ump_endpoint_info_alloca(ptr) __snd_alloca(ptr, snd_ump_endpoint_info) int snd_ump_endpoint_info_malloc(snd_ump_endpoint_info_t **info); void snd_ump_endpoint_info_free(snd_ump_endpoint_info_t *info); +void snd_ump_endpoint_info_clear(snd_ump_endpoint_info_t *info); void snd_ump_endpoint_info_copy(snd_ump_endpoint_info_t *dst, const snd_ump_endpoint_info_t *src); int snd_ump_endpoint_info_get_card(const snd_ump_endpoint_info_t *info); int snd_ump_endpoint_info_get_device(const snd_ump_endpoint_info_t *info); @@ -93,6 +94,20 @@ const char *snd_ump_endpoint_info_get_name(const snd_ump_endpoint_info_t *info); const char *snd_ump_endpoint_info_get_product_id(const snd_ump_endpoint_info_t *info); int snd_ump_endpoint_info(snd_ump_t *ump, snd_ump_endpoint_info_t *info); +void snd_ump_endpoint_info_set_card(snd_ump_endpoint_info_t *info, unsigned int card); +void snd_ump_endpoint_info_set_device(snd_ump_endpoint_info_t *info, unsigned int device); +void snd_ump_endpoint_info_set_flags(snd_ump_endpoint_info_t *info, unsigned int flags); +void snd_ump_endpoint_info_set_protocol_caps(snd_ump_endpoint_info_t *info, unsigned int caps); +void snd_ump_endpoint_info_set_protocol(snd_ump_endpoint_info_t *info, unsigned int protocols); +void snd_ump_endpoint_info_set_num_blocks(snd_ump_endpoint_info_t *info, unsigned int num_blocks); +void snd_ump_endpoint_info_set_version(snd_ump_endpoint_info_t *info, unsigned int version); +void snd_ump_endpoint_info_set_manufacturer_id(snd_ump_endpoint_info_t *info, unsigned int id); +void snd_ump_endpoint_info_set_family_id(snd_ump_endpoint_info_t *info, unsigned int id); +void snd_ump_endpoint_info_set_model_id(snd_ump_endpoint_info_t *info, unsigned int id); +void snd_ump_endpoint_info_set_sw_revision(snd_ump_endpoint_info_t *info, const unsigned char *id); +void snd_ump_endpoint_info_set_name(snd_ump_endpoint_info_t *info, const char *name); +void snd_ump_endpoint_info_set_product_id(snd_ump_endpoint_info_t *info, const char *id); + /** Bit flag for MIDI 1.0 port w/o restrict in UMP Block info flags */ #define SND_UMP_BLOCK_IS_MIDI1 (1U << 0) /** Bit flag for 31.25Kbps B/W MIDI1 port in UMP Block info flags */ @@ -118,11 +133,11 @@ size_t snd_ump_block_info_sizeof(void); #define snd_ump_block_info_alloca(ptr) __snd_alloca(ptr, snd_ump_block_info) int snd_ump_block_info_malloc(snd_ump_block_info_t **info); void snd_ump_block_info_free(snd_ump_block_info_t *info); +void snd_ump_block_info_clear(snd_ump_block_info_t *info); void snd_ump_block_info_copy(snd_ump_block_info_t *dst, const snd_ump_block_info_t *src); int snd_ump_block_info_get_card(const snd_ump_block_info_t *info); int snd_ump_block_info_get_device(const snd_ump_block_info_t *info); unsigned int snd_ump_block_info_get_block_id(const snd_ump_block_info_t *info); -void snd_ump_block_info_set_block_id(snd_ump_block_info_t *info, unsigned int id); unsigned int snd_ump_block_info_get_active(const snd_ump_block_info_t *info); unsigned int snd_ump_block_info_get_flags(const snd_ump_block_info_t *info); unsigned int snd_ump_block_info_get_direction(const snd_ump_block_info_t *info); @@ -134,6 +149,19 @@ unsigned int snd_ump_block_info_get_ui_hint(const snd_ump_block_info_t *info); const char *snd_ump_block_info_get_name(const snd_ump_block_info_t *info); int snd_ump_block_info(snd_ump_t *ump, snd_ump_block_info_t *info); +void snd_ump_block_info_set_card(snd_ump_block_info_t *info, unsigned int card); +void snd_ump_block_info_set_device(snd_ump_block_info_t *info, unsigned int device); +void snd_ump_block_info_set_block_id(snd_ump_block_info_t *info, unsigned int id); +void snd_ump_block_info_set_active(snd_ump_block_info_t *info, unsigned int active); +void snd_ump_block_info_set_flags(snd_ump_block_info_t *info, unsigned int flags); +void snd_ump_block_info_set_direction(snd_ump_block_info_t *info, unsigned int direction); +void snd_ump_block_info_set_first_group(snd_ump_block_info_t *info, unsigned int first_group); +void snd_ump_block_info_set_num_groups(snd_ump_block_info_t *info, unsigned int num_groups); +void snd_ump_block_info_set_midi_ci_version(snd_ump_block_info_t *info, unsigned int version); +void snd_ump_block_info_set_sysex8_streams(snd_ump_block_info_t *info, unsigned int streams); +void snd_ump_block_info_set_ui_hint(snd_ump_block_info_t *info, unsigned int hint); +void snd_ump_block_info_set_name(snd_ump_block_info_t *info, const char *name); + #ifdef __cplusplus } #endif diff --git a/src/rawmidi/ump.c b/src/rawmidi/ump.c index 39c1c4a91928..6c1097a7452b 100644 --- a/src/rawmidi/ump.c +++ b/src/rawmidi/ump.c @@ -337,6 +337,17 @@ void snd_ump_endpoint_info_free(snd_ump_endpoint_info_t *info) free(info); } +/** + * \brief clears the snd_ump_endpoint_info_t structure + * \param info pointer to the snd_ump_endpoint_info_t structure to clear + * + * Zero-clear the snd_ump_endpoint_info_t object. + */ +void snd_ump_endpoint_info_clear(snd_ump_endpoint_info_t *info) +{ + memset(info, 0, sizeof(*info)); +} + /** * \brief copy one snd_ump_endpoint_info_t structure to another * \param dst destination snd_ump_endpoint_info_t structure @@ -478,6 +489,149 @@ const char *snd_ump_endpoint_info_get_product_id(const snd_ump_endpoint_info_t * return (const char *)info->product_id; } +/** + * \brief set card number of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param card the card number of the given UMP endpoint + */ +void snd_ump_endpoint_info_set_card(snd_ump_endpoint_info_t *info, + unsigned int card) +{ + info->card = card; +} + +/** + * \brief set device number of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param device the device number of the given UMP endpoint + */ +void snd_ump_endpoint_info_set_device(snd_ump_endpoint_info_t *info, + unsigned int device) +{ + info->device = device; +} + +/** + * \brief set info flags of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param flags UMP endpoint flag bits + */ +void snd_ump_endpoint_info_set_flags(snd_ump_endpoint_info_t *info, + unsigned int flags) +{ + info->flags = flags; +} + +/** + * \brief set protocol capability bits of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param caps UMP endpoint protocol capability bits + */ +void snd_ump_endpoint_info_set_protocol_caps(snd_ump_endpoint_info_t *info, + unsigned int caps) +{ + info->protocol_caps = caps; +} + +/** + * \brief set the current protocol of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param caps the UMP endpoint protocol bits + */ +void snd_ump_endpoint_info_set_protocol(snd_ump_endpoint_info_t *info, + unsigned int protocol) +{ + info->protocol = protocol; +} + +/** + * \brief set the number of UMP blocks of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param blocks the number of UMP blocks + */ +void snd_ump_endpoint_info_set_num_blocks(snd_ump_endpoint_info_t *info, + unsigned int blocks) +{ + info->num_blocks = blocks; +} + +/** + * \brief set the UMP version number of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param version the UMP version number + */ +void snd_ump_endpoint_info_set_version(snd_ump_endpoint_info_t *info, + unsigned int version) +{ + info->version = version; +} + +/** + * \brief set the UMP manufacturer ID of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param id UMP manufacturer ID + */ +void snd_ump_endpoint_info_set_manufacturer_id(snd_ump_endpoint_info_t *info, + unsigned int id) +{ + info->manufacturer_id = id; +} + +/** + * \brief set the UMP family ID of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param id UMP family ID + */ +void snd_ump_endpoint_info_set_family_id(snd_ump_endpoint_info_t *info, + unsigned int id) +{ + info->family_id = id; +} + +/** + * \brief set the UMP model ID of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param id UMP model ID + */ +void snd_ump_endpoint_info_set_model_id(snd_ump_endpoint_info_t *info, + unsigned int id) +{ + info->model_id = id; +} + +/** + * \brief set the UMP software revision of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param id UMP software revision in 4 bytes array + */ +void snd_ump_endpoint_info_set_sw_revision(snd_ump_endpoint_info_t *info, + const unsigned char *id) +{ + memcpy(info->sw_revision, id, sizeof(info->sw_revision)); +} + +/** + * \brief set the name of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param name UMP endpoint name string + */ +void snd_ump_endpoint_info_set_name(snd_ump_endpoint_info_t *info, + const char *name) +{ + snd_strlcpy((char *)info->name, name, sizeof(info->name)); +} + +/** + * \brief set the product ID string of UMP endpoint + * \param info pointer to a snd_ump_endpoint_info_t structure + * \param id UMP endpoint product ID string + */ +void snd_ump_endpoint_info_set_product_id(snd_ump_endpoint_info_t *info, + const char *id) +{ + snd_strlcpy((char *)info->product_id, id, sizeof(info->product_id)); +} + /** * \brief get endpoint information about UMP handle * \param ump UMP handle @@ -526,6 +680,17 @@ void snd_ump_block_info_free(snd_ump_block_info_t *info) free(info); } +/** + * \brief clears the snd_ump_block_info_t structure + * \param info pointer to the snd_ump_block_info_t structure to clear + * + * Zero-clear the snd_ump_block_info_t object. + */ +void snd_ump_block_info_clear(snd_ump_block_info_t *info) +{ + memset(info, 0, sizeof(*info)); +} + /** * \brief copy one snd_ump_block_info_t structure to another * \param dst destination snd_ump_block_info_t structure @@ -567,17 +732,6 @@ unsigned int snd_ump_block_info_get_block_id(const snd_ump_block_info_t *info) return info->block_id; } -/** - * \brief set UMP block ID for query - * \param info pointer to a snd_ump_block_info_t structure - * \param id the ID number for query - */ -void snd_ump_block_info_set_block_id(snd_ump_block_info_t *info, - unsigned int id) -{ - info->block_id = id; -} - /** * \brief get UMP block activeness * \param info pointer to a snd_ump_block_info_t structure @@ -668,6 +822,134 @@ const char *snd_ump_block_info_get_name(const snd_ump_block_info_t *info) return (const char *)info->name; } +/** + * \brief set card number to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param card the card number + */ +void snd_ump_block_info_set_card(snd_ump_block_info_t *info, unsigned int card) +{ + info->card = card; +} + +/** + * \brief set device number to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param device the device number + */ +void snd_ump_block_info_set_device(snd_ump_block_info_t *info, unsigned int device) +{ + info->device = device; +} + +/** + * \brief set UMP block ID to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param id the ID number + * + * This function is mostly used for setting the block ID to query. + */ +void snd_ump_block_info_set_block_id(snd_ump_block_info_t *info, + unsigned int id) +{ + info->block_id = id; +} + +/** + * \brief set activeness to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param active 1 if the block is active or 0 if inactive + */ +void snd_ump_block_info_set_active(snd_ump_block_info_t *info, unsigned int active) +{ + info->active = !!active; +} + +/** + * \brief set UMP block information flags to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param flags flag bits for the given UMP block + */ +void snd_ump_block_info_set_flags(snd_ump_block_info_t *info, unsigned int flags) +{ + info->flags = flags; +} + +/** + * \brief set UMP block direction to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param direction direction of UMP block (input,output,bidirectional) + */ +void snd_ump_block_info_set_direction(snd_ump_block_info_t *info, unsigned int direction) +{ + info->direction = direction; +} + +/** + * \brief set first UMP group to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param first_group the first UMP group ID belonging to the block + */ +void snd_ump_block_info_set_first_group(snd_ump_block_info_t *info, + unsigned int first_group) +{ + info->first_group = first_group; +} + +/** + * \brief set number of UMP groups to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param num_groups the number of UMP groups belonging to the block + */ +void snd_ump_block_info_set_num_groups(snd_ump_block_info_t *info, + unsigned int num_groups) +{ + info->num_groups = num_groups; +} + +/** + * \brief set MIDI-CI version number to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param version MIDI-CI version number + */ +void snd_ump_block_info_set_midi_ci_version(snd_ump_block_info_t *info, + unsigned int version) +{ + info->midi_ci_version = version; +} + +/** + * \brief set number of supported SysEx8 streams to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param streams number of supported SysEx8 streams + */ +void snd_ump_block_info_set_sysex8_streams(snd_ump_block_info_t *info, + unsigned int streams) +{ + info->sysex8_streams = streams; +} + +/** + * \brief set UI Hint to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param hint the hint bits + */ +void snd_ump_block_info_set_ui_hint(snd_ump_block_info_t *info, unsigned int hint) +{ + info->ui_hint = hint; +} + +/** + * \brief set the name string to snd_ump_block_info_t structure + * \param info pointer to a snd_ump_block_info_t structure + * \param name the name string of UMP block + */ +void snd_ump_block_info_set_name(snd_ump_block_info_t *info, + const char *name) +{ + snd_strlcpy((char *)info->name, name, sizeof(info->name)); +} + /** * \brief get UMP block information * \param ump UMP handle From patchwork Wed Jun 19 15:28:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 805655 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 26EAEC27C53 for ; Wed, 19 Jun 2024 15:31:04 +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 7057D83E; Wed, 19 Jun 2024 17:30:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7057D83E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718811062; bh=+Tz9A/ZCsR9L9zmEoJNGjGAaVvT1UNYXgMY56tm2Y2I=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=hlG8+Uz62Ci5RvQddxpS0xqbjPW68Lc5jkI8PTBvkE4ozXZTkEz/qVxZWDWDQqZTa fAFPZQPV/uQcq0vAYBGaZdNhB8MitLT+rDXeSua9wQ8f76SAcM3OklgtSErnltaQy+ kn7hZozTeIJkfVx8dsWEtlNo2PKGtKG4++9L5usU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B8C70F805BA; Wed, 19 Jun 2024 17:30:27 +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 B510FF805AA; Wed, 19 Jun 2024 17:30:26 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6FE0CF80588; Wed, 19 Jun 2024 17:30:22 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) (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 F3E4FF80266 for ; Wed, 19 Jun 2024 17:28:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz F3E4FF80266 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=a1/LD71e; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=MwhgTArz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=a1/LD71e; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=MwhgTArz Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 2B88C1F7EE; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9I/c1ZI31pmZ4KPMqsSha0SUJWt5dXbyY3vnhz6+08=; b=a1/LD71ej7iHS+8kFNiQx6J+8Ky17a98h5DgQ5U2nJOzhN6syItavfJqQjqdBPQuMNeaM5 9KZPn7HWhFdZhCb5yTAvy/5zbTESncmP2/XyBm7Yq8nxhxaHDD2yvnHBN3N3KRr9Z71A1Q yU74iKoRO1sPoeEcPb4Cayvp8TPTRSM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9I/c1ZI31pmZ4KPMqsSha0SUJWt5dXbyY3vnhz6+08=; b=MwhgTArzr6bD1SoIZI7oVvyTdu3EHYoFAnQwcYLK4BlQYwvrZz1dWywK5hIRQ3kxP4SUAg 2/oSMF5lIAX2vPDQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="a1/LD71e"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=MwhgTArz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9I/c1ZI31pmZ4KPMqsSha0SUJWt5dXbyY3vnhz6+08=; b=a1/LD71ej7iHS+8kFNiQx6J+8Ky17a98h5DgQ5U2nJOzhN6syItavfJqQjqdBPQuMNeaM5 9KZPn7HWhFdZhCb5yTAvy/5zbTESncmP2/XyBm7Yq8nxhxaHDD2yvnHBN3N3KRr9Z71A1Q yU74iKoRO1sPoeEcPb4Cayvp8TPTRSM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+9I/c1ZI31pmZ4KPMqsSha0SUJWt5dXbyY3vnhz6+08=; b=MwhgTArzr6bD1SoIZI7oVvyTdu3EHYoFAnQwcYLK4BlQYwvrZz1dWywK5hIRQ3kxP4SUAg 2/oSMF5lIAX2vPDQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 121F413668; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id yBxFAx/5cmYRJAAAD6G6ig (envelope-from ); Wed, 19 Jun 2024 15:28:31 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH alsa-lib 2/4] seq: Add API helper functions for creating UMP Endpoint and Blocks Date: Wed, 19 Jun 2024 17:28:51 +0200 Message-ID: <20240619152855.6809-3-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619152855.6809-1-tiwai@suse.de> References: <20240619152855.6809-1-tiwai@suse.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 2B88C1F7EE X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; TO_DN_NONE(0.00)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd1.dmz-prg2.suse.org Message-ID-Hash: C7ULBAOOGDDY4KPY3D4K77VMHMS3D34O X-Message-ID-Hash: C7ULBAOOGDDY4KPY3D4K77VMHMS3D34O 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.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: For making it easer for applications to create a virtual UMP Endpoint and UMP blocks, add two API helper functions. snd_seq_create_ump_endpoint() creates (unsurprisingly) a UMP Endpoint, based on the given snd_ump_endpoint_info_t information. The number of (max) UMP groups belonging to this Endpoint has to be specified. This function sets up the Endpoint info on the sequencer client, and creates a MIDI 2.0 UMP port as well as UMP Group ports automatically. The name of the sequencer client is updated from the Endpoint name, too. After creating a UMP Endpoint, create each UMP Block via snd_seq_create_ump_block() function with a snd_ump_block_info_t info. The associated groups for each block have to be specified there. The port names and capability bits are updated accordingly after setting each block information. Signed-off-by: Takashi Iwai Signed-off-by: Takashi Iwai --- include/seqmid.h | 7 ++ include/ump.h | 6 ++ src/seq/seq.c | 6 +- src/seq/seq_local.h | 4 + src/seq/seqmid.c | 249 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 271 insertions(+), 1 deletion(-) diff --git a/include/seqmid.h b/include/seqmid.h index 4464c2d3af0b..bf968a5b2c7b 100644 --- a/include/seqmid.h +++ b/include/seqmid.h @@ -520,6 +520,13 @@ int snd_seq_reset_pool_input(snd_seq_t *seq); ((ev)->type = SND_SEQ_EVENT_SYSEX,\ snd_seq_ev_set_variable(ev, datalen, dataptr)) +/* Helper API functions for UMP endpoint and block creations */ +int snd_seq_create_ump_endpoint(snd_seq_t *seq, + const snd_ump_endpoint_info_t *info, + unsigned int num_groups); +int snd_seq_create_ump_block(snd_seq_t *seq, int blkid, + const snd_ump_block_info_t *info); + /** \} */ #ifdef __cplusplus diff --git a/include/ump.h b/include/ump.h index 45b3ad270db7..01363a329fa7 100644 --- a/include/ump.h +++ b/include/ump.h @@ -69,6 +69,9 @@ enum _snd_ump_direction { /** Bit flag for JRTS in Receive */ #define SND_UMP_EP_INFO_PROTO_JRTS_RX 0x0002 +/** Default version passed to UMP Endpoint info */ +#define SND_UMP_EP_INFO_DEFAULT_VERSION 0x0101 + size_t snd_ump_endpoint_info_sizeof(void); /** \hideinitializer * \brief allocate an invalid #snd_ump_endpoint_info_t using standard alloca @@ -125,6 +128,9 @@ enum _snd_ump_block_ui_hint { SND_UMP_BLOCK_UI_HINT_BOTH = 0x03, }; +/** Default MIDI CI version passed to UMP Block info */ +#define SND_UMP_BLOCK_INFO_DEFAULT_MIDI_CI_VERSION 0x01 + size_t snd_ump_block_info_sizeof(void); /** \hideinitializer * \brief allocate an invalid #snd_ump_block_info_t using standard alloca diff --git a/src/seq/seq.c b/src/seq/seq.c index 5eac4848b9c7..ff0468140177 100644 --- a/src/seq/seq.c +++ b/src/seq/seq.c @@ -1042,7 +1042,8 @@ int _snd_seq_open_lconf(snd_seq_t **seqp, const char *name, */ int snd_seq_close(snd_seq_t *seq) { - int err; + int i, err; + assert(seq); err = seq->ops->close(seq); if (seq->dl_handle) @@ -1051,6 +1052,9 @@ int snd_seq_close(snd_seq_t *seq) free(seq->ibuf); free(seq->tmpbuf); free(seq->name); + free(seq->ump_ep); + for (i = 0; i < 16; i++) + free(seq->ump_blks[i]); free(seq); return err; } diff --git a/src/seq/seq_local.h b/src/seq/seq_local.h index 468248062638..263029702739 100644 --- a/src/seq/seq_local.h +++ b/src/seq/seq_local.h @@ -94,6 +94,10 @@ struct _snd_seq { size_t tmpbufsize; /* size of errbuf */ size_t packet_size; /* input packet alignment size */ int midi_version; /* current protocol version */ + + unsigned int num_ump_groups; /* number of UMP groups */ + snd_ump_endpoint_info_t *ump_ep; /* optional UMP info */ + snd_ump_block_info_t *ump_blks[16]; /* optional UMP block info */ }; int snd_seq_hw_open(snd_seq_t **handle, const char *name, int streams, int mode); diff --git a/src/seq/seqmid.c b/src/seq/seqmid.c index 9ec93ee8ade1..d7eac6cafa0e 100644 --- a/src/seq/seqmid.c +++ b/src/seq/seqmid.c @@ -493,3 +493,252 @@ int snd_seq_parse_address(snd_seq_t *seq, snd_seq_addr_t *addr, const char *arg) return 0; } +/** + * \brief create a UMP Endpoint for the given sequencer client + * \param seq sequencer handle + * \param info UMP Endpoint information to initialize + * \param num_groups max number of groups in the endpoint + * \return 0 on success or negative error code + * + * This function initializes the sequencer client to the corresponding + * MIDI 2.0 mode (either MIDI 1.0 or MIDI 2.0 protocol) depending on the + * given snd_ump_endpoint_info_t info. + * + * This function should be called right after opening a sequencer client. + * The client name is updated from the UMP Endpoint name, and a primary + * MIDI 2.0 UMP port and each UMP Group port are created. + * The application should pass each UMP block info via succeeding + * snd_seq_create_ump_block() call. + */ +int snd_seq_create_ump_endpoint(snd_seq_t *seq, + const snd_ump_endpoint_info_t *info, + unsigned int num_groups) +{ + int err, version; + unsigned int i; + snd_seq_port_info_t *pinfo; + + if (seq->ump_ep) + return -EBUSY; + + if (num_groups < 1 || num_groups > SND_UMP_MAX_GROUPS) + return -EINVAL; + + if (!(info->protocol_caps & info->protocol)) { + SNDERR("Inconsistent UMP protocol_caps and protocol\n"); + return -EINVAL; + } + + if (info->protocol & SND_UMP_EP_INFO_PROTO_MIDI2) { + version = SND_SEQ_CLIENT_UMP_MIDI_2_0; + } else if (info->protocol & SND_UMP_EP_INFO_PROTO_MIDI1) { + version = SND_SEQ_CLIENT_UMP_MIDI_1_0; + } else { + SNDERR("Invalid UMP protocol set 0x%x\n", info->protocol); + return -EINVAL; + } + + err = snd_seq_set_client_midi_version(seq, version); + if (err < 0) { + SNDERR("Failed to set to MIDI protocol 0x%x\n", version); + return err; + } + + seq->ump_ep = malloc(sizeof(*info)); + if (!seq->ump_ep) + return -ENOMEM; + + *seq->ump_ep = *info; + if (!seq->ump_ep->version) + seq->ump_ep->version = SND_UMP_EP_INFO_DEFAULT_VERSION; + + if (info->name) { + err = snd_seq_set_client_name(seq, (const char *)info->name); + if (err < 0) + goto error_free; + } + + err = snd_seq_set_ump_endpoint_info(seq, seq->ump_ep); + if (err < 0) { + SNDERR("Failed to set UMP EP info\n"); + goto error_free; + } + + snd_seq_port_info_alloca(&pinfo); + + snd_seq_port_info_set_port(pinfo, 0); + snd_seq_port_info_set_port_specified(pinfo, 1); + snd_seq_port_info_set_name(pinfo, "MIDI 2.0"); + snd_seq_port_info_set_capability(pinfo, + SNDRV_SEQ_PORT_CAP_READ | + SNDRV_SEQ_PORT_CAP_SYNC_READ | + SNDRV_SEQ_PORT_CAP_SUBS_READ | + SNDRV_SEQ_PORT_CAP_WRITE | + SNDRV_SEQ_PORT_CAP_SYNC_WRITE | + SNDRV_SEQ_PORT_CAP_SUBS_WRITE | + SNDRV_SEQ_PORT_CAP_DUPLEX); + snd_seq_port_info_set_type(pinfo, + SND_SEQ_PORT_TYPE_MIDI_GENERIC | + SNDRV_SEQ_PORT_TYPE_MIDI_UMP | + SND_SEQ_PORT_TYPE_APPLICATION | + SNDRV_SEQ_PORT_TYPE_PORT); + snd_seq_port_info_set_ump_group(pinfo, + SND_SEQ_PORT_TYPE_MIDI_GENERIC | + SNDRV_SEQ_PORT_TYPE_MIDI_UMP | + SND_SEQ_PORT_TYPE_APPLICATION | + SNDRV_SEQ_PORT_TYPE_PORT); + err = snd_seq_create_port(seq, pinfo); + if (err < 0) { + SNDERR("Failed to create MIDI 2.0 port\n"); + goto error_free; + } + + for (i = 0; i < num_groups; i++) { + char name[32]; + + snd_seq_port_info_set_port(pinfo, i + 1); + snd_seq_port_info_set_port_specified(pinfo, 1); + sprintf(name, "Group %d", i + 1); + snd_seq_port_info_set_capability(pinfo, 0); /* set later */ + snd_seq_port_info_set_name(pinfo, name); + snd_seq_port_info_set_ump_group(pinfo, i + 1); + err = snd_seq_create_port(seq, pinfo); + if (err < 0) { + SNDERR("Failed to create Group port %d\n", i + 1); + goto error; + } + } + + seq->num_ump_groups = num_groups; + return 0; + + error: + /* delete all ports including port 0 */ + for (i = 0; i <= num_groups; i++) + snd_seq_delete_port(seq, i); + error_free: + free(seq->ump_ep); + seq->ump_ep = NULL; + return err; +} + +/* update each port name and capability from the block list */ +static void update_group_ports(snd_seq_t *seq, snd_ump_endpoint_info_t *ep) +{ + unsigned int i, b; + snd_seq_port_info_t *pinfo; + snd_ump_block_info_t *bp; + + snd_seq_port_info_alloca(&pinfo); + + for (i = 0; i < seq->num_ump_groups; i++) { + char blknames[64]; + char name[64]; + unsigned int caps = 0; + + blknames[0] = 0; + for (b = 0; b < ep->num_blocks; b++) { + bp = seq->ump_blks[b]; + if (!bp) + continue; + if (i < bp->first_group || + i >= bp->first_group + bp->num_groups) + continue; + switch (bp->direction) { + case SNDRV_UMP_DIR_INPUT: + caps |= SNDRV_SEQ_PORT_CAP_READ | + SNDRV_SEQ_PORT_CAP_SYNC_READ | + SNDRV_SEQ_PORT_CAP_SUBS_READ; + break; + case SNDRV_UMP_DIR_OUTPUT: + caps |= SNDRV_SEQ_PORT_CAP_WRITE | + SNDRV_SEQ_PORT_CAP_SYNC_WRITE | + SNDRV_SEQ_PORT_CAP_SUBS_WRITE; + break; + case SNDRV_UMP_DIR_BIDIRECTION: + caps |= SNDRV_SEQ_PORT_CAP_READ | + SNDRV_SEQ_PORT_CAP_SYNC_READ | + SNDRV_SEQ_PORT_CAP_SUBS_READ | + SNDRV_SEQ_PORT_CAP_WRITE | + SNDRV_SEQ_PORT_CAP_SYNC_WRITE | + SNDRV_SEQ_PORT_CAP_SUBS_WRITE | + SNDRV_SEQ_PORT_CAP_DUPLEX; + break; + } + + if (!*bp->name) + continue; + if (*blknames) { + strlcat(blknames, ", ", sizeof(blknames)); + strlcat(blknames, (const char *)bp->name, + sizeof(blknames)); + } else { + snd_strlcpy(blknames, (const char *)bp->name, + sizeof(blknames)); + } + } + + if (!*blknames) + continue; + + snprintf(name, sizeof(name), "Group %d (%s)", i + 1, blknames); + if (snd_seq_get_port_info(seq, i + 1, pinfo) < 0) + continue; + + if (strcmp(name, snd_seq_port_info_get_name(pinfo)) || + snd_seq_port_info_get_capability(pinfo) != caps) { + snd_seq_port_info_set_name(pinfo, name); + snd_seq_port_info_set_capability(pinfo, caps); + snd_seq_set_port_info(seq, i + 1, pinfo); + } + } +} + +/** + * \brief create a UMP block for the given sequencer client + * \param seq sequencer handle + * \param blkid 0-based block id + * \param info UMP block info to initialize + * \return 0 on success or negative error code + * + * This function sets up the UMP block info of the given block id. + * The sequencer port name is updated accordingly with the associated + * block name automatically. + */ +int snd_seq_create_ump_block(snd_seq_t *seq, int blkid, + const snd_ump_block_info_t *info) +{ + snd_ump_block_info_t *bp; + snd_ump_endpoint_info_t *ep = seq->ump_ep; + int err; + + if (!ep) + return -EINVAL; + if (info->first_group >= seq->num_ump_groups || + info->first_group + info->num_groups > seq->num_ump_groups) + return -EINVAL; + if (blkid < 0 || blkid >= (int)ep->num_blocks) + return -EINVAL; + + if (seq->ump_blks[blkid]) + return -EBUSY; + seq->ump_blks[blkid] = bp = malloc(sizeof(*info)); + if (!bp) + return -ENOMEM; + *bp = *info; + + if (!bp->midi_ci_version) + bp->midi_ci_version = SND_UMP_BLOCK_INFO_DEFAULT_MIDI_CI_VERSION; + bp->active = 1; + + err = snd_seq_set_ump_block_info(seq, blkid, bp); + if (err < 0) { + SNDERR("Failed to set UMP EP info\n"); + free(bp); + seq->ump_blks[blkid] = NULL; + return err; + } + + update_group_ports(seq, ep); + return 0; +} From patchwork Wed Jun 19 15:28:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 806744 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 29451C27C53 for ; Wed, 19 Jun 2024 15:31:26 +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 0E005A4B; Wed, 19 Jun 2024 17:31:14 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 0E005A4B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718811084; bh=Ya3Ce8+YkorcelSti2aWsGohvCJfuXjG4YPfnW3+YHk=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=PGVbQxGtqZnqeWS/cRcSFI3O1IEAv/QYRUDdbdfXZT8TFOvmxF7aTPolGhmTgp8TL zd3OjTWEFkrqoRfshFwH/1S2NJPCeJot4hlwiY2XPfYNZ+C4jKXTVM+rpK8mtmOkN7 rZCezF4oIplAghuksdxm696CKO5aSZqobA88AEd4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 49D51F805D2; Wed, 19 Jun 2024 17:30:30 +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 7F7A5F805E9; Wed, 19 Jun 2024 17:30:30 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 88BF4F80266; Wed, 19 Jun 2024 17:30:22 +0200 (CEST) Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) (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 1DD7EF80236 for ; Wed, 19 Jun 2024 17:28:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1DD7EF80236 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=xvwm04BY; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7WfT0YPK; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=xvwm04BY; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=7WfT0YPK Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (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 smtp-out2.suse.de (Postfix) with ESMTPS id 4EF451F7F0; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+GUSIlLRE1/tVNbffFNr03o7fNfrIuNuRVPfNmkMgJs=; b=xvwm04BYaWMNALVUUTWzBo23u/BRVI0bt13JWlbJnJH1yq9ynbP0il2hpjRryHpAnYE9lH 8m+dTbEDEPHEZUQN0IOd1AhUEKq/XeSypKRUJFGNren2hnLKVGDguDfj7pUG8zrd2EXRDV TE4tJBUd6eURQD7ijIf6gZPWr6NUMyM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+GUSIlLRE1/tVNbffFNr03o7fNfrIuNuRVPfNmkMgJs=; b=7WfT0YPKcYVyOwNaTt18wpsuiM8kSVBNpEbpY1uSSvv23vBWAi6wiFA9177GkqD2D5ilxP mEPF0+bhUzBCKLAg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=xvwm04BY; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=7WfT0YPK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+GUSIlLRE1/tVNbffFNr03o7fNfrIuNuRVPfNmkMgJs=; b=xvwm04BYaWMNALVUUTWzBo23u/BRVI0bt13JWlbJnJH1yq9ynbP0il2hpjRryHpAnYE9lH 8m+dTbEDEPHEZUQN0IOd1AhUEKq/XeSypKRUJFGNren2hnLKVGDguDfj7pUG8zrd2EXRDV TE4tJBUd6eURQD7ijIf6gZPWr6NUMyM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+GUSIlLRE1/tVNbffFNr03o7fNfrIuNuRVPfNmkMgJs=; b=7WfT0YPKcYVyOwNaTt18wpsuiM8kSVBNpEbpY1uSSvv23vBWAi6wiFA9177GkqD2D5ilxP mEPF0+bhUzBCKLAg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 33B8413AC3; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id OFvQCh/5cmYRJAAAD6G6ig (envelope-from ); Wed, 19 Jun 2024 15:28:31 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH alsa-lib 3/4] test: Add an example program to create a virtual UMP Endpoint Date: Wed, 19 Jun 2024 17:28:52 +0200 Message-ID: <20240619152855.6809-4-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619152855.6809-1-tiwai@suse.de> References: <20240619152855.6809-1-tiwai@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[100.00%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCPT_COUNT_ONE(0.00)[1]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; DWL_DNSWL_BLOCKED(0.00)[suse.de:dkim]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Action: no action X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Queue-Id: 4EF451F7F0 Message-ID-Hash: 6JSFJCMKAF2NNPHMUMNS5HVL7L6RJFTC X-Message-ID-Hash: 6JSFJCMKAF2NNPHMUMNS5HVL7L6RJFTC 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.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: Provide an example program to demonstrate how to create a UMP Endpoint and Blocks, i.e. a virtual UMP device. It's a simple filtering application that just haves the incoming note on/off velocity and sends out to the output. The UMP Endpoint and Block attributes can be adjusted via command-line options. Signed-off-by: Takashi Iwai --- test/Makefile.am | 3 +- test/seq-ump-example.c | 187 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 189 insertions(+), 1 deletion(-) create mode 100644 test/seq-ump-example.c diff --git a/test/Makefile.am b/test/Makefile.am index 99c2c4ff9f06..635fa39bb7e3 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS=. lsb -check_PROGRAMS=control pcm pcm_min latency seq \ +check_PROGRAMS=control pcm pcm_min latency seq seq-ump-example \ playmidi1 timer rawmidi midiloop \ oldapi queue_timer namehint client_event_filter \ chmap audio_time user-ctl-element-set pcm-multi-thread @@ -12,6 +12,7 @@ pcm_min_LDADD=../src/libasound.la latency_LDADD=../src/libasound.la latency_LDFLAGS= -lm seq_LDADD=../src/libasound.la +seq_ump_example_LDADD=../src/libasound.la playmidi1_LDADD=../src/libasound.la timer_LDADD=../src/libasound.la rawmidi_LDADD=../src/libasound.la diff --git a/test/seq-ump-example.c b/test/seq-ump-example.c new file mode 100644 index 000000000000..7f6286827f36 --- /dev/null +++ b/test/seq-ump-example.c @@ -0,0 +1,187 @@ +// An example program to create a virtual UMP Endpoint +// +// A client simply reads each UMP packet and sends to subscribers +// while the note on/off velocity is halved + +#include +#include +#include +#include + +/* make the note on/off velocity half for MIDI1 CVM */ +static void midi1_half_note_velocity(snd_seq_ump_event_t *ev) +{ + snd_ump_msg_midi1_t *midi1 = (snd_ump_msg_midi1_t *)ev->ump; + + switch (snd_ump_msg_status(ev->ump)) { + case SND_UMP_MSG_NOTE_OFF: + case SND_UMP_MSG_NOTE_ON: + midi1->note_on.velocity >>= 1; + break; + } +} + +/* make the note on/off velocity half for MIDI2 CVM */ +static void midi2_half_note_velocity(snd_seq_ump_event_t *ev) +{ + snd_ump_msg_midi2_t *midi2 = (snd_ump_msg_midi2_t *)ev->ump; + + switch (snd_ump_msg_status(ev->ump)) { + case SND_UMP_MSG_NOTE_OFF: + case SND_UMP_MSG_NOTE_ON: + midi2->note_on.velocity >>= 1; + break; + } +} + +static void help(void) +{ + printf("seq-ump-example: Create a virtual UMP Endpoint and Blocks\n" + "\n" + "Usage: seq-ump-example [OPTIONS]\n" + "\n" + "-n,--num-blocks blocks Number of blocks (groups) to create\n" + "-m,--midi-version version MIDI protocol version (1 or 2)\n" + "-N--name UMP Endpoint name string\n" + "-P,--product name UMP Product ID string\n" + "-M,--manufacturer id UMP Manufacturer ID value (24bit)\n" + "-F,--family id UMP Family ID value (16bit)\n" + "-O,--model id UMP Model ID value (16bit)\n" + "-R,--sw-revision id UMP Software Revision ID (32bit)\n"); +} + +int main(int argc, char **argv) +{ + int midi_version = 2; + int num_blocks = 1; + const char *name = "ACMESynth"; + const char *product = "Halfmoon"; + unsigned int manufacturer = 0x123456; + unsigned int family = 0x1234; + unsigned int model = 0xabcd; + unsigned int sw_revision = 0x12345678; + snd_seq_t *seq; + snd_ump_endpoint_info_t *ep; + snd_ump_block_info_t *blk; + snd_seq_ump_event_t *ev; + int i, c, err; + unsigned char tmp[4]; + + static const struct option long_option[] = { + {"num-blocks", required_argument, 0, 'n'}, + {"midi-version", required_argument, 0, 'm'}, + {"name", required_argument, 0, 'N'}, + {"product", required_argument, 0, 'P'}, + {"manufacturer", required_argument, 0, 'M'}, + {"family", required_argument, 0, 'F'}, + {"model", required_argument, 0, 'O'}, + {"sw-revision", required_argument, 0, 'R'}, + {0, 0, 0, 0} + }; + + while ((c = getopt_long(argc, argv, "n:m:N:P:M:F:O:R:", + long_option, NULL)) >= 0) { + switch (c) { + case 'n': + num_blocks = atoi(optarg); + break; + case 'm': + midi_version = atoi(optarg); + break; + case 'N': + name = optarg; + break; + case 'P': + product = optarg; + break; + case 'M': + manufacturer = strtol(optarg, NULL, 0); + break; + case 'F': + family = strtol(optarg, NULL, 0); + break; + case 'O': + model = strtol(optarg, NULL, 0); + break; + case 'R': + sw_revision = strtol(optarg, NULL, 0); + break; + default: + help(); + return 1; + } + } + + err = snd_seq_open(&seq, "default", SND_SEQ_OPEN_DUPLEX, 0); + if (err < 0) { + fprintf(stderr, "failed to open sequencer: %d\n", err); + return 1; + } + + snd_ump_endpoint_info_alloca(&ep); + snd_ump_endpoint_info_set_name(ep, name); + snd_ump_endpoint_info_set_product_id(ep, product); + if (midi_version == 1) { + snd_ump_endpoint_info_set_protocol_caps(ep, SND_UMP_EP_INFO_PROTO_MIDI1); + snd_ump_endpoint_info_set_protocol(ep, SND_UMP_EP_INFO_PROTO_MIDI1); + } else { + snd_ump_endpoint_info_set_protocol_caps(ep, SND_UMP_EP_INFO_PROTO_MIDI2); + snd_ump_endpoint_info_set_protocol(ep, SND_UMP_EP_INFO_PROTO_MIDI2); + } + snd_ump_endpoint_info_set_num_blocks(ep, num_blocks); + snd_ump_endpoint_info_set_manufacturer_id(ep, manufacturer); + snd_ump_endpoint_info_set_family_id(ep, family); + snd_ump_endpoint_info_set_model_id(ep, model); + for (i = 0; i < 4; i++) + tmp[i] = (sw_revision >> ((3 - i) * 8)) & 0xff; + snd_ump_endpoint_info_set_sw_revision(ep, tmp); + + err = snd_seq_create_ump_endpoint(seq, ep, num_blocks); + if (err < 0) { + fprintf(stderr, "failed to set UMP EP info: %d\n", err); + return 1; + } + + snd_ump_block_info_alloca(&blk); + + for (i = 0; i < num_blocks; i++) { + char blkname[32]; + + sprintf(blkname, "Filter %d", i + 1); + snd_ump_block_info_set_name(blk, blkname); + snd_ump_block_info_set_direction(blk, SND_UMP_DIR_BIDIRECTION); + snd_ump_block_info_set_first_group(blk, i); + snd_ump_block_info_set_num_groups(blk, 1); + snd_ump_block_info_set_ui_hint(blk, SND_UMP_BLOCK_UI_HINT_BOTH); + + err = snd_seq_create_ump_block(seq, i, blk); + if (err < 0) { + fprintf(stderr, "failed to set UMP block info %d: %d\n", + i, err); + return 1; + } + } + + /* halve the incoming note-on / off velocity and pass through + * to subscribers + */ + while (snd_seq_ump_event_input(seq, &ev) >= 0) { + if (!snd_seq_ev_is_ump(ev)) + continue; + switch (snd_ump_msg_type(ev->ump)) { + case SND_UMP_MSG_TYPE_MIDI1_CHANNEL_VOICE: + midi1_half_note_velocity(ev); + break; + case SND_UMP_MSG_TYPE_MIDI2_CHANNEL_VOICE: + midi2_half_note_velocity(ev); + break; + } + + snd_seq_ev_set_subs(ev); + snd_seq_ev_set_direct(ev); + snd_seq_ump_event_output(seq, ev); + snd_seq_drain_output(seq); + } + + return 0; +} From patchwork Wed Jun 19 15:28:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 805656 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 345FCC27C79 for ; Wed, 19 Jun 2024 15:29:41 +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 47B94DF6; Wed, 19 Jun 2024 17:29:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 47B94DF6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1718810979; bh=/CP89v/oyIOkIYfjLv/ePA04URYRSfQkYQR6vHnLkRQ=; h=From:To:Subject:Date:In-Reply-To:References:List-Id:List-Archive: List-Help:List-Owner:List-Post:List-Subscribe:List-Unsubscribe: From; b=UYwqw/+gInAw2G9KG1NH+LdcrV8e4sw3FyWd+ZsX6QMz9UBnfxGXnhX7ObqZRnSgx /kn8Rz38xSh6hfdXRMcBHVXJFC29s0VcBW9G5acAV5ILlUbZq2RmssYpfH+SEjDab+ LlUSvBrUl1+I+myS2xbNRik/UoLCB1dcF6Y1ai10= Received: by alsa1.perex.cz (Postfix, from userid 50401) id D307AF805E0; Wed, 19 Jun 2024 17:28:55 +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 46FFFF805D8; Wed, 19 Jun 2024 17:28:55 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D5611F804D6; Wed, 19 Jun 2024 17:28:50 +0200 (CEST) Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (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 C58F5F8010C for ; Wed, 19 Jun 2024 17:28:32 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C58F5F8010C 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=mQ71kAoL; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=cwbJFZJk; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=mQ71kAoL; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=cwbJFZJk Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.97]) (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 smtp-out1.suse.de (Postfix) with ESMTPS id 795E621A43; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/5v6wbIkt4sfaU0VL2iwZ4JkEGTp7LHrCqCzSVGvcLY=; b=mQ71kAoLBiZzo84fZJpd6CsC0NcbnKyf9EANq6IzmaNu2WituKEFvdk9dsssf3S5QaM9zl zPHFS8IFuHwvkL4KZARiA6cZuMPdKF7VKjxC2/Xh2PcLjnlZ1XAAA1GPjeZXH4hjLQFg3B sbO2SbFlxc9tsdQOY+viwYhP2Y8hbwA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/5v6wbIkt4sfaU0VL2iwZ4JkEGTp7LHrCqCzSVGvcLY=; b=cwbJFZJk2oRiybupTJu5er/PFSqEsrXjBdiAaPMTtErlw6BdNxrLhO7TppNsKw1s5N7/ZR sZb0/m4xuuYQfVCw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/5v6wbIkt4sfaU0VL2iwZ4JkEGTp7LHrCqCzSVGvcLY=; b=mQ71kAoLBiZzo84fZJpd6CsC0NcbnKyf9EANq6IzmaNu2WituKEFvdk9dsssf3S5QaM9zl zPHFS8IFuHwvkL4KZARiA6cZuMPdKF7VKjxC2/Xh2PcLjnlZ1XAAA1GPjeZXH4hjLQFg3B sbO2SbFlxc9tsdQOY+viwYhP2Y8hbwA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1718810911; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/5v6wbIkt4sfaU0VL2iwZ4JkEGTp7LHrCqCzSVGvcLY=; b=cwbJFZJk2oRiybupTJu5er/PFSqEsrXjBdiAaPMTtErlw6BdNxrLhO7TppNsKw1s5N7/ZR sZb0/m4xuuYQfVCw== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 5362113668; Wed, 19 Jun 2024 15:28:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id 6K1CEx/5cmYRJAAAD6G6ig (envelope-from ); Wed, 19 Jun 2024 15:28:31 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH alsa-lib 4/4] Add test/seq-ump-example to .gitignore Date: Wed, 19 Jun 2024 17:28:53 +0200 Message-ID: <20240619152855.6809-5-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240619152855.6809-1-tiwai@suse.de> References: <20240619152855.6809-1-tiwai@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-1.62 / 50.00]; BAYES_HAM(-1.82)[93.96%]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[] Message-ID-Hash: JTWZMD5XNPV2IECUWKZ2GH3BWALRNCEJ X-Message-ID-Hash: JTWZMD5XNPV2IECUWKZ2GH3BWALRNCEJ 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.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: Signed-off-by: Takashi Iwai --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a74b5195a7d9..947eba45c685 100644 --- a/.gitignore +++ b/.gitignore @@ -65,6 +65,7 @@ test/playmidi1 test/queue_timer test/rawmidi test/seq +test/seq-ump-example test/timer test/lsb/config test/lsb/midi_event