Lines Matching +full:in +full:- +full:ports

1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * ALSA sequencer MIDI-through client
4 * Copyright (c) 1999-2000 by Takashi Iwai <tiwai@suse.de>
17 Sequencer MIDI-through client
19 This gives a simple midi-through client. All the normal input events
21 The routing can be done via aconnect program in alsa-utils.
24 If you want to auto-load this module, you may add the following alias
25 in your /etc/conf.modules file.
27 alias snd-seq-client-14 snd-seq-dummy
31 snd-seq-client-14 as "off". This will help modprobe.
33 The number of ports to be created can be specified via the module
34 parameter "ports". For example, to create four ports, add the
35 following option in a configuration file under /etc/modprobe.d/:
37 option snd-seq-dummy ports=4
40 In duplex mode, a pair of ports are created instead of single port,
41 and events are tunneled between pair-ports. For example, input to
43 In duplex mode, each port has DUPLEX capability.
49 MODULE_DESCRIPTION("ALSA sequencer MIDI-through client");
51 MODULE_ALIAS("snd-seq-client-" __stringify(SNDRV_SEQ_CLIENT_DUMMY));
53 static int ports = 1; variable
56 module_param(ports, int, 0444);
57 MODULE_PARM_DESC(ports, "number of ports to be created");
59 MODULE_PARM_DESC(duplex, "create DUPLEX ports");
74 static int my_client = -1;
77 * event input callback - just redirect events to subscribers
87 if (ev->source.client == SNDRV_SEQ_CLIENT_SYSTEM || in dummy_input()
88 ev->type == SNDRV_SEQ_EVENT_KERNEL_ERROR) in dummy_input()
91 if (p->duplex) in dummy_input()
92 tmpev.source.port = p->connect; in dummy_input()
94 tmpev.source.port = p->port; in dummy_input()
96 return snd_seq_kernel_client_dispatch(p->client, &tmpev, atomic, hop); in dummy_input()
122 rec->client = my_client; in create_port()
123 rec->duplex = duplex; in create_port()
124 rec->connect = 0; in create_port()
128 sprintf(pinfo.name, "Midi Through Port-%d:%c", idx, in create_port()
131 sprintf(pinfo.name, "Midi Through Port-%d", idx); in create_port()
150 rec->port = pinfo.addr.port; in create_port()
155 * register client and create ports
166 if (ports < 1) { in register_client()
167 pr_err("ALSA: seq_dummy: invalid number of ports %d\n", ports); in register_client()
168 return -EINVAL; in register_client()
180 return -EINVAL; in register_client()
183 client->midi_version = SNDRV_SEQ_CLIENT_UMP_MIDI_1_0; in register_client()
186 client->midi_version = SNDRV_SEQ_CLIENT_UMP_MIDI_2_0; in register_client()
189 /* don't convert events but just pass-through */ in register_client()
190 client->filter = SNDRV_SEQ_FILTER_NO_CONVERT; in register_client()
196 /* create ports */ in register_client()
197 for (i = 0; i < ports; i++) { in register_client()
201 return -ENOMEM; in register_client()
207 return -ENOMEM; in register_client()
209 rec1->connect = rec2->port; in register_client()
210 rec2->connect = rec1->port; in register_client()