Add initial pulseaudio module support

This seems to work quite well including hotplugging of devices, changes to
default sinks/sources etc.

So far I only provided percentage values for sink/source since they seem most
useful. Defaults are set to DEFAULT_SINK/DEFAULT_SOURCE which means it will
follow whatever defaults are at the moment (instead of being fixed to a given
device).

One thing currently left unhandled is when pulseaudio/pipewire gets
disconnected/restarted. In such a case we mark the sink/source as offline but
there is no reconnect attempted later.

Added man page + more complex example which includes mixed usage of both input
and output.
This commit is contained in:
Stanislav Ochotnický 2021-09-17 13:29:30 +02:00
parent 6250360c58
commit 04d47cba3c
8 changed files with 566 additions and 2 deletions

View file

@ -11,6 +11,9 @@ xcb_xkb = dependency('xcb-xkb', required: get_option('backend-x11'))
mpd = dependency('libmpdclient', required: get_option('plugin-mpd'))
plugin_mpd_enabled = mpd.found()
pulse = dependency('libpulse', required: get_option('plugin-pulse'))
plugin_pulse_enabled = pulse.found()
# Module name -> (source-list, dep-list)
mod_data = {
'alsa': [[], [m, alsa]],
@ -29,6 +32,10 @@ if plugin_mpd_enabled
mod_data += {'mpd': [[], [mpd]]}
endif
if plugin_pulse_enabled
mod_data += {'pulse': [[], [pulse]]}
endif
if backend_x11
mod_data += {
'xkb': [[], [xcb_stuff, xcb_xkb]],