Add 3 levels of volume limits.
1. Add api.acp.min-volume and api.acp.max-valume on the ACP devices that
is applied to all noded from this device
2. Add api.acp.device.<node-name>.min-volume and
api.acp.device.<node-name>.max-volume that is applied to all nodes
from the device with the given node-name.
3. Add api.acp.port.<port-name>.min-volume and
api.acp.port.<port-name>.max-volume that is applied to all ports
from the device with the given port-name.
The volume settings on an ALSA nodes can either go through the device on
the Routes (ports) to control the hardware mixer volumes and then the
remainder is performed on the nodes in software by the channel mixer.
We need to set the limits on the channel mixer when the hardware mixer
does not have routes.
This is not an easy way to set the volume limits but it provides a
static configuration option to enforce the limits. An easier
configuration option will also make it easier to change/bypass the
limits, which these options can guard against.
See #5266, #4323, #1517
config.h needs to be consistently included before any standard headers
if we ever want to set feature test macros (like _GNU_SOURCE or whatever)
inside. It can lead to hard-to-debug issues without that.
It can also be problematic just for our own HAVE_* that it may define
if it's not consistently made available before our own headers. Just
always include it first, before everything.
We already did this in many files, just not consistently.
Backport from Pulseaudio. Reimplement get_data_path. We'll look for the
override files similarly as we do for other config files
(XDG_CONFIG_HOME then /etc then install location), instead of looking at
the Pulseaudio locations ~/.local/share/pulseaudio etc.
Upstream commits:
From: SimonP <simonp.git@gmail.com>
alsa-mixer: Respect XDG base directory spec when loading profile sets
Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old behaviour.
From: SimonP <simonp.git@gmail.com>
alsa-mixer: Respect XDG base directory spec when loading path configs
Try $XDG_DATA_HOME, then $XDG_DATA_DIRS, and finally fall back to old
behaviour (prefix-defined directory).
core-util: Ignore non-absolute XDG base dirs
These are invalid per the spec.
libacp is a port and wrapper around the pulseaudio card profile code.
It uses a set of templates for construct a card profile and mixer port
settings. It also has support for UCM when available for the hardware.