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
Some devices might have nonfunctional 'Pro Audio' sound. This patch adds a
new 'api.acp.disable-pro-audio' option to disable pro-audio profile entirely.
Including C headers inside of `extern "C"` breaks use from C++. Hoist
the includes of standard C headers above the block so we don't try
to mangle the stdlib.
I initially tried to scope this with a targeted change but it's too
hard to do correctly that way. This way, we avoid whack-a-mole.
Firefox is working around this in their e21461b7b8b39cc31ba53c47d4f6f310c673ff2f
commit.
Bug: https://bugzilla.mozilla.org/1953080
Don't use the api.alsa.soft-mixer option to disable the path selection
but make a new api.alsa.disable-mixer-path.
Disabling the path selection might leave cards unusable after suspend,
so a separate option is a better idea.
See #4311
We always probe the Pro Audio profile with the maximum number of
channels but this can lead to a more limited amount of sample rates.
Add an option to set the channels used when probing so that the other
samplerates become available.
Fixes#2990
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.