From patchwork Fri Nov 29 09:45:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13888547 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 7D1161865E1 for ; Fri, 29 Nov 2024 09:45:55 +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=1732873557; cv=none; b=byOW/POZkL/Vsp3RvKRBotnJ6K60Fa32EqJzgUd3KsfdvkVr/2ov/7/Vz8wlES2B+grzK9WfbY0w2+7Tq/FRXicSchNv16OyqRKdCF/loU/ZCH1yeLcHoWgpoTjafkkKM4GJxM/klf0UFi9k8HCTBARPLklpPP54H3MmgVA+RT4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732873557; c=relaxed/simple; bh=CNBxd/wdtPpQ28DVwTA5yo9WFndtjMBL3WEybJ+xwC0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xi/CCDkNPb2zvOm4HVc5//vauC9ZeuRgYHvdfmCDUcRAZZAszmX9rI4m4Uf03hWvZWe4fRrnHdmjaJ2xDtkPVXxqUoMSXGPdIo1Jd755AYbFF4op7Mw5mH2y2IaXxxwewlJrXwDeFn0vgkIcpE6F5hjLCuqrddK5HHMfYRmmYcU= 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=x2lGD+rj; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=k8FQWrTz; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=x2lGD+rj; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=k8FQWrTz; 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="x2lGD+rj"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="k8FQWrTz"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="x2lGD+rj"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="k8FQWrTz" 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 950B821194; Fri, 29 Nov 2024 09:45:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732873553; 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=Tyj4WT1TTMFZfxKuf63vbbqOeKSh2+XP43iBrvH5hX4=; b=x2lGD+rjnnVtoUbjm1uCOMUPQVhPY40v5OiUzmbPqh+5kxjE+HJXF5Dm0h9bbVvTtYSaJt FmUXx1N3BNpk74vnk7tfugELy/4WdjkPs4gSHNu7noqavW63+fFkMrqeatpKHlhx8JMdOt HO05JHeNld3N1pCSpY6o2Dhs5KbBaIE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732873553; 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=Tyj4WT1TTMFZfxKuf63vbbqOeKSh2+XP43iBrvH5hX4=; b=k8FQWrTzOWJLlagubC092ZAqm93oV+FNCDb+lFyc3JLjNkMsWuiIJ1A6c8P/sdIIphBc8i +D4u0OAvsLfRE5DA== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732873553; 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=Tyj4WT1TTMFZfxKuf63vbbqOeKSh2+XP43iBrvH5hX4=; b=x2lGD+rjnnVtoUbjm1uCOMUPQVhPY40v5OiUzmbPqh+5kxjE+HJXF5Dm0h9bbVvTtYSaJt FmUXx1N3BNpk74vnk7tfugELy/4WdjkPs4gSHNu7noqavW63+fFkMrqeatpKHlhx8JMdOt HO05JHeNld3N1pCSpY6o2Dhs5KbBaIE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732873553; 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=Tyj4WT1TTMFZfxKuf63vbbqOeKSh2+XP43iBrvH5hX4=; b=k8FQWrTzOWJLlagubC092ZAqm93oV+FNCDb+lFyc3JLjNkMsWuiIJ1A6c8P/sdIIphBc8i +D4u0OAvsLfRE5DA== 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 6F57813AA5; Fri, 29 Nov 2024 09:45:53 +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 WOXpGVGNSWd5VgAAD6G6ig (envelope-from ); Fri, 29 Nov 2024 09:45:53 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 1/3] ALSA: ump: Don't open legacy substream for an inactive group Date: Fri, 29 Nov 2024 10:45:42 +0100 Message-ID: <20241129094546.32119-2-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241129094546.32119-1-tiwai@suse.de> References: <20241129094546.32119-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-Score: -2.80 X-Spamd-Result: default: False [-2.80 / 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)[]; 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,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)[] X-Spam-Flag: NO X-Spam-Level: When a UMP Group is inactive, we shouldn't allow users to access it via the legacy MIDI access. Add the group active flag check and return -ENODEV if it's inactive. Signed-off-by: Takashi Iwai --- sound/core/ump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/core/ump.c b/sound/core/ump.c index 6d0aac6c763f..9f9ad106107f 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -1087,6 +1087,8 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream) guard(mutex)(&ump->open_mutex); if (ump->legacy_substreams[dir][group]) return -EBUSY; + if (!ump->groups[group].active) + return -ENODEV; if (dir == SNDRV_RAWMIDI_STREAM_OUTPUT) { if (!ump->legacy_out_opens) { err = snd_rawmidi_kernel_open(&ump->core, 0, From patchwork Fri Nov 29 09:45:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13888548 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 5DD2B189BA4 for ; Fri, 29 Nov 2024 09:45:56 +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=1732873558; cv=none; b=YmFLeHya+8PAesft8MBVPlQLsTo9OsUp9Y1ROspl3LMsEwQImGEeX9eOrp3ImJVNAUYr3lfTJWpIHO8X7a1w5eiQsuQa8IsoE5nVR/o100NxtGNCoVaSRdT4mnW+Jsej+jK1yOsC86lm7zsxr7xpcTpBJ9Za8vDJ5v9LYg30dN0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732873558; c=relaxed/simple; bh=3r80LAZzGH5Qs7WU3uelIKnsQ/nhyX95SQoQUQ4fpF0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=m31UVurW+ZR2X8ehQ1HIkQq8SHllbC96C2EPq6HkLyT5B3H/rt89BpFhbnbyTs44gwTnb3wBU9ev+W9eQ1yvOtrMbZHZl7iPOzkMRX7wHRgr3mTyb7lxNW7yWReft2RUQJPU9oaaxomid1NgTdu+j5fAaqRCXblNwgCPpMj4Xu8= 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=fl1ZnAOC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=G5vKc2v/; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=fl1ZnAOC; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=G5vKc2v/; 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="fl1ZnAOC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="G5vKc2v/"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="fl1ZnAOC"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="G5vKc2v/" 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 5C3691F391; Fri, 29 Nov 2024 09:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732873554; 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=b6m/F12N138IAXUiHLRaEmSud6jFiWso82Dw18wa8k4=; b=fl1ZnAOCxVLFa9WPsJUhE9O8oOqVtz55Qs/NLq8zDt12Fg2qIGoBFYmMT7Bc+xC6R46gIz G57GRPKfghgqentzFxOJNG+qS7pcByFUlBkTnjdmejkmDP61RPpNobEV+UB6aGctbvfaYi d7q7FztsHU/Uuzjyd0susZSQlxbYocA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732873554; 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=b6m/F12N138IAXUiHLRaEmSud6jFiWso82Dw18wa8k4=; b=G5vKc2v/rb5nGwMr2jDsJyHy6l75vqYzL/90xM0WF+DDlslF/rj6h+rlWjE1jk+zjEg1fn fPBTXf44y30RI8Ag== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=fl1ZnAOC; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="G5vKc2v/" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732873554; 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=b6m/F12N138IAXUiHLRaEmSud6jFiWso82Dw18wa8k4=; b=fl1ZnAOCxVLFa9WPsJUhE9O8oOqVtz55Qs/NLq8zDt12Fg2qIGoBFYmMT7Bc+xC6R46gIz G57GRPKfghgqentzFxOJNG+qS7pcByFUlBkTnjdmejkmDP61RPpNobEV+UB6aGctbvfaYi d7q7FztsHU/Uuzjyd0susZSQlxbYocA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732873554; 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=b6m/F12N138IAXUiHLRaEmSud6jFiWso82Dw18wa8k4=; b=G5vKc2v/rb5nGwMr2jDsJyHy6l75vqYzL/90xM0WF+DDlslF/rj6h+rlWjE1jk+zjEg1fn fPBTXf44y30RI8Ag== 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 42E3413AA5; Fri, 29 Nov 2024 09:45:54 +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 ML0XD1KNSWd5VgAAD6G6ig (envelope-from ); Fri, 29 Nov 2024 09:45:54 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 2/3] ALSA: ump: Indicate the inactive group in legacy substream names Date: Fri, 29 Nov 2024 10:45:43 +0100 Message-ID: <20241129094546.32119-3-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241129094546.32119-1-tiwai@suse.de> References: <20241129094546.32119-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-Queue-Id: 5C3691F391 X-Spam-Score: -3.01 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; 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)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_HAS_DN(0.00)[]; MIME_TRACE(0.00)[0:+]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[suse.de:dkim,suse.de:mid,suse.de:email,imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(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]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Level: Since the legacy rawmidi has no proper way to know the inactive group, indicate it in the rawmidi substream names with "[Inactive]" suffix when the corresponding UMP group is inactive. Signed-off-by: Takashi Iwai --- sound/core/ump.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/core/ump.c b/sound/core/ump.c index 9f9ad106107f..7b00a957e548 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -1256,8 +1256,9 @@ static void fill_substream_names(struct snd_ump_endpoint *ump, name = ump->groups[idx].name; if (!*name) name = ump->info.name; - snprintf(s->name, sizeof(s->name), "Group %d (%.16s)", - idx + 1, name); + snprintf(s->name, sizeof(s->name), "Group %d (%.16s)%s", + idx + 1, name, + ump->groups[idx].active ? "" : " [Inactive]"); } } From patchwork Fri Nov 29 09:45:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Takashi Iwai X-Patchwork-Id: 13888549 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 B2052156C72 for ; Fri, 29 Nov 2024 09:45:56 +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=1732873558; cv=none; b=HzVFHe80wsFEChdnGTwjkJ6LJag82xheQRoc+kHIU5ADol7wYcfx6Z2gV+jppfx40L+uluUtOg84zrSgdb66GY1WhU7vG3LTWX+YKTfubtbY2AeykwhajDvSrsdceQi6KVUVYd+fupplxWdyvX1gASN8hfRsrWeoknXO3/0rNgQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732873558; c=relaxed/simple; bh=ivfUApLR6y5upfzvSJDwWqEE/43gK3LZcgwcryDcdiI=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sDdONztuAGVZNuD8gJEZ58o5L8h24JkYxoRxVmpZP4adIj1QIjxUk6lpWDK+5wRmnmBrRVRTMQJ6ErGDxllmlkIxvVkR6Ep2Z/9MbrSw2ZTqp8YnbPlu0vjwKTIUUaOL0FdNQDMEgnfMLU8+TTs27ZE+0b5rVGRGSWSfd0irSFY= 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=wy2oybX9; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=dka+QMJ6; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=kubeSnCv; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=dzmFFoSi; 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="wy2oybX9"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="dka+QMJ6"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="kubeSnCv"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="dzmFFoSi" 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 EDDD621197; Fri, 29 Nov 2024 09:45:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732873555; 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=ZnPxhE32wh8sVeA/MZq9xGWpc5WI4wBFt4knHOdEZE8=; b=wy2oybX9b4NAovmnnShYgKMDKFZGGeiJfMP7wmdCljT7H075XoVodAY4iqVXz8ruGdDTEl 5suPVauQuYHuk99pVRyb8LRejEQRUNdVNTnxVpKoHutJvBpFA1rPCq0wxpjg9uIBcJb9UY NdBsIyOIPd1H9vyGBMAe09JxKRaGKcE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732873555; 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=ZnPxhE32wh8sVeA/MZq9xGWpc5WI4wBFt4knHOdEZE8=; b=dka+QMJ6PexnBPlT+9YBDpz9KuFlnYwauXYO6/sKf1kqoBbNmfSnCKZ/QJPuR8wSyneSl0 NKI/U3vf+vjyYJBA== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=kubeSnCv; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=dzmFFoSi DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1732873554; 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=ZnPxhE32wh8sVeA/MZq9xGWpc5WI4wBFt4knHOdEZE8=; b=kubeSnCv2pleZ1ZTRzTddNSPqtTlKAWwUAnktjyeo1x8QpfWVYtbEi1g37G07cbLA3ZmSH pcrPMwkhq+Qq91uqopHL+vEkOMcNXkk5INtJ7EXhZvcQT4QS7NcJEG6cJaQbc2ul+8ohwn JLPAsH9zQ1THsxIL3rusyWPNCwEkdQA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1732873554; 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=ZnPxhE32wh8sVeA/MZq9xGWpc5WI4wBFt4knHOdEZE8=; b=dzmFFoSigrYV9P17CTKh4gIn6fmAJlA8vVdBi7JDsNfTyEsXr/vrwfq6vtqcoIJ4upXlFz Kw7EZClPYUcExCBw== 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 D438013AA5; Fri, 29 Nov 2024 09:45:54 +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 2NieMlKNSWd5VgAAD6G6ig (envelope-from ); Fri, 29 Nov 2024 09:45:54 +0000 From: Takashi Iwai To: linux-sound@vger.kernel.org Subject: [PATCH 3/3] ALSA: ump: Update legacy substream names upon FB info update Date: Fri, 29 Nov 2024 10:45:44 +0100 Message-ID: <20241129094546.32119-4-tiwai@suse.de> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241129094546.32119-1-tiwai@suse.de> References: <20241129094546.32119-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-Queue-Id: EDDD621197 X-Spam-Score: -3.01 X-Rspamd-Action: no action 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)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns,imap1.dmz-prg2.suse.org:helo,suse.de:dkim,suse.de:mid,suse.de:email]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RCVD_COUNT_TWO(0.00)[2]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; DKIM_TRACE(0.00)[suse.de:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Flag: NO X-Spam-Level: The legacy rawmidi substreams should be updated when UMP FB Info or UMP FB Name are received, too. Signed-off-by: Takashi Iwai --- sound/core/ump.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/sound/core/ump.c b/sound/core/ump.c index 7b00a957e548..d2b810eb84bc 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -37,6 +37,7 @@ static int process_legacy_output(struct snd_ump_endpoint *ump, u32 *buffer, int count); static void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src, int words); +static void update_legacy_names(struct snd_ump_endpoint *ump); #else static inline int process_legacy_output(struct snd_ump_endpoint *ump, u32 *buffer, int count) @@ -47,6 +48,9 @@ static inline void process_legacy_input(struct snd_ump_endpoint *ump, const u32 *src, int words) { } +static inline void update_legacy_names(struct snd_ump_endpoint *ump) +{ +} #endif static const struct snd_rawmidi_global_ops snd_ump_rawmidi_ops = { @@ -861,6 +865,7 @@ static int ump_handle_fb_info_msg(struct snd_ump_endpoint *ump, fill_fb_info(ump, &fb->info, buf); if (ump->parsed) { snd_ump_update_group_attrs(ump); + update_legacy_names(ump); seq_notify_fb_change(ump, fb); } } @@ -893,6 +898,7 @@ static int ump_handle_fb_name_msg(struct snd_ump_endpoint *ump, /* notify the FB name update to sequencer, too */ if (ret > 0 && ump->parsed) { snd_ump_update_group_attrs(ump); + update_legacy_names(ump); seq_notify_fb_change(ump, fb); } return ret; @@ -1262,6 +1268,14 @@ static void fill_substream_names(struct snd_ump_endpoint *ump, } } +static void update_legacy_names(struct snd_ump_endpoint *ump) +{ + struct snd_rawmidi *rmidi = ump->legacy_rmidi; + + fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT); + fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT); +} + int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump, char *id, int device) { @@ -1298,10 +1312,7 @@ int snd_ump_attach_legacy_rawmidi(struct snd_ump_endpoint *ump, rmidi->ops = &snd_ump_legacy_ops; rmidi->private_data = ump; ump->legacy_rmidi = rmidi; - if (input) - fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_INPUT); - if (output) - fill_substream_names(ump, rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT); + update_legacy_names(ump); ump_dbg(ump, "Created a legacy rawmidi #%d (%s)\n", device, id); return 0;