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 system setup for using *alsa-dispatcher.lsp* includes two
29 configuration aspects:
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 for *alsa-dispatcher.lsp* of posible endpoints
36 is a text file named _$HOME/.alsa-dispatcher_.
40 *ALSA configuration (e.g. $HOME/.asoundrc)*::
42 The ALSA configuration collection needs to include setup for
43 *alsa-dispatcher* as an ALSA PCM by means of e.g. a short declaration
44 in the user's _$HOME/.asoundrc_ file, or system-wide in
45 _/etc/asoundrc.conf_ The following is an example.
53 pcm "file:|exec /usr/local/bin/alsa-dispatcher.lsp"
59 The first of those lines asserts that "dispatch" is the default
62 The lines below declares the "dispatch" PCM to have its playback
63 stream directed via a pipe to the command
64 _/usr/local/bin/alsa-dispatcher.lsp_ (assuming that is where
65 *alsa-dispatcher.lsp* is), and its capture stream is sourced from
66 _plughw_ (i.e. the default sound card).
68 *About $HOME/.alsa-dispatcher*::
70 The possible endpoints are enumerated in _$HOME/.alsa-dispatcher_ with
71 one line for each PCM device: its name and optionally some specific
72 setting variation for that device in the form of _key=value_. Blank
73 lines and lines starting with "#" are comments. The following is an
81 The example _$HOME/.alsa-dispatcher_ nominates _bt_ as the first ALSA
82 PCM to try, and then _plughw_ as the second (and last). This suggest a
83 bluetooth device _bt_ that has priority when in use;
84 *alsa-dispatcher.lsp* will direct playback to _bt_ if it is in use and
85 otherwise fall back on _plughw_ (i.e. the default sound card).
93 Ralph Ronnquist <ralph.ronnquist@gmail.com>