xref: /linux/Documentation/sound/cards/serial-u16550.rst (revision 9095bf25ea08135a5b74875dd0e3eeaddc4218a0)
1*bb02859cSTakashi Iwai===================================
2*bb02859cSTakashi IwaiSerial UART 16450/16550 MIDI driver
3*bb02859cSTakashi Iwai===================================
4*bb02859cSTakashi Iwai
5*bb02859cSTakashi IwaiThe adaptor module parameter allows you to select either:
6*bb02859cSTakashi Iwai
7*bb02859cSTakashi Iwai* 0 - Roland Soundcanvas support (default)
8*bb02859cSTakashi Iwai* 1 - Midiator MS-124T support (1)
9*bb02859cSTakashi Iwai* 2 - Midiator MS-124W S/A mode (2)
10*bb02859cSTakashi Iwai* 3 - MS-124W M/B mode support (3)
11*bb02859cSTakashi Iwai* 4 - Generic device with multiple input support (4)
12*bb02859cSTakashi Iwai
13*bb02859cSTakashi IwaiFor the Midiator MS-124W, you must set the physical M-S and A-B
14*bb02859cSTakashi Iwaiswitches on the Midiator to match the driver mode you select.
15*bb02859cSTakashi Iwai
16*bb02859cSTakashi IwaiIn Roland Soundcanvas mode, multiple ALSA raw MIDI substreams are supported
17*bb02859cSTakashi Iwai(midiCnD0-midiCnD15).  Whenever you write to a different substream, the driver
18*bb02859cSTakashi Iwaisends the nonstandard MIDI command sequence F5 NN, where NN is the substream
19*bb02859cSTakashi Iwainumber plus 1.  Roland modules use this command to switch between different
20*bb02859cSTakashi Iwai"parts", so this feature lets you treat each part as a distinct raw MIDI
21*bb02859cSTakashi Iwaisubstream. The driver provides no way to send F5 00 (no selection) or to not
22*bb02859cSTakashi Iwaisend the F5 NN command sequence at all; perhaps it ought to.
23*bb02859cSTakashi Iwai
24*bb02859cSTakashi IwaiUsage example for simple serial converter:
25*bb02859cSTakashi Iwai::
26*bb02859cSTakashi Iwai
27*bb02859cSTakashi Iwai	/sbin/setserial /dev/ttyS0 uart none
28*bb02859cSTakashi Iwai	/sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 speed=115200
29*bb02859cSTakashi Iwai
30*bb02859cSTakashi IwaiUsage example for Roland SoundCanvas with 4 MIDI ports:
31*bb02859cSTakashi Iwai::
32*bb02859cSTakashi Iwai
33*bb02859cSTakashi Iwai	/sbin/setserial /dev/ttyS0 uart none
34*bb02859cSTakashi Iwai	/sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 outs=4
35*bb02859cSTakashi Iwai
36*bb02859cSTakashi IwaiIn MS-124T mode, one raw MIDI substream is supported (midiCnD0); the outs
37*bb02859cSTakashi Iwaimodule parameter is automatically set to 1. The driver sends the same data to
38*bb02859cSTakashi Iwaiall four MIDI Out connectors.  Set the A-B switch and the speed module
39*bb02859cSTakashi Iwaiparameter to match (A=19200, B=9600).
40*bb02859cSTakashi Iwai
41*bb02859cSTakashi IwaiUsage example for MS-124T, with A-B switch in A position:
42*bb02859cSTakashi Iwai::
43*bb02859cSTakashi Iwai
44*bb02859cSTakashi Iwai	/sbin/setserial /dev/ttyS0 uart none
45*bb02859cSTakashi Iwai	/sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=1 \
46*bb02859cSTakashi Iwai			speed=19200
47*bb02859cSTakashi Iwai
48*bb02859cSTakashi IwaiIn MS-124W S/A mode, one raw MIDI substream is supported (midiCnD0);
49*bb02859cSTakashi Iwaithe outs module parameter is automatically set to 1. The driver sends
50*bb02859cSTakashi Iwaithe same data to all four MIDI Out connectors at full MIDI speed.
51*bb02859cSTakashi Iwai
52*bb02859cSTakashi IwaiUsage example for S/A mode:
53*bb02859cSTakashi Iwai::
54*bb02859cSTakashi Iwai
55*bb02859cSTakashi Iwai	/sbin/setserial /dev/ttyS0 uart none
56*bb02859cSTakashi Iwai	/sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=2
57*bb02859cSTakashi Iwai
58*bb02859cSTakashi IwaiIn MS-124W M/B mode, the driver supports 16 ALSA raw MIDI substreams;
59*bb02859cSTakashi Iwaithe outs module parameter is automatically set to 16.  The substream
60*bb02859cSTakashi Iwainumber gives a bitmask of which MIDI Out connectors the data should be
61*bb02859cSTakashi Iwaisent to, with midiCnD1 sending to Out 1, midiCnD2 to Out 2, midiCnD4 to
62*bb02859cSTakashi IwaiOut 3, and midiCnD8 to Out 4.  Thus midiCnD15 sends the data to all 4 ports.
63*bb02859cSTakashi IwaiAs a special case, midiCnD0 also sends to all ports, since it is not useful
64*bb02859cSTakashi Iwaito send the data to no ports.  M/B mode has extra overhead to select the MIDI
65*bb02859cSTakashi IwaiOut for each byte, so the aggregate data rate across all four MIDI Outs is
66*bb02859cSTakashi Iwaiat most one byte every 520 us, as compared with the full MIDI data rate of
67*bb02859cSTakashi Iwaione byte every 320 us per port.
68*bb02859cSTakashi Iwai
69*bb02859cSTakashi IwaiUsage example for M/B mode:
70*bb02859cSTakashi Iwai::
71*bb02859cSTakashi Iwai
72*bb02859cSTakashi Iwai	/sbin/setserial /dev/ttyS0 uart none
73*bb02859cSTakashi Iwai	/sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=3
74*bb02859cSTakashi Iwai
75*bb02859cSTakashi IwaiThe MS-124W hardware's M/A mode is currently not supported. This mode allows
76*bb02859cSTakashi Iwaithe MIDI Outs to act independently at double the aggregate throughput of M/B,
77*bb02859cSTakashi Iwaibut does not allow sending the same byte simultaneously to multiple MIDI Outs.
78*bb02859cSTakashi IwaiThe M/A protocol requires the driver to twiddle the modem control lines under
79*bb02859cSTakashi Iwaitiming constraints, so it would be a bit more complicated to implement than
80*bb02859cSTakashi Iwaithe other modes.
81*bb02859cSTakashi Iwai
82*bb02859cSTakashi IwaiMidiator models other than MS-124W and MS-124T are currently not supported.
83*bb02859cSTakashi IwaiNote that the suffix letter is significant; the MS-124 and MS-124B are not
84*bb02859cSTakashi Iwaicompatible, nor are the other known models MS-101, MS-101B, MS-103, and MS-114.
85*bb02859cSTakashi IwaiI do have documentation (tim.mann@compaq.com) that partially covers these models,
86*bb02859cSTakashi Iwaibut no units to experiment with.  The MS-124W support is tested with a real unit.
87*bb02859cSTakashi IwaiThe MS-124T support is untested, but should work.
88*bb02859cSTakashi Iwai
89*bb02859cSTakashi IwaiThe Generic driver supports multiple input and output substreams over a single
90*bb02859cSTakashi Iwaiserial port.  Similar to Roland Soundcanvas mode, F5 NN is used to select the
91*bb02859cSTakashi Iwaiappropriate input or output stream (depending on the data direction).
92*bb02859cSTakashi IwaiAdditionally, the CTS signal is used to regulate the data flow.  The number of
93*bb02859cSTakashi Iwaiinputs is specified by the ins parameter.
94