#RPi 3 - IQaudioDAC+ adding rotary encoder
pacman -S mc
pacman -S gcc
sudo pacman -Sy git
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build
gpio -v
cd ..
#Mod file IQ_rot.c
removing
line 40
line 41 with define of TRUE and FALSE as they were defined already in wiringPI and changing
mod
line 6
FROM const char *card = "default";
TO const char *card = "hw:1";
Save
cd tools
gcc IQ_rot.c -oIQ_rot -lwiringPi -lasound
sudo ./IQ_rot &
#created file /etc/systemd/system/IQ_rot.service with content:
[Unit]
Description=IQ rotary encoder
[Service]
ExecStart=/root/tools/IQ_rot &
[Install]
WantedBy=multi-user.target
systemctl enable IQ_rot.service
#Unmute
# Uncomment one of these lines to enable an audio interface
#dtoverlay=hifiberry-dac
#dtoverlay=hifiberry-dacplus
#dtoverlay=hifiberry-digi
#dtoverlay=hifiberry-amp
#dtoverlay=iqaudio-dac
dtoverlay=iqaudio-dacplus
#method #1
Save this in /var/www/command/iqaudio-amp-unmute.sh
#!/bin/bash
#Unmute the Pi-AMP+
echo "22" > /sys/class/gpio/export
echo "out" >/sys/class/gpio/gpio22/direction
echo "1" >/sys/class/gpio/gpio22/value
- Save this in /usr/lib/systemd/system/iqaudio-amp-unmute.service
[Unit]
Description=RuneAudio IQAudio-Amp unmute
After=mpd.service
[Service]
ExecStart=/usr/bin/sh /var/www/command/iqaudio-amp-unmute.sh
TimeoutSec=0
Restart=always
RestartSec=1
StartLimitInterval=30
StartLimitBurst=20
[Install]
WantedBy=multi-user.target
- enable the service
systemctl enable iqaudio-amp-unmute
#method #2
wget -O /usr/lib/systemd/system/iqaudio-amp-unmute.service
http://www.friedmann-elektronik.de/RuneAudio-RP2/iqaudio-amp/iqaudio-amp-unmute.service
wget -O /srv/http/command/iqaudio-amp-unmute.sh
http://www.friedmann-elektronik.de/RuneAudio-RP2/iqaudio-amp/iqaudio-amp-unmute.sh
systemctl enable iqaudio-amp-unmute