feat(playout): configure device for alsa and pulseaudio system outputs (#2654)

### Description

Add hardware configuration to liquidsoap so that users may
set hardware output in config.yml.

---------

Co-authored-by: jo <ljonas@riseup.net>
This commit is contained in:
maxtim 2023-12-29 09:22:43 -05:00 committed by GitHub
parent 9d6061e42e
commit 06af18b84e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 149 additions and 11 deletions

View file

@ -117,20 +117,41 @@ output.shoutcast(
)
{%- endmacro -%}
{% for output in config.stream.outputs.system -%}
{% if output.enabled -%}
# {{ output.kind.value }}:{{ loop.index }}
{#-
Build a system output configuration.
#}
{%- macro output_system(output_id, output) -%}
# {{ output.kind.value }}:{{ output_id }}
%ifndef output.{{ output.kind.value }}
log("output.{{ output.kind.value }} is not defined!")
%endif
%ifdef output.{{ output.kind.value }}
output.{{ output.kind.value }}(id="{{ output.kind.value }}:{{ loop.index }}", s)
output.{{ output.kind.value }}(
id="{{ output.kind.value }}:{{ output_id }}",
{%- if output.kind.value == "alsa" %}
{%- if output.device is not none %}
device="{{ output.device }}",
{%- endif %}
{%- elif output.kind.value == "pulseaudio" %}
{%- if output.device is not none %}
device="{{ output.device }}",
{%- endif %}
{%- endif %}
s
)
%endif
{%- endmacro -%}
{# ############################### #}
{%- for output in config.stream.outputs.system -%}
{% if output.enabled -%}
{{ output_system(loop.index, output) }}
{% endif -%}
{% endfor -%}
{% for output in config.stream.outputs.icecast -%}
{%- for output in config.stream.outputs.icecast -%}
{% if output.enabled -%}
{{ output_icecast(loop.index, output) }}