#!/bin/sh

# setup default mixer settings for Cirrus Logic Audio Card

. /etc/profile

if [ -f $HOME/.config/sound.conf ] ; then
    alsactl restore -f $HOME/.config/sound.conf
else
    if [ -r $HOME/.config/rpi-cirrus-config.sh ] ; then
        progress "Setting up Cirrus Logic Audio Card with user config"
        sh $HOME/.config/rpi-cirrus-config.sh
    else
        progress "Setting up Cirrus Logic Audio Card"

        # load helper functions and definitions
        . /usr/lib/alsa/rpi-cirrus-functions.sh

        playback_to_spdif
        playback_to_lineout
        playback_to_headset
        mixer 'Noise Gate Switch' off
    fi
fi
