3 :revdate: {sys:date "+%Y-%m-%d %H:%M:%S"}
7 alsa-dispatcher - ALSA playback priority dispatcher for temporarily
8 connected playback endpoints.
16 *alsa-dispatcher.lsp* is an ALSA utility that handles dispatch of
17 audio playback via a priority list of possible endpoints. The dispatch
18 logic works through the list trying to open each ALSA PCM device in
19 order until one succeeds, and thereafter *alsa-dispatcher.lsp* simply
20 channels the playback audio stream from its standard input to the
21 successfully opened PCM playback device.
23 The program is a _newlisp_ script of manageable size which links up
24 with _libasound.so_ for ALSA API actions.
28 The setup for using *alsa-dispatcher.lsp* includes two configuration
31 1. The ALSA configuration collection needs to be augmented with a
32 _pcm_ block that directs playback to *alsa-dispatcher.lsp* and
33 capture from, say, _plughw_ (i.e., the primary sound card).
35 2. The priority list of posible endpoints for *alsa-dispatcher.lsp*
36 is a text file named _$HOME/.alsa-dispatcher_.
40 *ALSA configuration (e.g. $HOME/.asoundrc)*::
42 The ALSA configuration collection needs to include a declaration for
43 *alsa-dispatcher* as an ALSA PCM by means of a short declaration in
44 the user's _$HOME/.asoundrc_ file or system-wide in
45 _/etc/asoundrc.conf_ The following is an example _$HOME/.asoundrc_.
53 pcm "file:|exec /usr/local/bin/alsa-dispatcher.lsp"
59 The first line in the example asserts that "dispatch" is the default
62 The lines below that declares the "dispatch" PCM to have its playback
63 stream directed to the command _/usr/local/bin/alsa-dispatcher.lsp_
64 via a pipe (that is where *alsa-dispatcher.lsp* is for this example),
65 and the "dispatch" PCM capture stream is sourced from _plughw_ (i.e.
66 the default sound card).
68 *About $HOME/.alsa-dispatcher*::
70 Possible endpoints are enumerated for *alsa-dispatcher.lsp* in a text
71 file _$HOME/.alsa-dispatcher_ with one line for each PCM device. The
72 line contains its name and optionally some specific setting variation
73 for that device. Such settings have the form of _key=value_ with space
74 seapartion between settings. Blank lines and lines starting with "#"
75 are comments. The following is an illustration example.
82 The example _$HOME/.alsa-dispatcher_ nominates _bt_ as the first ALSA
83 PCM to try, and then _plughw_ as the second (and last). This suggest a
84 bluetooth device _bt_ that has priority when in use;
85 *alsa-dispatcher.lsp* will direct playback to _bt_ if it is in use and
86 otherwise fall back on _plughw_ (i.e. the default sound card).
94 Ralph Ronnquist <ralph.ronnquist@gmail.com>