1.\" $OpenBSD: aucat.1,v 1.101 2012/04/25 07:18:45 jmc Exp $ 2.\" 3.\" Copyright (c) 2006 Alexandre Ratchov <alex@caoua.org> 4.\" 5.\" Permission to use, copy, modify, and distribute this software for any 6.\" purpose with or without fee is hereby granted, provided that the above 7.\" copyright notice and this permission notice appear in all copies. 8.\" 9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16.\" 17.Dd $Mdocdate: April 25 2012 $ 18.Dt AUCAT 1 19.Os 20.Sh NAME 21.Nm aucat , 22.Nm sndiod 23.Nd audio/MIDI server and stream manipulation tool 24.Sh SYNOPSIS 25.Nm aucat 26.Bk -words 27.Op Fl dn 28.Op Fl b Ar nframes 29.Op Fl C Ar min : Ns Ar max 30.Op Fl c Ar min : Ns Ar max 31.Op Fl e Ar enc 32.Op Fl f Ar device 33.Op Fl h Ar fmt 34.Op Fl i Ar file 35.Op Fl j Ar flag 36.Op Fl m Ar mode 37.Op Fl o Ar file 38.Op Fl q Ar port 39.Op Fl r Ar rate 40.Op Fl t Ar mode 41.Op Fl v Ar volume 42.Op Fl w Ar flag 43.Op Fl x Ar policy 44.Op Fl z Ar nframes 45.Ek 46.Nm sndiod 47.Bk -words 48.Op Fl dM 49.Op Fl a Ar flag 50.Op Fl b Ar nframes 51.Op Fl C Ar min : Ns Ar max 52.Op Fl c Ar min : Ns Ar max 53.Op Fl e Ar enc 54.Op Fl f Ar device 55.Op Fl j Ar flag 56.Op Fl L Ar addr 57.Op Fl m Ar mode 58.Op Fl q Ar port 59.Op Fl r Ar rate 60.Op Fl s Ar name 61.Op Fl t Ar mode 62.Op Fl U Ar unit 63.Op Fl v Ar volume 64.Op Fl w Ar flag 65.Op Fl x Ar policy 66.Op Fl z Ar nframes 67.Ek 68.Sh DESCRIPTION 69The 70.Nm sndiod 71daemon is an intermediate layer between 72audio or MIDI programs and the hardware. 73It performs the necessary audio processing to 74allow any program to work on any supported hardware. 75By default, 76.Nm sndiod 77accepts connections from programs 78running on the same system only; 79it initializes only when programs are using its services, 80allowing 81.Nm sndiod 82to consume a negligible amount of system resources the rest of the time. 83Systems with no audio hardware can use 84.Nm sndiod 85to keep hot-pluggable devices usable by default at 86virtually no cost. 87.Pp 88.Nm sndiod 89operates as follows: it exposes at least one 90.Em sub-device 91that any number of audio programs can connect to and use as if it were 92audio hardware. 93During playback, 94.Nm sndiod 95receives audio data concurrently from all programs, mixes it and sends 96the result to the hardware device. 97Similarly, during recording it duplicates audio data recorded 98from the device and sends it to all programs. 99Since audio data flows through the 100.Nm sndiod 101process, it has the opportunity to process audio data on the fly: 102.Pp 103.Bl -bullet -offset indent -compact 104.It 105Change the sound encoding to overcome incompatibilities between 106software and hardware. 107.It 108Route the sound from one channel to another, 109join stereo or split mono. 110.It 111Control the per-application playback volume as well as the 112master volume. 113.It 114Monitor the sound being played, allowing one program to record 115what other programs play. 116.El 117.Pp 118Processing is configured on a per sub-device basis, meaning that 119the sound of all programs connected to the same sub-device will be 120processed according to the same configuration. 121Multiple sub-devices can be defined, allowing multiple configurations 122to coexist. 123The user selects the configuration a given program will use 124by selecting the sub-device the program uses. 125.Pp 126.Nm sndiod 127can expose a MIDI port that can be used as a MIDI thru box 128(aka a 129.Dq hub 130for MIDI messages), 131allowing any program to send MIDI messages to 132MIDI hardware or to another program in a uniform way. 133Hardware ports can be subscribed to such MIDI thru boxes, 134allowing multiple programs to share the MIDI port. 135.Pp 136Finally, 137.Nm sndiod 138exposes a control MIDI port usable for: 139.Pp 140.Bl -bullet -offset indent -compact 141.It 142Volume control. 143.It 144Common clock source for audio and MIDI programs. 145.It 146Start, stop and relocate groups of audio programs. 147.El 148.Pp 149The 150.Nm 151utility can play, record, mix, and convert regular audio files. 152It has the same processing capabilities as 153.Nm sndiod . 154Both operate the same way, except that the former processes audio data stored 155in files, while the latter processes audio data provided or consumed by 156programs. 157Instead of a list of sub-devices, 158.Nm 159is given a list of files to play or record. 160.Pp 161The options are as follows: 162.Bl -tag -width Ds 163.It Fl a Ar flag 164Control whether 165.Nm sndiod 166opens the audio device only when needed or keeps it open all the time. 167This applies to MIDI ports controlling the device as well. 168If the flag is 169.Va on 170then the device is kept open all the time, ensuring no other program can 171steal it. 172If the flag is 173.Va off , 174then it's automatically closed, allowing other programs to have direct 175access to the device, or the device to be disconnected. 176The default is 177.Va off , 178except for the default device. 179.It Fl b Ar nframes 180The buffer size of the audio device in frames. 181A frame consists of one sample for each channel in the stream. 182This is the number of frames that will be buffered before being played 183and thus controls the playback latency. 184The default is 7680 or twice the block size 185.Pq Fl z , 186if the block size is set. 187.It Xo 188.Fl C Ar min : Ns Ar max , 189.Fl c Ar min : Ns Ar max 190.Xc 191The range of stream channel numbers for recording and playback directions, 192respectively. 193The default is 0:1, i.e. stereo. 194.It Fl d 195Increase log verbosity. 196.Nm sndiod 197logs on 198.Em stderr 199until it daemonizes. 200.It Fl e Ar enc 201Encoding of the playback or recording stream (see below). 202The default is signed, 16-bit, native byte order. 203.It Fl f Ar device 204Add this 205.Xr sndio 7 206audio device to devices used for playing and/or recording. 207Preceding per-device options 208.Pq Fl abwz 209apply to this device. 210Streams 211.Pq Fl ios 212and control MIDI ports 213.Pq Fl q 214that are applied after will be attached to this device. 215Device mode and parameters are determined from streams 216attached to it. 217.It Fl h Ar fmt 218File format of the playback or record stream (see below). 219The default is auto. 220.It Fl i Ar file 221Add this file to the list of streams to play. 222If the option argument is 223.Sq - 224then standard input will be used. 225.It Fl j Ar flag 226Control whether stream channels are joined or expanded if 227the stream number of channels is not equal to the device number of channels. 228If the flag is 229.Va off 230then stream channels are routed to the corresponding 231device channel, possibly discarding channels not present in the device. 232If the flag is 233.Va on , 234then a single stream channel may be sent on multiple device channels, 235or multiple stream channels may be sent to a single device channel. 236For instance, this feature could be used to request mono streams to 237be sent on multiple outputs or to record a stereo input into a mono stream. 238The default is 239.Ar on . 240.It Fl L Ar addr 241Specify a local network address 242.Nm sndiod 243should listen; 244.Nm sndiod 245will listen on TCP port 11025+n, where n is the unit number 246specified with 247.Fl U . 248Without this option, 249.Nm sndiod 250listens on the 251.Ux Ns -domain 252socket only, and is not reachable from any network. 253If the option argument is 254.Sq - 255then 256.Nm sndiod 257will accept connections from any address. 258.It Fl M 259Create a MIDI thru box 260.Pq i.e. MIDI-only pseudo device . 261It merges any number of MIDI inputs and broadcasts the result 262to any number of MIDI outputs, similarly to a hardware MIDI thru box. 263Only MIDI ports 264.Pq Fl q 265and MIDI files 266.Po 267.Fl io 268preceded by 269.Fl m Ar midi 270.Pc 271can be attached to it. 272Exposed sub-devices by 273.Nm sndiod 274behave like software MIDI ports, 275allowing any MIDI-capable application to send MIDI messages to 276MIDI hardware or to another application in a uniform way. 277.It Fl m Ar mode 278Set the stream mode. 279Valid modes are 280.Ar play , 281.Ar rec , 282.Ar mon , 283and 284.Ar midi , 285corresponding to playback, recording, monitoring and MIDI control. 286A monitoring stream is a fake recording stream corresponding to 287the mix of all playback streams. 288Multiple modes can be specified, separated by commas, 289but the same stream cannot be used for both recording and monitoring. 290The default is 291.Ar play , Ns Ar rec , Ns Ar midi 292(i.e. full-duplex with MIDI control enabled). 293.It Fl n 294Create a loopback pseudo audio device. 295Send input streams 296to the output, processing them on the fly. 297This pseudo-device is useful to mix, demultiplex, resample or re-encode 298audio files offline. 299It requires at least one input 300.Pq Fl i 301and one output 302.Pq Fl o . 303.It Fl o Ar file 304Add this file to the list of recording streams. 305If the option argument is 306.Sq - 307then standard output will be used. 308.It Fl q Ar port 309Expose the audio device clock on this 310.Xr sndio 7 311MIDI port and allow audio device properties to be controlled 312through MIDI. 313This includes per-stream volumes and the ability to 314synchronously start, stop and relocate streams created in 315MIDI Machine 316Control (MMC) slave mode 317.Pq Fl t . 318.It Fl r Ar rate 319Sample rate in Hertz of the stream. 320The default is 48000. 321.It Fl s Ar name 322Add 323.Ar name 324to the list of sub-devices to expose. 325This allows clients to use 326.Nm sndiod 327instead of the physical audio device for audio input and output 328in order to share the physical device with other clients. 329Defining multiple sub-devices allows splitting a physical audio device 330into logical devices having different properties (e.g. channel ranges). 331The given 332.Ar name 333corresponds to the 334.Dq option 335part of the 336.Xr sndio 7 337device name string. 338.It Fl t Ar mode 339Select the way streams are controlled by MIDI Machine Control (MMC) 340messages. 341If the mode is 342.Va off 343(the default), then streams are not affected by MMC messages. 344If the mode is 345.Va slave , 346then streams are started synchronously by MMC start messages; 347additionally, the server clock is exposed as MIDI Time Code (MTC) 348messages allowing MTC-capable software or hardware to be synchronized 349to audio streams. 350.It Fl U Ar unit 351Unit number to use when running in server mode. 352Each 353.Nm sndiod 354server instance has an unique unit number, 355used in 356.Xr sndio 7 357device names. 358The default is 0. 359The unit number must be set before any 360.Fl L 361is used. 362.It Fl v Ar volume 363Software volume attenuation of the playback stream. 364The value must be between 1 and 127, 365corresponding to \-42dB and \-0dB attenuation in 1/3dB steps. 366In server mode, clients inherit this parameter. 367Reducing the volume in advance allows a client's volume to stay independent 368from the number of clients as long as their number is small enough. 36918 volume units (i.e. \-6dB attenuation) allows the number 370of playback streams to be doubled. 371The default is 127 i.e. no attenuation. 372.It Fl w Ar flag 373Control 374.Nm 375and 376.Nm sndiod 377behaviour when the maximum volume of the hardware is reached 378and a new stream is connected. 379This happens only when stream volumes 380are not properly set using the 381.Fl v 382option. 383If the flag is 384.Va on , 385then the master volume (corresponding to the mix of all playback streams) 386is automatically adjusted to avoid clipping. 387Using 388.Va off 389makes sense when all streams are recorded or produced with properly lowered 390volumes. 391The default is 392.Va on . 393.It Fl x Ar policy 394Action when the output stream cannot accept 395recorded data fast enough or the input stream 396cannot provide data to play fast enough. 397If the policy 398is 399.Dq ignore 400(the default) then samples that cannot be written are discarded 401and samples that cannot be read are replaced by silence. 402If the policy is 403.Dq sync 404then recorded samples are discarded, 405but the same amount of silence will be written 406once the stream is unblocked, in order to reach the right position in time. 407Similarly silence is played, but the same amount of samples will be discarded 408once the stream is unblocked. 409If the policy is 410.Dq error 411then the stream is closed permanently. 412.Pp 413If a stream is created with the 414.Fl t 415option, 416the 417.Dq ignore 418action is disabled for any stream connected to it 419to ensure proper synchronization. 420.It Fl z Ar nframes 421The audio device block size in frames. 422This is the number of frames between audio clock ticks, 423i.e. the clock resolution. 424If a stream is created with the 425.Fl t 426option, 427and MTC is used for synchronization, the clock 428resolution must be 96, 100 or 120 ticks per second for maximum 429accuracy. 430For instance, 100 ticks per second at 48000Hz corresponds 431to a 480 frame block size. 432The default is 960 or half of the buffer size 433.Pq Fl b , 434if the buffer size is set. 435.El 436.Pp 437On the command line, 438per-device parameters 439.Pq Fl abwz 440must precede the device definition 441.Pq Fl fMn , 442and per-stream parameters 443.Pq Fl Ccehjmrtvx 444must precede the stream definition 445.Pq Fl ios . 446MIDI ports 447.Pq Fl q 448and stream definitions 449.Pq Fl ios 450must follow the definition of the device 451.Pq Fl fMn 452to which they are attached. 453.Pp 454If no audio devices 455.Pq Fl fMn 456are specified, 457settings are applied as if 458the default device is specified. 459If no 460.Nm sndiod 461sub-devices 462.Pq Fl s 463are specified for a device, a default server sub-device is 464created attached to it. 465If a device 466.Pq Fl fMn 467is defined twice, both definitions are merged: 468parameters of the first one are used but streams 469.Pq Fl ios 470and MIDI control ports 471.Pq Fl q 472of both definitions are created. 473The default 474.Xr sndio 7 475device used by 476.Nm sndiod 477is 478.Pa rsnd/0 , 479and the default sub-device exposed by 480.Nm sndiod 481is 482.Pa snd/0 . 483.Pp 484If 485.Nm sndiod 486or 487.Nm aucat 488is sent 489.Dv SIGHUP , 490.Dv SIGINT 491or 492.Dv SIGTERM , 493it terminates recording to files. 494.Pp 495File formats are specified using the 496.Fl h 497option. 498The following file formats are supported: 499.Bl -tag -width s32lexxx -offset indent 500.It raw 501Headerless file. 502This format is recommended since it has no limitations. 503.It wav 504Microsoft WAVE file format. 505There are limitations inherent to the file format itself: 506not all encodings are supported, 507file sizes are limited to 2GB, 508and the file must support the 509.Xr lseek 2 510operation (e.g. pipes do not support it). 511.It auto 512Try to guess, depending on the file name. 513.El 514.Pp 515Encodings are specified using the 516.Fl e 517option. 518The following encodings are supported: 519.Pp 520.Bl -tag -width s32lexxx -offset indent -compact 521.It s8 522signed 8-bit 523.It u8 524unsigned 8-bit 525.It s16le 526signed 16-bit, little endian 527.It u16le 528unsigned 16-bit, little endian 529.It s16be 530signed 16-bit, big endian 531.It u16be 532unsigned 16-bit, big endian 533.It s24le 534signed 24-bit, stored in 4 bytes, little endian 535.It u24le 536unsigned 24-bit, stored in 4 bytes, little endian 537.It s24be 538signed 24-bit, stored in 4 bytes, big endian 539.It u24be 540unsigned 24-bit, stored in 4 bytes, big endian 541.It s32le 542signed 32-bit, little endian 543.It u32le 544unsigned 32-bit, little endian 545.It s32be 546signed 32-bit, big endian 547.It u32be 548unsigned 32-bit, big endian 549.It s24le3 550signed 24-bit, packed in 3 bytes, little endian 551.It u24le3 552unsigned 24-bit, packed in 3 bytes, big endian 553.It s24be3 554signed 24-bit, packed in 3 bytes, little endian 555.It u24be3 556unsigned 24-bit, packed in 3 bytes, big endian 557.It s20le3 558signed 20-bit, packed in 3 bytes, little endian 559.It u20le3 560unsigned 20-bit, packed in 3 bytes, big endian 561.It s20be3 562signed 20-bit, packed in 3 bytes, little endian 563.It u20be3 564unsigned 20-bit, packed in 3 bytes, big endian 565.It s18le3 566signed 18-bit, packed in 3 bytes, little endian 567.It u18le3 568unsigned 18-bit, packed in 3 bytes, big endian 569.It s18be3 570signed 18-bit, packed in 3 bytes, little endian 571.It u18be3 572unsigned 18-bit, packed in 3 bytes, big endian 573.El 574.Sh SERVER MODE 575.Nm sndiod 576can be used 577to overcome hardware limitations and allow applications 578to run on fixed sample rate devices or on devices 579supporting only unusual encodings. 580.Pp 581Certain applications, such as synthesis software, 582require a low latency audio setup. 583To reduce the probability of buffer underruns or overruns, especially 584on busy machines, the server can be started by the super-user, in which 585case it will run with higher priority. 586Any user will still be able to connect to it, 587but for privacy reasons only one user may have 588connections to it at a given time. 589.Sh MIDI CONTROL 590.Nm 591can expose the audio device clock on registered 592MIDI ports 593.Pq Fl q 594and allows audio device properties to be controlled 595through MIDI. 596Additionally, 597.Nm sndiod 598creates a MIDI port with the same name as the exposed audio 599sub-device to which MIDI programs can connect. 600.Pp 601A MIDI channel is assigned to each stream, and the volume 602is changed using the standard volume controller (number 7). 603Similarly, when the audio client changes its volume, 604the same MIDI controller message is sent out; it can be used 605for instance for monitoring or as feedback for motorized 606faders. 607.Pp 608The master volume can be changed using the standard master volume 609system exclusive message. 610.Pp 611Streams created with the 612.Fl t 613option are controlled by the following MMC messages: 614.Bl -tag -width relocateXXX -offset indent 615.It relocate 616Streams are relocated to the requested time position 617relative to the beginning of the stream, at which playback 618and recording must start. 619If the requested position is beyond the end of file, 620the stream is temporarly disabled until a valid position is requested. 621This message is ignored by audio 622.Nm sndiod 623clients, but the given time position is sent to MIDI ports as an MTC 624.Dq "full frame" 625message forcing all MTC-slaves to relocate to the given 626position (see below). 627.It start 628Put all streams in starting mode. 629In this mode, 630.Nm sndiod 631or 632.Nm aucat 633waits for all streams to become ready 634to start, and then starts them synchronously. 635Once started, new streams can be created 636.Pq Nm sndiod 637but they will be blocked 638until the next stop-to-start transition. 639.It stop 640Put all streams in stopped mode (the default). 641In this mode, any stream attempting to start playback or recording 642is paused. 643Files 644.Pq Nm aucat 645are stopped and rewound back to the starting position, 646while client streams 647.Pq Nm sndiod 648that are already 649started are not affected until they stop and try to start again. 650.El 651.Pp 652Streams created with the 653.Fl t 654option export the 655.Nm sndiod 656device clock using MTC, allowing non-audio 657software or hardware to be synchronized to the audio stream. 658Maximum accuracy is achieved when the number of blocks per 659second is equal to one of the standard MTC clock rates (96, 100 and 120Hz). 660The following sample rates 661.Pq Fl r 662and block sizes 663.Pq Fl z 664are recommended: 665.Pp 666.Bl -bullet -offset indent -compact 667.It 66844100Hz, 441 frames (MTC rate is 100Hz) 669.It 67048000Hz, 400 frames (MTC rate is 120Hz) 671.It 67248000Hz, 480 frames (MTC rate is 100Hz) 673.It 67448000Hz, 500 frames (MTC rate is 96Hz) 675.El 676.Pp 677For instance, the following command will create two devices: 678the default 679.Va snd/0 680and a MIDI-controlled 681.Va snd/0.mmc : 682.Bd -literal -offset indent 683$ sndiod -r 48000 -z 400 -s default -t slave -s mmc 684.Ed 685.Pp 686Streams connected to 687.Va snd/0 688behave normally, while streams connected to 689.Va snd/0.mmc 690wait for the MMC start signal and start synchronously. 691Regardless of which device a stream is connected to, 692its playback volume knob is exposed. 693.Pp 694For instance, the following command will play a file on the 695.Va snd/0.mmc 696audio device, and give full control to MIDI software or hardware 697connected to the 698.Va snd/0.thru 699MIDI port: 700.Bd -literal -offset indent 701$ aucat -f snd/0.mmc -t slave -q midithru/0 -i file.wav 702.Ed 703.Pp 704At this stage, 705.Nm 706will start, stop and relocate automatically following all user 707actions in the MIDI sequencer. 708Note that the sequencer must use 709.Va snd/0 710as the MTC source, i.e. the audio server, not the audio player. 711.Sh ENVIRONMENT 712.Bl -tag -width "AUCAT_COOKIE" -compact 713.It Ev AUCAT_COOKIE 714File containing user's session cookie. 715.It Ev AUDIODEVICE 716.Xr sndio 7 717audio device to use if the 718.Fl f 719option is not specified. 720.El 721.Sh EXAMPLES 722Mix and play two stereo streams, 723the first at 48kHz and the second at 44.1kHz: 724.Bd -literal -offset indent 725$ aucat -r 48000 -i file1.raw -r 44100 -i file2.raw 726.Ed 727.Pp 728Record channels 2 and 3 into one stereo file and 729channels 6 and 7 into another stereo file using a 96kHz sampling rate for 730both: 731.Bd -literal -offset indent 732$ aucat -j off -r 96000 -C 2:3 -o file1.raw -C 6:7 -o file2.raw 733.Ed 734.Pp 735Split a stereo file into two mono files: 736.Bd -literal -offset indent 737$ aucat -n -j off -i stereo.wav -C 0:0 -o left.wav -C 1:1 \e 738 -o right.wav 739.Ed 740.Pp 741Start server using default parameters, creating an 742additional sub-device for output to channels 2:3 only (rear speakers 743on most cards), exposing the 744.Pa snd/0 745and 746.Pa snd/0.rear 747devices: 748.Bd -literal -offset indent 749$ sndiod -s default -c 2:3 -s rear 750.Ed 751.Pp 752Start server creating the default sub-device with low volume and 753an additional sub-device for high volume output, exposing the 754.Pa snd/0 755and 756.Pa snd/0.max 757devices: 758.Bd -literal -offset indent 759$ sndiod -v 65 -s default -v 127 -s max 760.Ed 761.Pp 762Start server configuring the audio device to use 763a 48kHz sample frequency, 240-frame block size, 764and 2-block buffers. 765The corresponding latency is 10ms, which is 766the time it takes the sound to propagate 3.5 meters. 767.Bd -literal -offset indent 768$ sndiod -r 48000 -b 480 -z 240 769.Ed 770.Sh SEE ALSO 771.Xr audioctl 1 , 772.Xr cdio 1 , 773.Xr mixerctl 1 , 774.Xr audio 4 , 775.Xr sndio 7 776.Sh BUGS 777The 778.Nm 779utility assumes non-blocking I/O for input and output streams. 780It will not work reliably on files that may block 781(ordinary files block, pipes don't). 782To avoid audio underruns/overruns or MIDI jitter caused by file I/O, 783it's recommended to use two processes: a 784.Nm sndiod 785server handling audio and MIDI I/O and a 786.Nm 787client handling disk I/O. 788.Pp 789Resampling is low quality; down-sampling especially should be avoided 790when recording. 791.Pp 792Processing is done using 16-bit arithmetic, 793thus samples with more than 16 bits are rounded. 79416 bits (i.e. 97dB dynamic) are largely enough for most applications though. 795.Pp 796If 797.Fl a Ar off 798is used, 799.Nm sndiod 800creates sub-devices to expose first 801and then opens the audio hardware on demand. 802Technically, this allows 803.Nm sndiod 804to attempt to use one of the sub-devices it exposes as an audio device, 805creating a deadlock. 806To avoid this, 807.Fl a Ar off 808is disabled for the default audio device, but nothing prevents the user 809from shooting himself in the foot by creating a similar deadlock. 810.Pp 811The ability to merge multiple inputs is provided to allow multiple 812applications producing MIDI data to keep their connection open while 813idling; it does not replace a fully featured MIDI merger. 814