#!/bin/sh

# Initialize alsa softvol mixer elements
dd if=/dev/zero bs=64 count=1 2> /dev/null | aplay -q -fS32_LE -c2 -r48000
if grep -q pcm.cast_volume /etc/asound.conf; then
    dd if=/dev/zero bs=64 count=1 2> /dev/null | aplay -q -fS32_LE -c2 -r48000 -D cast_volume
fi
# On ARCAM, the softvol element just serves as a dummy to hold the value
# so it's never initialized by the audio pipeline; we have to do it here
if grep -q pcm.output /etc/asound.conf; then
    dd if=/dev/zero bs=64 count=1 2> /dev/null | aplay -q -fS32_LE -c2 -r48000 -D output
fi