From patchwork Wed Aug 7 09:22:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13756074 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64C2F1CB32E for ; Wed, 7 Aug 2024 09:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022556; cv=none; b=Go0KE/efq5YMYHVO95RHC27juTXDTyqefnunxFaMeWBLkpXOSgoBSo0AFjLB/mFfymciPBc00xIpqWf8OPG2UsWN/Bt3BqW0XG+yqtU/mbuc28fK+vbu7t7Gswj2Llj2mYNCSv77C0fVgKvQEEZdJZEcOrzPzsIY/hZpp/EOdNI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022556; c=relaxed/simple; bh=aS3/yB9v9uoY4qCAruAXiTkABcm7q5ALKRfXDXbsVaE=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OetkVUlZ4VOPCWJ4l5A8T+HzPQ0WEWDwL7asfnL/qH+ZcEZ0Cq53I6eTlTWABmG9YTL/14DVsJft3ZRxoWuNZb1D2/skHEgO5546xhzDAlFgv8tw75/DfAiwjkTyTYLRJDKrAOXvAP2dK28zyQqnh6d4f1LVk6h3nZ1raLNPWRk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=kT1QfNKi; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=GHQRi+RH; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=WEh6DeF9; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=Kx5KPZbU; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="kT1QfNKi"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="GHQRi+RH"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="WEh6DeF9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="Kx5KPZbU" 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 F24711F7E5; Wed, 7 Aug 2024 09:22:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=J0eoPUyUsp2BG3zonGffIZLQOZGMryxqP0XXISZ4wTY=; b=kT1QfNKi45ZuV3Xsf/sorRSh7USV8rkTISkzQa0MAMprvNL2Q4I6RwIcR3YkKQMhhlil32 ks9+ZffelYJ/WerKXrWufFyjtPZlY11fuTSGqOeqZlE6iUGTgmmHCYQHkjMIXB1TLSaiMT pJjiEFLGOOfM8CFhc4lulagF81zv+hU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=J0eoPUyUsp2BG3zonGffIZLQOZGMryxqP0XXISZ4wTY=; b=GHQRi+RHWYtnwNQmjHTe40uK0t8549oNGgn/1CBebb6nsfb1a+8qRtxnKS6qqRtAJmEmzh 9Elp1Nyzf7IrZzCQ== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=WEh6DeF9; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=Kx5KPZbU DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022546; 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=J0eoPUyUsp2BG3zonGffIZLQOZGMryxqP0XXISZ4wTY=; b=WEh6DeF9u0VgeyEC5EHbK9gMTNKdaZGc/e4OLNZAGRNXNIjWguvgB744+UINQEvNmic3OO 7Cz9JXPnS7GgUC5tSV6u3sFsQUt/L0ZHN/8dZsj2/BqO37Bf9mM36thxQcf03/2qqMqtpk oIpUaODZBiJpLVB60hRWRY0PDeJmrE0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022546; 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=J0eoPUyUsp2BG3zonGffIZLQOZGMryxqP0XXISZ4wTY=; b=Kx5KPZbU9etzmADhgMyz3Hjj7PWBm2Jrn5rVF7rBycCUepJ+VavfyqOcCk923+D1JREzBH ynz3fB30FC8e4wAw== 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 D5B8A13B03; Wed, 7 Aug 2024 09:22:26 +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 QAQLM9I8s2ZxCgAAD6G6ig (envelope-from ); Wed, 07 Aug 2024 09:22:26 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 1/6] ALSA: ump: Choose the protocol when protocol caps are changed Date: Wed, 7 Aug 2024 11:22:56 +0200 Message-ID: <20240807092303.1935-2-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807092303.1935-1-tiwai@suse.de> References: <20240807092303.1935-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.01 / 50.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)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Spamd-Bar: / X-Rspamd-Queue-Id: F24711F7E5 X-Spam-Level: X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -0.01 When the protocol capability bits are changed via Endpoint Info update notification, we should check the validity of the current protocol and reset it if needed, too. Signed-off-by: Takashi Iwai --- sound/core/ump.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/sound/core/ump.c b/sound/core/ump.c index c7c3581bbbbc..4502de891adf 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -657,6 +657,17 @@ static int ump_append_string(struct snd_ump_endpoint *ump, char *dest, format == UMP_STREAM_MSG_FORMAT_END); } +/* Choose the default protocol */ +static void choose_default_protocol(struct snd_ump_endpoint *ump) +{ + if (ump->info.protocol & SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK) + return; + if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI2) + ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI2; + else + ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI1; +} + /* handle EP info stream message; update the UMP attributes */ static int ump_handle_ep_info_msg(struct snd_ump_endpoint *ump, const union snd_ump_stream_msg *buf) @@ -678,6 +689,10 @@ static int ump_handle_ep_info_msg(struct snd_ump_endpoint *ump, ump_dbg(ump, "EP info: version=%x, num_blocks=%x, proto_caps=%x\n", ump->info.version, ump->info.num_blocks, ump->info.protocol_caps); + + ump->info.protocol &= ump->info.protocol_caps; + choose_default_protocol(ump); + return 1; /* finished */ } @@ -1040,12 +1055,7 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump) ump_dbg(ump, "Unable to get UMP EP stream config\n"); /* If no protocol is set by some reason, assume the valid one */ - if (!(ump->info.protocol & SNDRV_UMP_EP_INFO_PROTO_MIDI_MASK)) { - if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI2) - ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI2; - else if (ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI1) - ump->info.protocol |= SNDRV_UMP_EP_INFO_PROTO_MIDI1; - } + choose_default_protocol(ump); /* Query and create blocks from Function Blocks */ for (blk = 0; blk < ump->info.num_blocks; blk++) { From patchwork Wed Aug 7 09:22:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13756069 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE2F31CCB2B for ; Wed, 7 Aug 2024 09:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022550; cv=none; b=cuUvVkgPZxWGYOnti2CvxkiAZrWJPWgLL/iViZMrowLnMUQ+w3xgo8O4O1uZ5++zBixZ/PWbmCXDN+++mALn/bscbwj8wj7u2eI3QEDNub0bKwpIEoDkEzHGceWl6GWzvT4uFoyMd2QoFQH4rcmw/270bO6yTBfrqRuVMFNQZ2s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022550; c=relaxed/simple; bh=vkwYBpyFJfjE1aeDnKoRNpZ2xAOc8lmaBfjtdJPnCRQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RjwxhGDzefaiUDaSJ3WgpI3Yt3Bl12qYkRnjEEuh9IrULd1E+lPKLXXd6oGojYiERh2Te6k7aultDWMXLrHvUudTmfZp/cecF61pBNLQuiD+x8vYgGgVIW5yB3i4Zm4EnS0zGt8k36Pm5uDbS5E5a6RDXQU4evr6OuhBPHFJVJs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=F0GhOyrS; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=7cxrSDhD; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=F0GhOyrS; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=7cxrSDhD; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="F0GhOyrS"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="7cxrSDhD"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="F0GhOyrS"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="7cxrSDhD" 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 1C5BF21B52; Wed, 7 Aug 2024 09:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=CQjFVibdn4UHFTZLNk/7vHTCh1a1SfI0ep8aHUOnslo=; b=F0GhOyrSQmCQMT0xhGHL7NwuYNLPjxLQ2HwrarCiquL1jmSb9xGAUtcR0TSf/cpx3vDYNh dE2aBGIZ1OKzqVyNaFXx0VhBXsssHJaYHv+I9G/NbjxuCbi4IXudAQwHOJ8ygjiiEn4NF1 zX2xNCHDjBnbM5SyOfkTHTVLDLMXBe4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=CQjFVibdn4UHFTZLNk/7vHTCh1a1SfI0ep8aHUOnslo=; b=7cxrSDhDC5hzwBMdWlITkqIaLfekIv31C4XkXXgh5hAHx9jB3dXPLJmQOuCAgRwKZ3PCB3 aa3Tio0HePflZbBQ== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=F0GhOyrS; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=7cxrSDhD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=CQjFVibdn4UHFTZLNk/7vHTCh1a1SfI0ep8aHUOnslo=; b=F0GhOyrSQmCQMT0xhGHL7NwuYNLPjxLQ2HwrarCiquL1jmSb9xGAUtcR0TSf/cpx3vDYNh dE2aBGIZ1OKzqVyNaFXx0VhBXsssHJaYHv+I9G/NbjxuCbi4IXudAQwHOJ8ygjiiEn4NF1 zX2xNCHDjBnbM5SyOfkTHTVLDLMXBe4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=CQjFVibdn4UHFTZLNk/7vHTCh1a1SfI0ep8aHUOnslo=; b=7cxrSDhDC5hzwBMdWlITkqIaLfekIv31C4XkXXgh5hAHx9jB3dXPLJmQOuCAgRwKZ3PCB3 aa3Tio0HePflZbBQ== 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 F36E713B05; Wed, 7 Aug 2024 09:22:26 +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 IPk9OtI8s2ZxCgAAD6G6ig (envelope-from ); Wed, 07 Aug 2024 09:22:26 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 2/6] ALSA: usb-audio: Accept multiple protocols in GTBs Date: Wed, 7 Aug 2024 11:22:57 +0200 Message-ID: <20240807092303.1935-3-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807092303.1935-1-tiwai@suse.de> References: <20240807092303.1935-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Rspamd-Action: no action X-Spam-Score: -3.01 X-Spam-Flag: NO X-Rspamd-Queue-Id: 1C5BF21B52 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)[]; MIME_TRACE(0.00)[0:+]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; 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)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_VIA_SMTP_AUTH(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:email] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org It's valid to give different protocols via multiple GTBs; e.g. a MIDI 1.0 port is embedded in a MIDI 2.0 device that talks with MIDI 2.0 protocol. However, the current driver implementation assumes only a single protocol over the whole Endpoint, and it can't handle such a scenario. This patch changes the driver's behavior to parse GTBs to accept multiple protocols. Instead of switching to the last given protocol, it adds the protocol capability bits now. Meanwhile, the default protocol is chosen by the first given protocol in GTBs. Practically seen, this should be a minor issue, as new devices should specify the protocols properly via UMP Endpoint Info messages, so this is rather just covering a corner case. Signed-off-by: Takashi Iwai --- sound/usb/midi2.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index 820d3e4b672a..fa655aa4a56f 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -607,12 +607,8 @@ static int parse_group_terminal_block(struct snd_usb_midi2_ump *rmidi, return 0; } - if (ump->info.protocol && ump->info.protocol != protocol) - usb_audio_info(rmidi->umidi->chip, - "Overriding preferred MIDI protocol in GTB %d: %x -> %x\n", - rmidi->usb_block_id, ump->info.protocol, - protocol); - ump->info.protocol = protocol; + if (!ump->info.protocol) + ump->info.protocol = protocol; protocol_caps = protocol; switch (desc->bMIDIProtocol) { @@ -624,13 +620,7 @@ static int parse_group_terminal_block(struct snd_usb_midi2_ump *rmidi, break; } - if (ump->info.protocol_caps && ump->info.protocol_caps != protocol_caps) - usb_audio_info(rmidi->umidi->chip, - "Overriding MIDI protocol caps in GTB %d: %x -> %x\n", - rmidi->usb_block_id, ump->info.protocol_caps, - protocol_caps); - ump->info.protocol_caps = protocol_caps; - + ump->info.protocol_caps |= protocol_caps; return 0; } From patchwork Wed Aug 7 09:22:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13756072 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 575731C9DDC for ; Wed, 7 Aug 2024 09:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022555; cv=none; b=PE0Kr5LVfSderMFA5xkuagkwPn03hFkRnG3GJ5+IHsGaPeQKSaMSKB3xD43fFRaCcdIH36iJWiq9VxIKhG9d+vg9tKAtL7Lm5lCBBu+bjGi/JvDRQ4gCqM/3+RUFMvx7ar8K1FzqDmtnLXM1pDMKaWsa0yPV6Nxzpi8nSIZO3/E= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022555; c=relaxed/simple; bh=PnP5yq/DuvOAJEyQ0DVBS+GasIYCWxfM1jRK3m5B4tk=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H6BXrMCSwk30u9ynGgaihtxNfKqTBG44YGd5Rxu7rHfSN3JTy/oFtwGQf+DCNmMK0GgbtM2lnaibdDjMMmhDQX//PWiDrx1dlCbKz+w6esnI6cwxljar+hx+Zb6mgpeI0BWjOTX+Obt4O0uPcuqJbvDlsZWz3rQGeQ0QIhZ1Ubo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cZldRHzT; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=jT5Kxuu5; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=cZldRHzT; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=jT5Kxuu5; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cZldRHzT"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="jT5Kxuu5"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="cZldRHzT"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="jT5Kxuu5" 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 41D9B1FB7A; Wed, 7 Aug 2024 09:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=FdqNKRQ/qbXfhVOYMezjVVJpB0U0Ehb0Xy1JNMNAcHI=; b=cZldRHzTqqKJkUFZbw/UlSptrDmPcyos6aw7Cgsm1ZolNC98Z3RlzVmZ4cJXrfB/OxRZEi fLFCPR6xSr/tA9BlmNJTvJJuSVrw0szsOr8/4pqf9D+mm3wqi6uwzZxXWamrrqlku908YC bD52l6IZC0hXUd96NCIEmFCi2JleFXk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=FdqNKRQ/qbXfhVOYMezjVVJpB0U0Ehb0Xy1JNMNAcHI=; b=jT5Kxuu51wbzm5ZE6hNDLwkX7WMTO8rEMFPaevMJUjG1IGMXYmmDpYdOkbFvA6Nksx8HSn gUTUbrwp5dnrq4AQ== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=FdqNKRQ/qbXfhVOYMezjVVJpB0U0Ehb0Xy1JNMNAcHI=; b=cZldRHzTqqKJkUFZbw/UlSptrDmPcyos6aw7Cgsm1ZolNC98Z3RlzVmZ4cJXrfB/OxRZEi fLFCPR6xSr/tA9BlmNJTvJJuSVrw0szsOr8/4pqf9D+mm3wqi6uwzZxXWamrrqlku908YC bD52l6IZC0hXUd96NCIEmFCi2JleFXk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=FdqNKRQ/qbXfhVOYMezjVVJpB0U0Ehb0Xy1JNMNAcHI=; b=jT5Kxuu51wbzm5ZE6hNDLwkX7WMTO8rEMFPaevMJUjG1IGMXYmmDpYdOkbFvA6Nksx8HSn gUTUbrwp5dnrq4AQ== 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 1D92F13B06; Wed, 7 Aug 2024 09:22:27 +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 kLYNBtM8s2ZxCgAAD6G6ig (envelope-from ); Wed, 07 Aug 2024 09:22:27 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 3/6] ALSA: usb-audio: Set MIDI1 flag appropriately for GTB MIDI 1.0 entry Date: Wed, 7 Aug 2024 11:22:58 +0200 Message-ID: <20240807092303.1935-4-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807092303.1935-1-tiwai@suse.de> References: <20240807092303.1935-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: 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)[-0.987]; 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: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)[] X-Spam-Flag: NO X-Spam-Score: -2.80 When a MIDI 1.0 protocol is specified in a GTB entry while others are set in MIDI 2.0, it should be seen as a legacy MIDI 1.0 port. Since recently we allow drivers to set a flag SNDRV_UMP_BLOCK_IS_MIDI1 to a FB for that purpose. This patch tries to set that flag when the device shows such a configuration. Signed-off-by: Takashi Iwai --- sound/usb/midi2.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index fa655aa4a56f..4fb43d9743d7 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -863,9 +863,23 @@ static int create_gtb_block(struct snd_usb_midi2_ump *rmidi, int dir, int blk) fb->info.flags |= SNDRV_UMP_BLOCK_IS_MIDI1 | SNDRV_UMP_BLOCK_IS_LOWSPEED; + /* if MIDI 2.0 protocol is supported and yet the GTB shows MIDI 1.0, + * treat it as a MIDI 1.0-specific block + */ + if (rmidi->ump->info.protocol_caps & SNDRV_UMP_EP_INFO_PROTO_MIDI2) { + switch (desc->bMIDIProtocol) { + case USB_MS_MIDI_PROTO_1_0_64: + case USB_MS_MIDI_PROTO_1_0_64_JRTS: + case USB_MS_MIDI_PROTO_1_0_128: + case USB_MS_MIDI_PROTO_1_0_128_JRTS: + fb->info.flags |= SNDRV_UMP_BLOCK_IS_MIDI1; + break; + } + } + usb_audio_dbg(umidi->chip, - "Created a UMP block %d from GTB, name=%s\n", - blk, fb->info.name); + "Created a UMP block %d from GTB, name=%s, flags=0x%x\n", + blk, fb->info.name, fb->info.flags); return 0; } From patchwork Wed Aug 7 09:22:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13756073 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64C871CCB32 for ; Wed, 7 Aug 2024 09:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022556; cv=none; b=JhIz2BHZnbjDaq9OdCM3b7Lzh7Ipn2QWFrhwjB01GgNHOkEsCGNABhQfdH+jZL8r3+6IkktAsdCzjSZMnLwbJboq6DKCVCDx4P9Kv2FYJzo1LwIpoihtUc8qAAt851tbYu0O3Q52mTSqpIfpOJ7m4w9gTQGGp7JmkFqsjQaiqpg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022556; c=relaxed/simple; bh=2amv0icxh21dt9Kjg5jknaSTxsqOwc0JbZ7GPL1Rvzo=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W3iVrq6EWUwnxZdZRRoHgSy64MUsoLi951Iwht954C4NXhz9E8oO6F0YZ/Nc/nhh4ZIlog6i2JFHwCD66ahfboX1EByrXzjN1e+sTj2NUsgW49xs3h1tUYPDgU8ZK4UuTQS7sLFwsAHXOaAQo8CDZBQF7L+ibztE2nABAi1ki4I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=UOdOxngt; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=xDMAF24/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=UOdOxngt; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=xDMAF24/; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="UOdOxngt"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="xDMAF24/"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="UOdOxngt"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="xDMAF24/" 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 546A01FB8C; Wed, 7 Aug 2024 09:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=a31aY18qeTZBenAT4ZlqDeqKX2diP/JyYobOC9ngbZQ=; b=UOdOxngtF/VT7wFVSkRPJMy1WQ07r+l35cA2/hkVoQa7fTNS6BLkmgIzkkgJz3RQTDL8RV Q/S5RhNMQn8UVNM5rvKNEtF9A1CCGjygMufgNgNwCjGDqhYGe+ZDJtV8AYhfPFlPtPrTZ1 ED+HAshjVZG0LjNbzlbI0pKFA1ffE28= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=a31aY18qeTZBenAT4ZlqDeqKX2diP/JyYobOC9ngbZQ=; b=xDMAF24/P4bx6A9B40IB7ErY8UXrRQ5vshISlsddeZBcgUDDnr3jOi9S4OBmJ1mmDEJqSQ cZyxOzA2VxiieQBA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=a31aY18qeTZBenAT4ZlqDeqKX2diP/JyYobOC9ngbZQ=; b=UOdOxngtF/VT7wFVSkRPJMy1WQ07r+l35cA2/hkVoQa7fTNS6BLkmgIzkkgJz3RQTDL8RV Q/S5RhNMQn8UVNM5rvKNEtF9A1CCGjygMufgNgNwCjGDqhYGe+ZDJtV8AYhfPFlPtPrTZ1 ED+HAshjVZG0LjNbzlbI0pKFA1ffE28= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=a31aY18qeTZBenAT4ZlqDeqKX2diP/JyYobOC9ngbZQ=; b=xDMAF24/P4bx6A9B40IB7ErY8UXrRQ5vshISlsddeZBcgUDDnr3jOi9S4OBmJ1mmDEJqSQ cZyxOzA2VxiieQBA== 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 3B96D13297; Wed, 7 Aug 2024 09:22:27 +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 CH9mDdM8s2ZxCgAAD6G6ig (envelope-from ); Wed, 07 Aug 2024 09:22:27 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 4/6] ALSA: usb-audio: Update UMP group attributes for GTB blocks, too Date: Wed, 7 Aug 2024 11:22:59 +0200 Message-ID: <20240807092303.1935-5-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807092303.1935-1-tiwai@suse.de> References: <20240807092303.1935-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Spam-Level: X-Spamd-Result: default: False [0.20 / 50.00]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-0.991]; MIME_GOOD(-0.10)[text/plain]; FUZZY_BLOCKED(0.00)[rspamd.com]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; RCVD_VIA_SMTP_AUTH(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-Spam-Flag: NO X-Spam-Score: 0.20 When a FB is created from a GTB instead of UMP FB Info inquiry, we missed the update of the corresponding UMP Group attributes. Export the call of updater and let it be called from the USB driver. Fixes: 0642a3c5cacc ("ALSA: ump: Update substream name from assigned FB names") Signed-off-by: Takashi Iwai --- include/sound/ump.h | 1 + sound/core/ump.c | 9 +++++---- sound/usb/midi2.c | 2 ++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/include/sound/ump.h b/include/sound/ump.h index 7484f62fb234..532c2c3ea28e 100644 --- a/include/sound/ump.h +++ b/include/sound/ump.h @@ -123,6 +123,7 @@ static inline int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump, int snd_ump_receive_ump_val(struct snd_ump_endpoint *ump, u32 val); int snd_ump_switch_protocol(struct snd_ump_endpoint *ump, unsigned int protocol); +void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump); /* * Some definitions for UMP diff --git a/sound/core/ump.c b/sound/core/ump.c index 4502de891adf..243ecdbb2a6e 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -525,7 +525,7 @@ static void snd_ump_proc_read(struct snd_info_entry *entry, } /* update dir_bits and active flag for all groups in the client */ -static void update_group_attrs(struct snd_ump_endpoint *ump) +void snd_ump_update_group_attrs(struct snd_ump_endpoint *ump) { struct snd_ump_block *fb; struct snd_ump_group *group; @@ -578,6 +578,7 @@ static void update_group_attrs(struct snd_ump_endpoint *ump) } } } +EXPORT_SYMBOL_GPL(snd_ump_update_group_attrs); /* * UMP endpoint and function block handling @@ -863,7 +864,7 @@ static int ump_handle_fb_info_msg(struct snd_ump_endpoint *ump, if (fb) { fill_fb_info(ump, &fb->info, buf); if (ump->parsed) { - update_group_attrs(ump); + snd_ump_update_group_attrs(ump); seq_notify_fb_change(ump, fb); } } @@ -895,7 +896,7 @@ static int ump_handle_fb_name_msg(struct snd_ump_endpoint *ump, buf->raw, 3); /* notify the FB name update to sequencer, too */ if (ret > 0 && ump->parsed) { - update_group_attrs(ump); + snd_ump_update_group_attrs(ump); seq_notify_fb_change(ump, fb); } return ret; @@ -1065,7 +1066,7 @@ int snd_ump_parse_endpoint(struct snd_ump_endpoint *ump) } /* initialize group attributions */ - update_group_attrs(ump); + snd_ump_update_group_attrs(ump); error: ump->parsed = true; diff --git a/sound/usb/midi2.c b/sound/usb/midi2.c index 4fb43d9743d7..692dfc3c182f 100644 --- a/sound/usb/midi2.c +++ b/sound/usb/midi2.c @@ -877,6 +877,8 @@ static int create_gtb_block(struct snd_usb_midi2_ump *rmidi, int dir, int blk) } } + snd_ump_update_group_attrs(rmidi->ump); + usb_audio_dbg(umidi->chip, "Created a UMP block %d from GTB, name=%s, flags=0x%x\n", blk, fb->info.name, fb->info.flags); From patchwork Wed Aug 7 09:23:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13756071 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 23A0E1CCB32 for ; Wed, 7 Aug 2024 09:22:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022550; cv=none; b=fK76b0LEdXdm2jndjHfEzclK36wp94qzdF5Ge+t5RxmUTFtquRbKbqkybOtA/A0eTQCRjHwwGoKyKMODg6D9AYHcpRnNKBJRD9zxKsvh3FVlVZUBO9rDp6Sc54Qo331ifCrUwWgZ6s2sLWP0mB7fRIrlQTxFZ6NbySUkeShhBQ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022550; c=relaxed/simple; bh=vyE8aBP3FwiuN5A0MIChThEC720SOhXhBptgeAFMneQ=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WBiPKQH/rbwrcqaic0ZSF74yQszKv5EMwxMWeNxQ3N9n940XzSUxYNyrVu4LyHmpslSzYIh7K4aD8hvML6F+e2a7w23LKyrSTMchScrGM/bfQHZf0IlhZHFl2x+HSIFQ3Fn3d4OAAfanHfDWOE8dOXyWtRRZx8/OoJ4DQcKIv6M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Z5Cds+rE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/K/6Jc6t; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=Z5Cds+rE; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=/K/6Jc6t; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Z5Cds+rE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/K/6Jc6t"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="Z5Cds+rE"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="/K/6Jc6t" 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 71B3221B53; Wed, 7 Aug 2024 09:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=zuUC15iNxy0UJv9lS45Qheg7dGkio267cZXgDI0aZBY=; b=Z5Cds+rEmuWszEeDvCAB/ah3ilEw4WqHXoDOaRc1Z89MuzpR9BZ6gafGKxeLQi/u0+uClT Mk+pPWgZ/vpAxoS9uZLAewDfE/5rOqNzhN9i8g5o/VTN07rVPkQj7a5GI6PGZvaN1+H9/n oW3mbkcUKMqzWoEe4TRCBBiHZ7eifOg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=zuUC15iNxy0UJv9lS45Qheg7dGkio267cZXgDI0aZBY=; b=/K/6Jc6t/A+JWR+PyOzrdLcxsLt6/dKhz7n6dN5dKPLnZNxYIYJgKpzmdst+BqqJnwATov J5yJyGkbDoTK7uCw== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=zuUC15iNxy0UJv9lS45Qheg7dGkio267cZXgDI0aZBY=; b=Z5Cds+rEmuWszEeDvCAB/ah3ilEw4WqHXoDOaRc1Z89MuzpR9BZ6gafGKxeLQi/u0+uClT Mk+pPWgZ/vpAxoS9uZLAewDfE/5rOqNzhN9i8g5o/VTN07rVPkQj7a5GI6PGZvaN1+H9/n oW3mbkcUKMqzWoEe4TRCBBiHZ7eifOg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=zuUC15iNxy0UJv9lS45Qheg7dGkio267cZXgDI0aZBY=; b=/K/6Jc6t/A+JWR+PyOzrdLcxsLt6/dKhz7n6dN5dKPLnZNxYIYJgKpzmdst+BqqJnwATov J5yJyGkbDoTK7uCw== 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 5985813B03; Wed, 7 Aug 2024 09:22:27 +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 QOe0FNM8s2ZxCgAAD6G6ig (envelope-from ); Wed, 07 Aug 2024 09:22:27 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 5/6] ALSA: seq: Print MIDI 1.0 specific port in proc output Date: Wed, 7 Aug 2024 11:23:00 +0200 Message-ID: <20240807092303.1935-6-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807092303.1935-1-tiwai@suse.de> References: <20240807092303.1935-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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)[-0.990]; 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: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)[] X-Spam-Score: -2.80 X-Spam-Flag: NO X-Spam-Level: When a sequencer port assigned to a UMP Group that is specific to MIDI 1.0 among MIDI 2.0 client, mark it explicitly in the proc output, so that user can see it easily. This is an exceptional case where the message isn't converted to MIDI 1.0 even if the client is running in MIDI 2.0 mode. Signed-off-by: Takashi Iwai --- sound/core/seq/seq_clientmgr.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 8c4ee5066afe..276b5b3f68dc 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -2633,13 +2633,18 @@ static void snd_seq_info_dump_ports(struct snd_info_buffer *buffer, list_for_each_entry(p, &client->ports_list_head, list) { if (p->capability & SNDRV_SEQ_PORT_CAP_INACTIVE) continue; - snd_iprintf(buffer, " Port %3d : \"%s\" (%c%c%c%c) [%s]\n", + snd_iprintf(buffer, " Port %3d : \"%s\" (%c%c%c%c) [%s]", p->addr.port, p->name, FLAG_PERM_RD(p->capability), FLAG_PERM_WR(p->capability), FLAG_PERM_EX(p->capability), FLAG_PERM_DUPLEX(p->capability), port_direction_name(p->direction)); +#if IS_ENABLED(CONFIG_SND_SEQ_UMP) + if (snd_seq_client_is_midi2(client) && p->is_midi1) + snd_iprintf(buffer, " [MIDI1]"); +#endif + snd_iprintf(buffer, "\n"); snd_seq_info_dump_subscribers(buffer, &p->c_src, 1, " Connecting To: "); snd_seq_info_dump_subscribers(buffer, &p->c_dest, 0, " Connected From: "); } From patchwork Wed Aug 7 09:23:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13756070 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 239B61CCB31 for ; Wed, 7 Aug 2024 09:22:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022550; cv=none; b=EFX2+Erep/zUhUdUW5bxrc2iX2WieF0RPg+9kwiKMIypjye90pXSTivkkStgrcOGBnm4fa+coG3InNCVqKW2JbMluUXMVwkrK89Qd0XvP07rQ3uXFBZwMhmh3/U4gpS67oPTkKg/5z1BrIRLzs8/FI/WLGJNER9x3fmZtSkzSrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723022550; c=relaxed/simple; bh=0fu3+t3Z+UCemfS/Xtr64uEB7P2DiECVVgMwxKsExQI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y/mg67uGff2uGXwKshxtK3o2o5VonkT/zZokkxAeMZ346wz1pSCN63AQIykBS45TkfmPKxqxM95vdmT0sCX/dKbf7Vjvqz/Y+wFddWNVm7eKfZW8mL37W9HPiYQYvMedOuEoP85zV6fkgYRmjDj50i17MXI5D+pSzlKWi/oqch0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=o18B+/8I; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uJ7JY+NK; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=o18B+/8I; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=uJ7JY+NK; arc=none smtp.client-ip=195.135.223.130 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="o18B+/8I"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uJ7JY+NK"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="o18B+/8I"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="uJ7JY+NK" 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 8F95F21B58; Wed, 7 Aug 2024 09:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=5quRQrJxiY30vgNHEsz2BUGUv8iAAQQ2JQT5k9EtjaE=; b=o18B+/8If+lqiNskNEqmD9SusOplzE1Q8dbUu/Y6gurSOyg3P3U06rhUSlwxpUSk2d6iWX Et4zjOzaa6z2scNw6Pml/lTGuYCZjOr68GW73BeVWBjSwNlVC9gh+ymyeqNHRsBii0/jvF LVaQFccz19Nf8UgvjzBYDbjNMCuiTUk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=5quRQrJxiY30vgNHEsz2BUGUv8iAAQQ2JQT5k9EtjaE=; b=uJ7JY+NKBcIlzSk70C1FAlavUPWEYWNn2NMtXPiCI0NX+w+qk1IL7+9Kw06s1qasm3B50y uPrKdt+ItVYs8gCw== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="o18B+/8I"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=uJ7JY+NK DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1723022547; 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=5quRQrJxiY30vgNHEsz2BUGUv8iAAQQ2JQT5k9EtjaE=; b=o18B+/8If+lqiNskNEqmD9SusOplzE1Q8dbUu/Y6gurSOyg3P3U06rhUSlwxpUSk2d6iWX Et4zjOzaa6z2scNw6Pml/lTGuYCZjOr68GW73BeVWBjSwNlVC9gh+ymyeqNHRsBii0/jvF LVaQFccz19Nf8UgvjzBYDbjNMCuiTUk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1723022547; 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=5quRQrJxiY30vgNHEsz2BUGUv8iAAQQ2JQT5k9EtjaE=; b=uJ7JY+NKBcIlzSk70C1FAlavUPWEYWNn2NMtXPiCI0NX+w+qk1IL7+9Kw06s1qasm3B50y uPrKdt+ItVYs8gCw== 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 77AA513297; Wed, 7 Aug 2024 09:22:27 +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 UCUZHNM8s2ZxCgAAD6G6ig (envelope-from ); Wed, 07 Aug 2024 09:22:27 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 6/6] ALSA: seq: Fix missing seq port info bit return for MIDI 1.0 block Date: Wed, 7 Aug 2024 11:23:01 +0200 Message-ID: <20240807092303.1935-7-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240807092303.1935-1-tiwai@suse.de> References: <20240807092303.1935-1-tiwai@suse.de> Precedence: bulk X-Mailing-List: linux-sound@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Rspamd-Server: rspamd2.dmz-prg2.suse.org X-Spamd-Result: default: False [-0.01 / 50.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)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_VIA_SMTP_AUTH(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:email,suse.de:dkim]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; FROM_EQ_ENVFROM(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FROM_HAS_DN(0.00)[]; DNSWL_BLOCKED(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Spamd-Bar: / X-Rspamd-Queue-Id: 8F95F21B58 X-Spam-Level: X-Rspamd-Action: no action X-Spam-Flag: NO X-Spam-Score: -0.01 The recent extension added a new ALSA sequencer port info flag bit SNDRV_SEQ_PORT_FLG_IS_MIDI1, but it's not reported back when inquired. Fix it to report properly. Fixes: 0079c9d1e58a ("ALSA: ump: Handle MIDI 1.0 Function Block in MIDI 2.0 protocol") Signed-off-by: Takashi Iwai --- sound/core/seq/seq_ports.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sound/core/seq/seq_ports.c b/sound/core/seq/seq_ports.c index 535290f24eed..cc2f8e846584 100644 --- a/sound/core/seq/seq_ports.c +++ b/sound/core/seq/seq_ports.c @@ -401,6 +401,9 @@ int snd_seq_get_port_info(struct snd_seq_client_port * port, info->time_queue = port->time_queue; } + if (port->is_midi1) + info->flags |= SNDRV_SEQ_PORT_FLG_IS_MIDI1; + /* UMP direction and group */ info->direction = port->direction; info->ump_group = port->ump_group;