18c2ecf20Sopenharmony_ci=============================== 28c2ecf20Sopenharmony_ciOSS Sequencer Emulation on ALSA 38c2ecf20Sopenharmony_ci=============================== 48c2ecf20Sopenharmony_ci 58c2ecf20Sopenharmony_ciCopyright (c) 1998,1999 by Takashi Iwai 68c2ecf20Sopenharmony_ci 78c2ecf20Sopenharmony_civer.0.1.8; Nov. 16, 1999 88c2ecf20Sopenharmony_ci 98c2ecf20Sopenharmony_ciDescription 108c2ecf20Sopenharmony_ci=========== 118c2ecf20Sopenharmony_ci 128c2ecf20Sopenharmony_ciThis directory contains the OSS sequencer emulation driver on ALSA. Note 138c2ecf20Sopenharmony_cithat this program is still in the development state. 148c2ecf20Sopenharmony_ci 158c2ecf20Sopenharmony_ciWhat this does - it provides the emulation of the OSS sequencer, access 168c2ecf20Sopenharmony_civia ``/dev/sequencer`` and ``/dev/music`` devices. 178c2ecf20Sopenharmony_ciThe most of applications using OSS can run if the appropriate ALSA 188c2ecf20Sopenharmony_cisequencer is prepared. 198c2ecf20Sopenharmony_ci 208c2ecf20Sopenharmony_ciThe following features are emulated by this driver: 218c2ecf20Sopenharmony_ci 228c2ecf20Sopenharmony_ci* Normal sequencer and MIDI events: 238c2ecf20Sopenharmony_ci 248c2ecf20Sopenharmony_ci They are converted to the ALSA sequencer events, and sent to the 258c2ecf20Sopenharmony_ci corresponding port. 268c2ecf20Sopenharmony_ci 278c2ecf20Sopenharmony_ci* Timer events: 288c2ecf20Sopenharmony_ci 298c2ecf20Sopenharmony_ci The timer is not selectable by ioctl. The control rate is fixed to 308c2ecf20Sopenharmony_ci 100 regardless of HZ. That is, even on Alpha system, a tick is always 318c2ecf20Sopenharmony_ci 1/100 second. The base rate and tempo can be changed in ``/dev/music``. 328c2ecf20Sopenharmony_ci 338c2ecf20Sopenharmony_ci* Patch loading: 348c2ecf20Sopenharmony_ci 358c2ecf20Sopenharmony_ci It purely depends on the synth drivers whether it's supported since 368c2ecf20Sopenharmony_ci the patch loading is realized by callback to the synth driver. 378c2ecf20Sopenharmony_ci 388c2ecf20Sopenharmony_ci* I/O controls: 398c2ecf20Sopenharmony_ci 408c2ecf20Sopenharmony_ci Most of controls are accepted. Some controls 418c2ecf20Sopenharmony_ci are dependent on the synth driver, as well as even on original OSS. 428c2ecf20Sopenharmony_ci 438c2ecf20Sopenharmony_ciFurthermore, you can find the following advanced features: 448c2ecf20Sopenharmony_ci 458c2ecf20Sopenharmony_ci* Better queue mechanism: 468c2ecf20Sopenharmony_ci 478c2ecf20Sopenharmony_ci The events are queued before processing them. 488c2ecf20Sopenharmony_ci 498c2ecf20Sopenharmony_ci* Multiple applications: 508c2ecf20Sopenharmony_ci 518c2ecf20Sopenharmony_ci You can run two or more applications simultaneously (even for OSS 528c2ecf20Sopenharmony_ci sequencer)! 538c2ecf20Sopenharmony_ci However, each MIDI device is exclusive - that is, if a MIDI device 548c2ecf20Sopenharmony_ci is opened once by some application, other applications can't use 558c2ecf20Sopenharmony_ci it. No such a restriction in synth devices. 568c2ecf20Sopenharmony_ci 578c2ecf20Sopenharmony_ci* Real-time event processing: 588c2ecf20Sopenharmony_ci 598c2ecf20Sopenharmony_ci The events can be processed in real time without using out of bound 608c2ecf20Sopenharmony_ci ioctl. To switch to real-time mode, send ABSTIME 0 event. The followed 618c2ecf20Sopenharmony_ci events will be processed in real-time without queued. To switch off the 628c2ecf20Sopenharmony_ci real-time mode, send RELTIME 0 event. 638c2ecf20Sopenharmony_ci 648c2ecf20Sopenharmony_ci* ``/proc`` interface: 658c2ecf20Sopenharmony_ci 668c2ecf20Sopenharmony_ci The status of applications and devices can be shown via 678c2ecf20Sopenharmony_ci ``/proc/asound/seq/oss`` at any time. In the later version, 688c2ecf20Sopenharmony_ci configuration will be changed via ``/proc`` interface, too. 698c2ecf20Sopenharmony_ci 708c2ecf20Sopenharmony_ci 718c2ecf20Sopenharmony_ciInstallation 728c2ecf20Sopenharmony_ci============ 738c2ecf20Sopenharmony_ci 748c2ecf20Sopenharmony_ciRun configure script with both sequencer support (``--with-sequencer=yes``) 758c2ecf20Sopenharmony_ciand OSS emulation (``--with-oss=yes``) options. A module ``snd-seq-oss.o`` 768c2ecf20Sopenharmony_ciwill be created. If the synth module of your sound card supports for OSS 778c2ecf20Sopenharmony_ciemulation (so far, only Emu8000 driver), this module will be loaded 788c2ecf20Sopenharmony_ciautomatically. 798c2ecf20Sopenharmony_ciOtherwise, you need to load this module manually. 808c2ecf20Sopenharmony_ci 818c2ecf20Sopenharmony_ciAt beginning, this module probes all the MIDI ports which have been 828c2ecf20Sopenharmony_cialready connected to the sequencer. Once after that, the creation and deletion 838c2ecf20Sopenharmony_ciof ports are watched by announcement mechanism of ALSA sequencer. 848c2ecf20Sopenharmony_ci 858c2ecf20Sopenharmony_ciThe available synth and MIDI devices can be found in proc interface. 868c2ecf20Sopenharmony_ciRun ``cat /proc/asound/seq/oss``, and check the devices. For example, 878c2ecf20Sopenharmony_ciif you use an AWE64 card, you'll see like the following: 888c2ecf20Sopenharmony_ci:: 898c2ecf20Sopenharmony_ci 908c2ecf20Sopenharmony_ci OSS sequencer emulation version 0.1.8 918c2ecf20Sopenharmony_ci ALSA client number 63 928c2ecf20Sopenharmony_ci ALSA receiver port 0 938c2ecf20Sopenharmony_ci 948c2ecf20Sopenharmony_ci Number of applications: 0 958c2ecf20Sopenharmony_ci 968c2ecf20Sopenharmony_ci Number of synth devices: 1 978c2ecf20Sopenharmony_ci synth 0: [EMU8000] 988c2ecf20Sopenharmony_ci type 0x1 : subtype 0x20 : voices 32 998c2ecf20Sopenharmony_ci capabilties : ioctl enabled / load_patch enabled 1008c2ecf20Sopenharmony_ci 1018c2ecf20Sopenharmony_ci Number of MIDI devices: 3 1028c2ecf20Sopenharmony_ci midi 0: [Emu8000 Port-0] ALSA port 65:0 1038c2ecf20Sopenharmony_ci capability write / opened none 1048c2ecf20Sopenharmony_ci 1058c2ecf20Sopenharmony_ci midi 1: [Emu8000 Port-1] ALSA port 65:1 1068c2ecf20Sopenharmony_ci capability write / opened none 1078c2ecf20Sopenharmony_ci 1088c2ecf20Sopenharmony_ci midi 2: [0: MPU-401 (UART)] ALSA port 64:0 1098c2ecf20Sopenharmony_ci capability read/write / opened none 1108c2ecf20Sopenharmony_ci 1118c2ecf20Sopenharmony_ciNote that the device number may be different from the information of 1128c2ecf20Sopenharmony_ci``/proc/asound/oss-devices`` or ones of the original OSS driver. 1138c2ecf20Sopenharmony_ciUse the device number listed in ``/proc/asound/seq/oss`` 1148c2ecf20Sopenharmony_cito play via OSS sequencer emulation. 1158c2ecf20Sopenharmony_ci 1168c2ecf20Sopenharmony_ciUsing Synthesizer Devices 1178c2ecf20Sopenharmony_ci========================= 1188c2ecf20Sopenharmony_ci 1198c2ecf20Sopenharmony_ciRun your favorite program. I've tested playmidi-2.4, awemidi-0.4.3, gmod-3.1 1208c2ecf20Sopenharmony_ciand xmp-1.1.5. You can load samples via ``/dev/sequencer`` like sfxload, 1218c2ecf20Sopenharmony_citoo. 1228c2ecf20Sopenharmony_ci 1238c2ecf20Sopenharmony_ciIf the lowlevel driver supports multiple access to synth devices (like 1248c2ecf20Sopenharmony_ciEmu8000 driver), two or more applications are allowed to run at the same 1258c2ecf20Sopenharmony_citime. 1268c2ecf20Sopenharmony_ci 1278c2ecf20Sopenharmony_ciUsing MIDI Devices 1288c2ecf20Sopenharmony_ci================== 1298c2ecf20Sopenharmony_ci 1308c2ecf20Sopenharmony_ciSo far, only MIDI output was tested. MIDI input was not checked at all, 1318c2ecf20Sopenharmony_cibut hopefully it will work. Use the device number listed in 1328c2ecf20Sopenharmony_ci``/proc/asound/seq/oss``. 1338c2ecf20Sopenharmony_ciBe aware that these numbers are mostly different from the list in 1348c2ecf20Sopenharmony_ci``/proc/asound/oss-devices``. 1358c2ecf20Sopenharmony_ci 1368c2ecf20Sopenharmony_ciModule Options 1378c2ecf20Sopenharmony_ci============== 1388c2ecf20Sopenharmony_ci 1398c2ecf20Sopenharmony_ciThe following module options are available: 1408c2ecf20Sopenharmony_ci 1418c2ecf20Sopenharmony_cimaxqlen 1428c2ecf20Sopenharmony_ci specifies the maximum read/write queue length. This queue is private 1438c2ecf20Sopenharmony_ci for OSS sequencer, so that it is independent from the queue length of ALSA 1448c2ecf20Sopenharmony_ci sequencer. Default value is 1024. 1458c2ecf20Sopenharmony_ci 1468c2ecf20Sopenharmony_ciseq_oss_debug 1478c2ecf20Sopenharmony_ci specifies the debug level and accepts zero (= no debug message) or 1488c2ecf20Sopenharmony_ci positive integer. Default value is 0. 1498c2ecf20Sopenharmony_ci 1508c2ecf20Sopenharmony_ciQueue Mechanism 1518c2ecf20Sopenharmony_ci=============== 1528c2ecf20Sopenharmony_ci 1538c2ecf20Sopenharmony_ciOSS sequencer emulation uses an ALSA priority queue. The 1548c2ecf20Sopenharmony_cievents from ``/dev/sequencer`` are processed and put onto the queue 1558c2ecf20Sopenharmony_cispecified by module option. 1568c2ecf20Sopenharmony_ci 1578c2ecf20Sopenharmony_ciAll the events from ``/dev/sequencer`` are parsed at beginning. 1588c2ecf20Sopenharmony_ciThe timing events are also parsed at this moment, so that the events may 1598c2ecf20Sopenharmony_cibe processed in real-time. Sending an event ABSTIME 0 switches the operation 1608c2ecf20Sopenharmony_cimode to real-time mode, and sending an event RELTIME 0 switches it off. 1618c2ecf20Sopenharmony_ciIn the real-time mode, all events are dispatched immediately. 1628c2ecf20Sopenharmony_ci 1638c2ecf20Sopenharmony_ciThe queued events are dispatched to the corresponding ALSA sequencer 1648c2ecf20Sopenharmony_ciports after scheduled time by ALSA sequencer dispatcher. 1658c2ecf20Sopenharmony_ci 1668c2ecf20Sopenharmony_ciIf the write-queue is full, the application sleeps until a certain amount 1678c2ecf20Sopenharmony_ci(as default one half) becomes empty in blocking mode. The synchronization 1688c2ecf20Sopenharmony_cito write timing was implemented, too. 1698c2ecf20Sopenharmony_ci 1708c2ecf20Sopenharmony_ciThe input from MIDI devices or echo-back events are stored on read FIFO 1718c2ecf20Sopenharmony_ciqueue. If application reads ``/dev/sequencer`` in blocking mode, the 1728c2ecf20Sopenharmony_ciprocess will be awaked. 1738c2ecf20Sopenharmony_ci 1748c2ecf20Sopenharmony_ciInterface to Synthesizer Device 1758c2ecf20Sopenharmony_ci=============================== 1768c2ecf20Sopenharmony_ci 1778c2ecf20Sopenharmony_ciRegistration 1788c2ecf20Sopenharmony_ci------------ 1798c2ecf20Sopenharmony_ci 1808c2ecf20Sopenharmony_ciTo register an OSS synthesizer device, use snd_seq_oss_synth_register() 1818c2ecf20Sopenharmony_cifunction: 1828c2ecf20Sopenharmony_ci:: 1838c2ecf20Sopenharmony_ci 1848c2ecf20Sopenharmony_ci int snd_seq_oss_synth_register(char *name, int type, int subtype, int nvoices, 1858c2ecf20Sopenharmony_ci snd_seq_oss_callback_t *oper, void *private_data) 1868c2ecf20Sopenharmony_ci 1878c2ecf20Sopenharmony_ciThe arguments ``name``, ``type``, ``subtype`` and ``nvoices`` 1888c2ecf20Sopenharmony_ciare used for making the appropriate synth_info structure for ioctl. The 1898c2ecf20Sopenharmony_cireturn value is an index number of this device. This index must be remembered 1908c2ecf20Sopenharmony_cifor unregister. If registration is failed, -errno will be returned. 1918c2ecf20Sopenharmony_ci 1928c2ecf20Sopenharmony_ciTo release this device, call snd_seq_oss_synth_unregister() function: 1938c2ecf20Sopenharmony_ci:: 1948c2ecf20Sopenharmony_ci 1958c2ecf20Sopenharmony_ci int snd_seq_oss_synth_unregister(int index) 1968c2ecf20Sopenharmony_ci 1978c2ecf20Sopenharmony_ciwhere the ``index`` is the index number returned by register function. 1988c2ecf20Sopenharmony_ci 1998c2ecf20Sopenharmony_ciCallbacks 2008c2ecf20Sopenharmony_ci--------- 2018c2ecf20Sopenharmony_ci 2028c2ecf20Sopenharmony_ciOSS synthesizer devices have capability for sample downloading and ioctls 2038c2ecf20Sopenharmony_cilike sample reset. In OSS emulation, these special features are realized 2048c2ecf20Sopenharmony_ciby using callbacks. The registration argument oper is used to specify these 2058c2ecf20Sopenharmony_cicallbacks. The following callback functions must be defined: 2068c2ecf20Sopenharmony_ci:: 2078c2ecf20Sopenharmony_ci 2088c2ecf20Sopenharmony_ci snd_seq_oss_callback_t: 2098c2ecf20Sopenharmony_ci int (*open)(snd_seq_oss_arg_t *p, void *closure); 2108c2ecf20Sopenharmony_ci int (*close)(snd_seq_oss_arg_t *p); 2118c2ecf20Sopenharmony_ci int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg); 2128c2ecf20Sopenharmony_ci int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char *buf, int offs, int count); 2138c2ecf20Sopenharmony_ci int (*reset)(snd_seq_oss_arg_t *p); 2148c2ecf20Sopenharmony_ci 2158c2ecf20Sopenharmony_ciExcept for ``open`` and ``close`` callbacks, they are allowed to be NULL. 2168c2ecf20Sopenharmony_ci 2178c2ecf20Sopenharmony_ciEach callback function takes the argument type ``snd_seq_oss_arg_t`` as the 2188c2ecf20Sopenharmony_cifirst argument. 2198c2ecf20Sopenharmony_ci:: 2208c2ecf20Sopenharmony_ci 2218c2ecf20Sopenharmony_ci struct snd_seq_oss_arg_t { 2228c2ecf20Sopenharmony_ci int app_index; 2238c2ecf20Sopenharmony_ci int file_mode; 2248c2ecf20Sopenharmony_ci int seq_mode; 2258c2ecf20Sopenharmony_ci snd_seq_addr_t addr; 2268c2ecf20Sopenharmony_ci void *private_data; 2278c2ecf20Sopenharmony_ci int event_passing; 2288c2ecf20Sopenharmony_ci }; 2298c2ecf20Sopenharmony_ci 2308c2ecf20Sopenharmony_ciThe first three fields, ``app_index``, ``file_mode`` and ``seq_mode`` 2318c2ecf20Sopenharmony_ciare initialized by OSS sequencer. The ``app_index`` is the application 2328c2ecf20Sopenharmony_ciindex which is unique to each application opening OSS sequencer. The 2338c2ecf20Sopenharmony_ci``file_mode`` is bit-flags indicating the file operation mode. See 2348c2ecf20Sopenharmony_ci``seq_oss.h`` for its meaning. The ``seq_mode`` is sequencer operation 2358c2ecf20Sopenharmony_cimode. In the current version, only ``SND_OSSSEQ_MODE_SYNTH`` is used. 2368c2ecf20Sopenharmony_ci 2378c2ecf20Sopenharmony_ciThe next two fields, ``addr`` and ``private_data``, must be 2388c2ecf20Sopenharmony_cifilled by the synth driver at open callback. The ``addr`` contains 2398c2ecf20Sopenharmony_cithe address of ALSA sequencer port which is assigned to this device. If 2408c2ecf20Sopenharmony_cithe driver allocates memory for ``private_data``, it must be released 2418c2ecf20Sopenharmony_ciin close callback by itself. 2428c2ecf20Sopenharmony_ci 2438c2ecf20Sopenharmony_ciThe last field, ``event_passing``, indicates how to translate note-on 2448c2ecf20Sopenharmony_ci/ off events. In ``PROCESS_EVENTS`` mode, the note 255 is regarded 2458c2ecf20Sopenharmony_cias velocity change, and key pressure event is passed to the port. In 2468c2ecf20Sopenharmony_ci``PASS_EVENTS`` mode, all note on/off events are passed to the port 2478c2ecf20Sopenharmony_ciwithout modified. ``PROCESS_KEYPRESS`` mode checks the note above 128 2488c2ecf20Sopenharmony_ciand regards it as key pressure event (mainly for Emu8000 driver). 2498c2ecf20Sopenharmony_ci 2508c2ecf20Sopenharmony_ciOpen Callback 2518c2ecf20Sopenharmony_ci------------- 2528c2ecf20Sopenharmony_ci 2538c2ecf20Sopenharmony_ciThe ``open`` is called at each time this device is opened by an application 2548c2ecf20Sopenharmony_ciusing OSS sequencer. This must not be NULL. Typically, the open callback 2558c2ecf20Sopenharmony_cidoes the following procedure: 2568c2ecf20Sopenharmony_ci 2578c2ecf20Sopenharmony_ci#. Allocate private data record. 2588c2ecf20Sopenharmony_ci#. Create an ALSA sequencer port. 2598c2ecf20Sopenharmony_ci#. Set the new port address on ``arg->addr``. 2608c2ecf20Sopenharmony_ci#. Set the private data record pointer on ``arg->private_data``. 2618c2ecf20Sopenharmony_ci 2628c2ecf20Sopenharmony_ciNote that the type bit-flags in port_info of this synth port must NOT contain 2638c2ecf20Sopenharmony_ci``TYPE_MIDI_GENERIC`` 2648c2ecf20Sopenharmony_cibit. Instead, ``TYPE_SPECIFIC`` should be used. Also, ``CAP_SUBSCRIPTION`` 2658c2ecf20Sopenharmony_cibit should NOT be included, too. This is necessary to tell it from other 2668c2ecf20Sopenharmony_cinormal MIDI devices. If the open procedure succeeded, return zero. Otherwise, 2678c2ecf20Sopenharmony_cireturn -errno. 2688c2ecf20Sopenharmony_ci 2698c2ecf20Sopenharmony_ciIoctl Callback 2708c2ecf20Sopenharmony_ci-------------- 2718c2ecf20Sopenharmony_ci 2728c2ecf20Sopenharmony_ciThe ``ioctl`` callback is called when the sequencer receives device-specific 2738c2ecf20Sopenharmony_ciioctls. The following two ioctls should be processed by this callback: 2748c2ecf20Sopenharmony_ci 2758c2ecf20Sopenharmony_ciIOCTL_SEQ_RESET_SAMPLES 2768c2ecf20Sopenharmony_ci reset all samples on memory -- return 0 2778c2ecf20Sopenharmony_ci 2788c2ecf20Sopenharmony_ciIOCTL_SYNTH_MEMAVL 2798c2ecf20Sopenharmony_ci return the available memory size 2808c2ecf20Sopenharmony_ci 2818c2ecf20Sopenharmony_ciFM_4OP_ENABLE 2828c2ecf20Sopenharmony_ci can be ignored usually 2838c2ecf20Sopenharmony_ci 2848c2ecf20Sopenharmony_ciThe other ioctls are processed inside the sequencer without passing to 2858c2ecf20Sopenharmony_cithe lowlevel driver. 2868c2ecf20Sopenharmony_ci 2878c2ecf20Sopenharmony_ciLoad_Patch Callback 2888c2ecf20Sopenharmony_ci------------------- 2898c2ecf20Sopenharmony_ci 2908c2ecf20Sopenharmony_ciThe ``load_patch`` callback is used for sample-downloading. This callback 2918c2ecf20Sopenharmony_cimust read the data on user-space and transfer to each device. Return 0 2928c2ecf20Sopenharmony_ciif succeeded, and -errno if failed. The format argument is the patch key 2938c2ecf20Sopenharmony_ciin patch_info record. The buf is user-space pointer where patch_info record 2948c2ecf20Sopenharmony_ciis stored. The offs can be ignored. The count is total data size of this 2958c2ecf20Sopenharmony_cisample data. 2968c2ecf20Sopenharmony_ci 2978c2ecf20Sopenharmony_ciClose Callback 2988c2ecf20Sopenharmony_ci-------------- 2998c2ecf20Sopenharmony_ci 3008c2ecf20Sopenharmony_ciThe ``close`` callback is called when this device is closed by the 3018c2ecf20Sopenharmony_ciapplication. If any private data was allocated in open callback, it must 3028c2ecf20Sopenharmony_cibe released in the close callback. The deletion of ALSA port should be 3038c2ecf20Sopenharmony_cidone here, too. This callback must not be NULL. 3048c2ecf20Sopenharmony_ci 3058c2ecf20Sopenharmony_ciReset Callback 3068c2ecf20Sopenharmony_ci-------------- 3078c2ecf20Sopenharmony_ci 3088c2ecf20Sopenharmony_ciThe ``reset`` callback is called when sequencer device is reset or 3098c2ecf20Sopenharmony_ciclosed by applications. The callback should turn off the sounds on the 3108c2ecf20Sopenharmony_cirelevant port immediately, and initialize the status of the port. If this 3118c2ecf20Sopenharmony_cicallback is undefined, OSS seq sends a ``HEARTBEAT`` event to the 3128c2ecf20Sopenharmony_ciport. 3138c2ecf20Sopenharmony_ci 3148c2ecf20Sopenharmony_ciEvents 3158c2ecf20Sopenharmony_ci====== 3168c2ecf20Sopenharmony_ci 3178c2ecf20Sopenharmony_ciMost of the events are processed by sequencer and translated to the adequate 3188c2ecf20Sopenharmony_ciALSA sequencer events, so that each synth device can receive by input_event 3198c2ecf20Sopenharmony_cicallback of ALSA sequencer port. The following ALSA events should be 3208c2ecf20Sopenharmony_ciimplemented by the driver: 3218c2ecf20Sopenharmony_ci 3228c2ecf20Sopenharmony_ci============= =================== 3238c2ecf20Sopenharmony_ciALSA event Original OSS events 3248c2ecf20Sopenharmony_ci============= =================== 3258c2ecf20Sopenharmony_ciNOTEON SEQ_NOTEON, MIDI_NOTEON 3268c2ecf20Sopenharmony_ciNOTE SEQ_NOTEOFF, MIDI_NOTEOFF 3278c2ecf20Sopenharmony_ciKEYPRESS MIDI_KEY_PRESSURE 3288c2ecf20Sopenharmony_ciCHANPRESS SEQ_AFTERTOUCH, MIDI_CHN_PRESSURE 3298c2ecf20Sopenharmony_ciPGMCHANGE SEQ_PGMCHANGE, MIDI_PGM_CHANGE 3308c2ecf20Sopenharmony_ciPITCHBEND SEQ_CONTROLLER(CTRL_PITCH_BENDER), 3318c2ecf20Sopenharmony_ci MIDI_PITCH_BEND 3328c2ecf20Sopenharmony_ciCONTROLLER MIDI_CTL_CHANGE, 3338c2ecf20Sopenharmony_ci SEQ_BALANCE (with CTL_PAN) 3348c2ecf20Sopenharmony_ciCONTROL14 SEQ_CONTROLLER 3358c2ecf20Sopenharmony_ciREGPARAM SEQ_CONTROLLER(CTRL_PITCH_BENDER_RANGE) 3368c2ecf20Sopenharmony_ciSYSEX SEQ_SYSEX 3378c2ecf20Sopenharmony_ci============= =================== 3388c2ecf20Sopenharmony_ci 3398c2ecf20Sopenharmony_ciThe most of these behavior can be realized by MIDI emulation driver 3408c2ecf20Sopenharmony_ciincluded in the Emu8000 lowlevel driver. In the future release, this module 3418c2ecf20Sopenharmony_ciwill be independent. 3428c2ecf20Sopenharmony_ci 3438c2ecf20Sopenharmony_ciSome OSS events (``SEQ_PRIVATE`` and ``SEQ_VOLUME`` events) are passed as event 3448c2ecf20Sopenharmony_citype SND_SEQ_OSS_PRIVATE. The OSS sequencer passes these event 8 byte 3458c2ecf20Sopenharmony_cipackets without any modification. The lowlevel driver should process these 3468c2ecf20Sopenharmony_cievents appropriately. 3478c2ecf20Sopenharmony_ci 3488c2ecf20Sopenharmony_ciInterface to MIDI Device 3498c2ecf20Sopenharmony_ci======================== 3508c2ecf20Sopenharmony_ci 3518c2ecf20Sopenharmony_ciSince the OSS emulation probes the creation and deletion of ALSA MIDI 3528c2ecf20Sopenharmony_cisequencer ports automatically by receiving announcement from ALSA 3538c2ecf20Sopenharmony_cisequencer, the MIDI devices don't need to be registered explicitly 3548c2ecf20Sopenharmony_cilike synth devices. 3558c2ecf20Sopenharmony_ciHowever, the MIDI port_info registered to ALSA sequencer must include 3568c2ecf20Sopenharmony_cia group name ``SND_SEQ_GROUP_DEVICE`` and a capability-bit 3578c2ecf20Sopenharmony_ci``CAP_READ`` or ``CAP_WRITE``. Also, subscription capabilities, 3588c2ecf20Sopenharmony_ci``CAP_SUBS_READ`` or ``CAP_SUBS_WRITE``, must be defined, too. If 3598c2ecf20Sopenharmony_cithese conditions are not satisfied, the port is not registered as OSS 3608c2ecf20Sopenharmony_cisequencer MIDI device. 3618c2ecf20Sopenharmony_ci 3628c2ecf20Sopenharmony_ciThe events via MIDI devices are parsed in OSS sequencer and converted 3638c2ecf20Sopenharmony_cito the corresponding ALSA sequencer events. The input from MIDI sequencer 3648c2ecf20Sopenharmony_ciis also converted to MIDI byte events by OSS sequencer. This works just 3658c2ecf20Sopenharmony_cia reverse way of seq_midi module. 3668c2ecf20Sopenharmony_ci 3678c2ecf20Sopenharmony_ciKnown Problems / TODO's 3688c2ecf20Sopenharmony_ci======================= 3698c2ecf20Sopenharmony_ci 3708c2ecf20Sopenharmony_ci* Patch loading via ALSA instrument layer is not implemented yet. 3718c2ecf20Sopenharmony_ci 372