Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2219883rwd; Fri, 19 May 2023 02:39:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7ZIVYxnNJEzSqhOQHaVIvwnqcGS1Bv/1MoKKQAsX5dR3t2ydsUfgsg/ZebzPU9MHC5duf7 X-Received: by 2002:a17:903:234a:b0:1ac:a88a:70b6 with SMTP id c10-20020a170903234a00b001aca88a70b6mr6143866plh.31.1684489176881; Fri, 19 May 2023 02:39:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684489176; cv=none; d=google.com; s=arc-20160816; b=i+tFJtKJoz/YgkU6P7QY7BACjkId6phlsGek9seqryGDlOdhaI06S+3gwCzsUSI7y3 JH0Fy/eqbi2ZoWsZtg/aipoCP2Z0CyQUeHko58S/hQsqQLorgyngUeqTEyl3QCASOymT Fyx1Pvl1lUWFu7Nahr7VZxCX+ZJxG+XuESGb6t2D//4ydEFxp0Z5uqMqwaK6kNcwxePe Wn4yCHp5fL84Dc4DRXiHYiLDGD2kR0CXrp1Uw1sbom7840slJgJFdNOrFGWBhtdypdTC dLxoW1MxtbNMmZqlrDYk+OO5M/RtDagica63+zR3Z29eUMlFw9QWew+hMMGc+ni8km2d 5MLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=LcWrJIWY+/p8LoxWXI8z182Rbib3A1gSwftREo4N5Mk=; b=Z+1idNXU0dntWEFyftQ22I6runIFYcQwBVDZ41Db3uoE0Ok0yTlU+Lcb0edEXlOOh3 i/+c1k1g6/uFeQXz1E2rZzajNc04YCtJ2eS00mZ9jBp2Llsh3MMCrnY++OfYVdly0g63 q7J5sb+mz+WZcxemDWHsb4wnfCw8WKoRYLY7x3t0b5hudX7DTrt2D/Iv9uaWcPJ3WuK+ 9gg9RIddZ59KU+Wy00sfDoqhctuUi2/YzypgZ+HZ6geiLYiD4t9aM1BcA9fVe3osbPkx 1Spq723esAIUwP020CWFzKPb1ZjUjnqtFelUkB3jfceZfr+GRoSU3yMeBLAIR8Fpw1Xg uDuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=vebHVlZF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b10-20020a170902650a00b001a95b85b09esi3121791plk.578.2023.05.19.02.39.24; Fri, 19 May 2023 02:39:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=vebHVlZF; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231680AbjESJdT (ORCPT + 99 others); Fri, 19 May 2023 05:33:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231671AbjESJco (ORCPT ); Fri, 19 May 2023 05:32:44 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9667C19AA for ; Fri, 19 May 2023 02:31:49 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id F1F901FE55; Fri, 19 May 2023 09:31:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1684488707; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LcWrJIWY+/p8LoxWXI8z182Rbib3A1gSwftREo4N5Mk=; b=vebHVlZFlC74SCyeyoy5hwzLUXIEjKjwSTN7NskAek7ww1BrHyNxePPknLZjiKqNCVXc/9 4MsOa64PLipYnCZH9xLP3dTBj5WWPIMqccI6qV9f1UDhw+n7a7hhSuq1T6NEuHzX1hvhBR jBjoMYosThgeKMdui2txo9+RfZRRhG4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1684488707; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LcWrJIWY+/p8LoxWXI8z182Rbib3A1gSwftREo4N5Mk=; b=yYsKtuG/vVdxF0SJ5y+EubC4QF+BSmaTQX68JRhIMEp8UpHnmC3lSLiFJF1ErUwuvnGCGX xmJnvGtA2T7AU/CA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C49D713A12; Fri, 19 May 2023 09:31:47 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id wGL0LgNCZ2RXJAAAMHmgww (envelope-from ); Fri, 19 May 2023 09:31:47 +0000 From: Takashi Iwai To: alsa-devel@alsa-project.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 30/36] ALSA: seq: Allow suppressing UMP conversions Date: Fri, 19 May 2023 11:31:08 +0200 Message-Id: <20230519093114.28813-31-tiwai@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230519093114.28813-1-tiwai@suse.de> References: <20230519093114.28813-1-tiwai@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org A sequencer client like seq_dummy rather doesn't want to convert UMP events but receives / sends as is. Add a new event filter flag to suppress the automatic UMP conversion and applies accordingly. Signed-off-by: Takashi Iwai --- include/uapi/sound/asequencer.h | 1 + sound/core/seq/seq_clientmgr.c | 18 ++++++++++-------- sound/core/seq/seq_dummy.c | 8 ++++++++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/include/uapi/sound/asequencer.h b/include/uapi/sound/asequencer.h index 2470eaa5edc5..c4632bd9d3a0 100644 --- a/include/uapi/sound/asequencer.h +++ b/include/uapi/sound/asequencer.h @@ -347,6 +347,7 @@ typedef int __bitwise snd_seq_client_type_t; #define SNDRV_SEQ_FILTER_BROADCAST (1U<<0) /* accept broadcast messages */ #define SNDRV_SEQ_FILTER_MULTICAST (1U<<1) /* accept multicast messages */ #define SNDRV_SEQ_FILTER_BOUNCE (1U<<2) /* accept bounce event in error */ +#define SNDRV_SEQ_FILTER_NO_CONVERT (1U<<30) /* don't convert UMP events */ #define SNDRV_SEQ_FILTER_USE_EVENT (1U<<31) /* use event filter */ struct snd_seq_client_info { diff --git a/sound/core/seq/seq_clientmgr.c b/sound/core/seq/seq_clientmgr.c index 07b090f76b5f..3b1adcb1ccdd 100644 --- a/sound/core/seq/seq_clientmgr.c +++ b/sound/core/seq/seq_clientmgr.c @@ -671,14 +671,16 @@ static int snd_seq_deliver_single_event(struct snd_seq_client *client, dest_port->time_real); #if IS_ENABLED(CONFIG_SND_SEQ_UMP) - if (snd_seq_ev_is_ump(event)) { - result = snd_seq_deliver_from_ump(client, dest, dest_port, - event, atomic, hop); - goto __skip; - } else if (snd_seq_client_is_ump(dest)) { - result = snd_seq_deliver_to_ump(client, dest, dest_port, - event, atomic, hop); - goto __skip; + if (!(dest->filter & SNDRV_SEQ_FILTER_NO_CONVERT)) { + if (snd_seq_ev_is_ump(event)) { + result = snd_seq_deliver_from_ump(client, dest, dest_port, + event, atomic, hop); + goto __skip; + } else if (snd_seq_client_is_ump(dest)) { + result = snd_seq_deliver_to_ump(client, dest, dest_port, + event, atomic, hop); + goto __skip; + } } #endif /* CONFIG_SND_SEQ_UMP */ diff --git a/sound/core/seq/seq_dummy.c b/sound/core/seq/seq_dummy.c index 2e8844ee32ed..9308194b2d9a 100644 --- a/sound/core/seq/seq_dummy.c +++ b/sound/core/seq/seq_dummy.c @@ -152,6 +152,7 @@ static int __init register_client(void) { struct snd_seq_dummy_port *rec1, *rec2; + struct snd_seq_client *client; int i; if (ports < 1) { @@ -165,6 +166,13 @@ register_client(void) if (my_client < 0) return my_client; + /* don't convert events but just pass-through */ + client = snd_seq_kernel_client_get(my_client); + if (!client) + return -EINVAL; + client->filter = SNDRV_SEQ_FILTER_NO_CONVERT; + snd_seq_kernel_client_put(client); + /* create ports */ for (i = 0; i < ports; i++) { rec1 = create_port(i, 0); -- 2.35.3