| 1 |
.. SPDX-FileCopyrightText: 2017 Ole Martin Bjorndalen <[email protected]> |
| 2 |
.. |
| 3 |
.. SPDX-License-Identifier: CC-BY-4.0 |
| 4 |
|
| 5 |
amidi (Experimental) |
| 6 |
-------------------- |
| 7 |
|
| 8 |
Name: ``mido.backends.amidi`` |
| 9 |
|
| 10 |
Resources: |
| 11 |
|
| 12 |
* `The Advanced Linux Sound Architecture (ALSA) project |
| 13 |
<https://www.alsa-project.org/>`_ |
| 14 |
|
| 15 |
* `ALSA Opensrc Org amidi <https://alsa.opensrc.org/Amidi>`_ |
| 16 |
|
| 17 |
Features |
| 18 |
^^^^^^^^ |
| 19 |
|
| 20 |
* Linux only. |
| 21 |
|
| 22 |
* very basic implementation. |
| 23 |
|
| 24 |
* no callbacks |
| 25 |
|
| 26 |
* can only access physical ports. (Devices that are plugged-in.) |
| 27 |
|
| 28 |
* high overhead when sending since it runs a new ``amidi`` command for |
| 29 |
each message. |
| 30 |
|
| 31 |
* known bug: is one behind when receiving messages. See below. |
| 32 |
|
| 33 |
|
| 34 |
Operation |
| 35 |
^^^^^^^^^ |
| 36 |
|
| 37 |
The ``amidi`` command (part of ALSA and the `alsa-utils` package) is used for |
| 38 |
I/O: |
| 39 |
|
| 40 |
* ``amidi -l`` to list messages (in ``get_input_names()`` etc.) |
| 41 |
|
| 42 |
* ``amidi -d -p DEVICE`` to receive messages. ``amidi`` prints these |
| 43 |
out one on each line as hex bytes. Unfortunately it puts the newline |
| 44 |
at the beginning of the line which flushes the buffer before the |
| 45 |
message instead of after. This causes problems with non-blocking |
| 46 |
receiption using ``select.poll()`` which means messages are received |
| 47 |
one behind. This needs to be looked into. |
| 48 |
|
| 49 |
* ``amidi --send-hex MESSAGE_IN_HEX -p DEVICE`` to send |
| 50 |
messages. Since this is called for every message the overhead is |
| 51 |
very high. |