Argon One v2 IR Remote with DAC - PeteManchester/MediaPlayer GitHub Wiki

How to configure the Argon IR Remote to work with a DAC that has multiple amixer controls:

Referenced from: https://forums.raspberrypi.com/viewtopic.php?t=286230

Edit /usr/bin/argonirexec


if [ -z "$1" ]
then
        exit
fi

# Handlers for different key codes
# Key codes: UP DOWN LEFT RIGHT BACK PLAYPAUSE MENU HOME OK MUTE VOLUMEUP VOLUMEDOWN

amixerdevice=$(/usr/bin/amixer scontrols |sed -n '1p' | sed -n "s/^.*'\(.*\)'.*$/\1/p")
#amixerdevice="PCM"
if [ $1 == "VOLUMEUP" ]
then
        /usr/bin/amixer set $amixerdevice -- $[$(/usr/bin/amixer get $amixerdevice|grep -o [0-9]*%|sed -n '1p' | sed 's/%//')+5]%
elif [ $1 == "VOLUMEDOWN" ]
then
        /usr/bin/amixer set $amixerdevice -- $[$(/usr/bin/amixer get "PCM"|grep -o [0-9]*%|sed -n '1p' | sed 's/%//')-5]%
	#   /usr/bin/amixer set "PCM" 95%

elif [ $1 == "MUTE" ]
then
        /usr/bin/amixer set $amixerdevice toggle
fi

For AutoStart On Reboot, add this to the /etc/rc.local before exit 0

/usr/bin/irexec -d /etc/lirc/irexec.lircrc