Device Enumeration
The server keeps a separate list of inputs and outputs. The server will listen to udev events that notify it of newly added or removed devices. Whenever a device appears or disappears, the priority list of devices will be re-evaluated and the highest priority device will be used.
Devices will be given a priority based on the device type and the time they are inserted. The priority is as follows (for both input and output):
1) Headset jack and USB audio devices
2) DisplayPort and HDMI outputs (when EDID indicates the sink is audio capable).
3) Built-in speakers.
If two devices of the same priority are attached, the device that was plugged most recently wins.
On device removal, all streams are removed from the device and the device is closed. The streams will be moved to the next device in the list when this happens.
Mixing
The server is required to mix for the case where multiple streams are being played at once. The mixing will be done immediately before the samples are sent to the playback hardware. If a DSP block is enabled, it will be applied post-mix.
Per-Board Configuration
Without a config, the server will automatically discover devices and mute/volume controls. This provides all that is need for x86 most of the time. On x86 the main use of config files is to set volume level mappings between ui and hardware, and to configure codec-specific features.
The volume curve file is per-codec, per-device and the format is described in the main README file.
ALSA UCM is used to do low level codec config. On arm systems, this setup is necessary to get audio paths routed correctly when an headset is attached and to initialize codec setup after start up. In addition to this, the UCM file is used to map jacks to audio devices.