From patchwork Tue Jan 14 08:55:10 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 857265 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 7996FE77188 for ; Tue, 14 Jan 2025 08:56:39 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [45.14.194.44]) (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 alsa0.perex.cz (Postfix) with ESMTPS id E9454602A3; Tue, 14 Jan 2025 09:56:27 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E9454602A3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1736844998; bh=xsMW00AMSLBMmaXbwTDPbCkfRGgBFdLDUg45DJZXgvo=; 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=U3iQO14N6ZLxyieNt923DwBrmxJJA5JbNAilRcSL6IoB+M+drK0LfEu6mVw9OuquZ bbKoWYImFOufmWtaOZL9PBVG6EfQuBGSyO8kjG07Rx32Bux7XL6UHOIqL+79W9l6rD S26z0kKTfNwZ+YjsQFH5CrCtRWWhgg043NIcn6N0= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 93477F8060E; Tue, 14 Jan 2025 09:55:34 +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 67A00F80605; Tue, 14 Jan 2025 09:55:34 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6D6E8F80551; Tue, 14 Jan 2025 09:55:23 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 EE2F2F80510 for ; Tue, 14 Jan 2025 09:55:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz EE2F2F80510 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=vjEiEpia; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=h6LDdOje; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=vjEiEpia; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=h6LDdOje 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-out2.suse.de (Postfix) with ESMTPS id E31961F395; Tue, 14 Jan 2025 08:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736844919; 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=b+05/+8JcKiDiswzaPPiUTCB200jxJJ+helAxf0CcWc=; b=vjEiEpia5vFKFemn5nZGGBMcuTKIpoRNN8FzBKHSLMtB/tsaR0/EDQy9oQ4Q31E+z+dEMm R51cLJC7tNkI2L+Wox8Tonz6jwEZfvP9KqMWvaQyjiGN8vUXE4OIHTlgWyFP00w6D/34N4 VLDqE/2KZ9oFNlunM2b0cVHlXwvR8UM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736844919; 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=b+05/+8JcKiDiswzaPPiUTCB200jxJJ+helAxf0CcWc=; b=h6LDdOje5ThHIy2mbTxcdNVYWiO0FclxB9lAh5GeGkZuPUURQK3B+W7DhspcBhAd5XeyaY 5p7qZ69E76IgdjDw== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736844919; 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=b+05/+8JcKiDiswzaPPiUTCB200jxJJ+helAxf0CcWc=; b=vjEiEpia5vFKFemn5nZGGBMcuTKIpoRNN8FzBKHSLMtB/tsaR0/EDQy9oQ4Q31E+z+dEMm R51cLJC7tNkI2L+Wox8Tonz6jwEZfvP9KqMWvaQyjiGN8vUXE4OIHTlgWyFP00w6D/34N4 VLDqE/2KZ9oFNlunM2b0cVHlXwvR8UM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736844919; 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=b+05/+8JcKiDiswzaPPiUTCB200jxJJ+helAxf0CcWc=; b=h6LDdOje5ThHIy2mbTxcdNVYWiO0FclxB9lAh5GeGkZuPUURQK3B+W7DhspcBhAd5XeyaY 5p7qZ69E76IgdjDw== 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 B06E21384C; Tue, 14 Jan 2025 08:55:19 +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 OGCnKXcmhmcHbQAAD6G6ig (envelope-from ); Tue, 14 Jan 2025 08:55:19 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH alsa-lib 2/5] Sync UAPI asequencer.h with 6.14 kernel Date: Tue, 14 Jan 2025 09:55:10 +0100 Message-ID: <20250114085515.11880-3-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250114085515.11880-1-tiwai@suse.de> References: <20250114085515.11880-1-tiwai@suse.de> MIME-Version: 1.0 X-Spamd-Result: default: False [-2.80 / 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)[]; 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)[suse.de:mid,suse.de:email]; 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: 37HVQEILQHJMEOHNR263UURQTFPVCSV6 X-Message-ID-Hash: 37HVQEILQHJMEOHNR263UURQTFPVCSV6 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: There are the new event types for UMP EP and FB notifications as well as the new struct for them. Signed-off-by: Takashi Iwai --- include/sound/uapi/asequencer.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/include/sound/uapi/asequencer.h b/include/sound/uapi/asequencer.h index bd3c7a317f24..9682795bba87 100644 --- a/include/sound/uapi/asequencer.h +++ b/include/sound/uapi/asequencer.h @@ -10,7 +10,7 @@ #include /** version of the sequencer */ -#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 4) +#define SNDRV_SEQ_VERSION SNDRV_PROTOCOL_VERSION(1, 0, 5) /** * definition of sequencer event types @@ -92,6 +92,9 @@ #define SNDRV_SEQ_EVENT_PORT_SUBSCRIBED 66 /* ports connected */ #define SNDRV_SEQ_EVENT_PORT_UNSUBSCRIBED 67 /* ports disconnected */ +#define SNDRV_SEQ_EVENT_UMP_EP_CHANGE 68 /* UMP EP info has changed */ +#define SNDRV_SEQ_EVENT_UMP_BLOCK_CHANGE 69 /* UMP block info has changed */ + /* 70-89: synthesizer events - obsoleted */ /** user-defined events with fixed length @@ -253,6 +256,12 @@ struct snd_seq_ev_quote { struct snd_seq_event *event; /* quoted event */ } __attribute__((packed)); + /* UMP info change notify */ +struct snd_seq_ev_ump_notify { + unsigned char client; /* Client number */ + unsigned char block; /* Block number (optional) */ +}; + union snd_seq_event_data { /* event data... */ struct snd_seq_ev_note note; struct snd_seq_ev_ctrl control; @@ -265,6 +274,7 @@ union snd_seq_event_data { /* event data... */ struct snd_seq_connect connect; struct snd_seq_result result; struct snd_seq_ev_quote quote; + struct snd_seq_ev_ump_notify ump_notify; }; /* sequencer event */ From patchwork Tue Jan 14 08:55:11 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 857264 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 45E89C02183 for ; Tue, 14 Jan 2025 08:57:12 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [45.14.194.44]) (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 alsa0.perex.cz (Postfix) with ESMTPS id 7CE73602B4; Tue, 14 Jan 2025 09:57:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7CE73602B4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1736845030; bh=DpDO1A7glR+eet6qQhVkG46DUPB2U6xJLKY2xPZAlR8=; 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=c8kJcT+V9/BcFDkE3kpy65J4zwSzSMlwnpQQsfoqg2N1ruENZJcc6U3rIQfTwvOec 9+cvhmKprs13ECjcjFxlwrW6KWGqZLvkL4uG/xnYZiKSELZpNkclaGyuHWSdplYaHR finTOvPAmPda/Lp+N+JLtoWYoTmzZhCH2gAoXW4U= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 24DBDF80654; Tue, 14 Jan 2025 09:55:41 +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 82876F80673; Tue, 14 Jan 2025 09:55:41 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E63BCF80537; Tue, 14 Jan 2025 09:55:23 +0100 (CET) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 4C32FF80549 for ; Tue, 14 Jan 2025 09:55:20 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 4C32FF80549 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=pZTAQybv; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uhIHkt8n; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=pZTAQybv; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=uhIHkt8n 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 043EA1F441; Tue, 14 Jan 2025 08:55:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736844920; 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=PNykDQ74/9OV8joVFdH5zYMkPinW5O5JYVy+VBEo+NQ=; b=pZTAQybvBmcs6oItPm43k3FcCOfuVKtQwIuIWNmVmVBPVXOYLPqopJxBT9lhQjS+l96/kj RFFKfGvczNB3ikb9tVOU6Xv/sid68jN5YQO2iW9id9TIAW13cqyiQZFa4LMPTUJP8OOG+D v2nDxM9DGmtkFp7qR+mhHrv5tXtBIW8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736844920; 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=PNykDQ74/9OV8joVFdH5zYMkPinW5O5JYVy+VBEo+NQ=; b=uhIHkt8nQpb+EApaIOmU3nLeqdVwPSGtxsRinVjhC3r3fj8ZOVvqjOlwhiIH/eLjDGjtX4 x0K14E3MezdLNECA== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=pZTAQybv; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=uhIHkt8n DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1736844920; 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=PNykDQ74/9OV8joVFdH5zYMkPinW5O5JYVy+VBEo+NQ=; b=pZTAQybvBmcs6oItPm43k3FcCOfuVKtQwIuIWNmVmVBPVXOYLPqopJxBT9lhQjS+l96/kj RFFKfGvczNB3ikb9tVOU6Xv/sid68jN5YQO2iW9id9TIAW13cqyiQZFa4LMPTUJP8OOG+D v2nDxM9DGmtkFp7qR+mhHrv5tXtBIW8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1736844920; 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=PNykDQ74/9OV8joVFdH5zYMkPinW5O5JYVy+VBEo+NQ=; b=uhIHkt8nQpb+EApaIOmU3nLeqdVwPSGtxsRinVjhC3r3fj8ZOVvqjOlwhiIH/eLjDGjtX4 x0K14E3MezdLNECA== 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 DCBA813A98; Tue, 14 Jan 2025 08:55:19 +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 6O2VNHcmhmcHbQAAD6G6ig (envelope-from ); Tue, 14 Jan 2025 08:55:19 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Subject: [PATCH alsa-lib 3/5] rawmidi: Extensions for tied device and substream inactive flag Date: Tue, 14 Jan 2025 09:55:11 +0100 Message-ID: <20250114085515.11880-4-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250114085515.11880-1-tiwai@suse.de> References: <20250114085515.11880-1-tiwai@suse.de> MIME-Version: 1.0 X-Rspamd-Queue-Id: 043EA1F441 X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; 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)[]; ASN(0.00)[asn:25478, ipnet:::/0, country:RU]; 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)[suse.de:email,suse.de:dkim,suse.de:mid]; 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)[]; RCPT_COUNT_ONE(0.00)[1]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Rspamd-Action: no action Message-ID-Hash: HW4VGCLJSMYJ5UD7KEHWFPG2GUFY6RXA X-Message-ID-Hash: HW4VGCLJSMYJ5UD7KEHWFPG2GUFY6RXA 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: This is the enhancements of rawmidi API for the new feature added in 6.14 kernel: the indication of a tied device and the inactive flag for the selected substream. The new function is added for obtaining the tied device, snd_rawmidi_info_get_tied_device(). And the new bit flag is defined for indicating the inactive substream, SNDRV_RAWMIDI_INFO_STREAM_INACTIVE, which is exposed via snd_rawmidi_info_get_flags(). Signed-off-by: Takashi Iwai --- include/rawmidi.h | 2 ++ src/rawmidi/rawmidi.c | 22 +++++++++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/rawmidi.h b/include/rawmidi.h index 2630d1e67572..af734b21db60 100644 --- a/include/rawmidi.h +++ b/include/rawmidi.h @@ -95,6 +95,7 @@ typedef enum _snd_rawmidi_read_mode { /** rawmidi info bit flags */ #define SND_RAWMIDI_INFO_UMP 0x00000008 /* rawmidi is UMP */ +#define SNDRV_RAWMIDI_INFO_STREAM_INACTIVE 0x00000010 /* the selected substream is inactive */ int snd_rawmidi_open(snd_rawmidi_t **in_rmidi, snd_rawmidi_t **out_rmidi, const char *name, int mode); @@ -124,6 +125,7 @@ const char *snd_rawmidi_info_get_name(const snd_rawmidi_info_t *obj); const char *snd_rawmidi_info_get_subdevice_name(const snd_rawmidi_info_t *obj); unsigned int snd_rawmidi_info_get_subdevices_count(const snd_rawmidi_info_t *obj); unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *obj); +int snd_rawmidi_info_get_tied_device(const snd_rawmidi_info_t *obj); void snd_rawmidi_info_set_device(snd_rawmidi_info_t *obj, unsigned int val); void snd_rawmidi_info_set_subdevice(snd_rawmidi_info_t *obj, unsigned int val); void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *obj, snd_rawmidi_stream_t val); diff --git a/src/rawmidi/rawmidi.c b/src/rawmidi/rawmidi.c index c4b45fa227f1..017b01c24b2b 100644 --- a/src/rawmidi/rawmidi.c +++ b/src/rawmidi/rawmidi.c @@ -639,6 +639,20 @@ unsigned int snd_rawmidi_info_get_subdevices_avail(const snd_rawmidi_info_t *inf return info->subdevices_avail; } +/** + * \brief get the tied device number for the given rawmidi device + * \param info pointer to a snd_rawmidi_info_t structure + * \return the device number for the tied device, or -1 if untied / unknown. + * + * This function is useful for UMP rawmidi devices where each of them may + * have the mirroring legacy rawmidi device. Those are shown as "tied". + */ +int snd_rawmidi_info_get_tied_device(const snd_rawmidi_info_t *info) +{ + assert(info); + return info->tied_device; +} + /** * \brief set rawmidi device number * \param info pointer to a snd_rawmidi_info_t structure @@ -680,9 +694,15 @@ void snd_rawmidi_info_set_stream(snd_rawmidi_info_t *info, snd_rawmidi_stream_t */ int snd_rawmidi_info(snd_rawmidi_t *rawmidi, snd_rawmidi_info_t * info) { + int ret; assert(rawmidi); assert(info); - return rawmidi->ops->info(rawmidi, info); + ret = rawmidi->ops->info(rawmidi, info); + if (ret) + return ret; + if (rawmidi->version < SNDRV_PROTOCOL_VERSION(2, 0, 5)) + info->tied_device = -1; + return 0; } /**