This is the script you may want to launch or run step by step. You have to modify 3 files manually, sorry I don't have the time to make a script to automatically change those files (remember to strip # from the rows you have to insert into files).
- Code: Select all
#### HiFiBerry AMP MOD procedure
pacman -Syu
pacman -S linux-raspberrypi-headers
cp /var/www/app/config/_os/usr/lib/systemd/system/rc-local.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/redis.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/rune_PL_wrk.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/rune_SY_wrk.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/rune_shutdown.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/shairport.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/udevil.service /usr/lib/systemd/system/
cp /var/www/app/config/_os/usr/lib/systemd/system/wpa_supplicant@.service /usr/lib/systemd/system/
systemctl enable php-fpm
systemctl enable nginx
systemctl enable mpd
systemctl enable redis
systemctl enable rune_PL_wrk
systemctl enable rune_SY_wrk
systemctl enable rune_shutdown
cp /var/www/app/config/_os/usr/share/ca-certificates /usr/share/
cp /var/www/app/config/_os/etc/ca-certificates /etc/
trust extract-compat --verbose
### Comment actual kernel image (insert # before kernel)
### and append following line to /boot/config.txt.
# kernel=kernel.img
# dtoverlay=hifiberry-amp
mv /etc/modules-load.d/raspberrypi.conf /etc/modules-load.d/raspberrypi.conf.bak
cat > /etc/modprobe.d/snd-soc-wn804.conf<<EOF
blacklist snd-soc-wm8804
EOF
### Insert after <option value="hifiberrydigi".... in /srv/http/app/templates/settings.php the following line:
# <option value="hifiberryamp" <?php if($this->i2smodule === 'hifiberryamp'): ?> selected <?php endif ?>>HiFiBerry AMP/AMP+</option>
### Insert after "redis->hSet('acards_details', 'snd_rpi_hifiberry_amp'" in /srv/http/db/redis_acards_details the following line:
# $redis->hSet('acards_details', 'snd_rpi_hifiberry_amp', '{"sysname":"snd_rpi_hifiberry_amp","extlabel":"HiFiBerry AMP (I²S)","mixer_numid":"0","mixer_control":"Master","hwplatformid":"01","type":"i2s"}') || $return = 0;
/srv/http/app/libs/runeaudio.php:
case 'hifiberryamp':
sysCmd('modprobe bcm2708_dmaengine').usleep(300000);
sysCmd('modprobe snd_soc_bcm2708_i2s').usleep(300000);
sysCmd('modprobe snd_soc_tas5713').usleep(300000);
sysCmd('modprobe snd_soc_hifiberry_amp');
break;
### Go to http: // <RuneaudioIP> / dev
### Enable development mode:
### Click gitpull
### Click on devmode on, netconfreset, mpdconfreset
systemctl mpd stop
systemctl php-fpm stop
systemctl redis stop
rm -f /var/lib/redis/*
reboot
### reconfigure all
### Enable HiFiBerry AMP/AMP+ on system config
### Enable HiFiBerry I2S on MPD config
### Enable Hardware Volume on MPD config
### That's all, folks!!!
### Useful commands:
### redis-cli hset acards_details snd_rpi_hifiberry_amp "{\"sysname\":\"snd_rpi_hifiberry_amp\",\"extlabel\”:\”HiFiBerry AMP (I²S)\",\"mixer_numid\":\"0\",\"mixer_control\”:\”Master\”,\”hwplatformid\":\"01\",\"type\":\"i2s\"}"
### /srv/http/command/refresh_ao