Skip to content

Commit

Permalink
Merge pull request #380 from hifiberry/development
Browse files Browse the repository at this point in the history
Release 20220726
  • Loading branch information
hifiberry authored Jul 26, 2022
2 parents 7f581ec + a0715c2 commit 3b1ad09
Show file tree
Hide file tree
Showing 25 changed files with 381 additions and 55 deletions.
8 changes: 8 additions & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
20220726:
- Update to kernel 5.15.56
- Update shairport-sync
- Add infrared receiver support by @blockbasti
- Fix broken interactions
- Workaround for broken Spotify AP
- Add AMP3 support

20220222:
- Add compatibility checks
- Update kernel to 5.10.95
Expand Down
2 changes: 1 addition & 1 deletion build-release
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ date > buildtime.$1
./compile $1
# For some reason, first build sometimes fails
./compile $1
./create-image $1 $TS
#./create-image $1 $TS
date >> buildtime.$1
2 changes: 1 addition & 1 deletion buildroot/Config.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/hifiberry-users/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/hifiberry-tools/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/hifiberry-updater/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/copy-overlays/Config.in"
#source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/alsa-plugins/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/alsa-eq/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/configtxt/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/raspi-wifi/Config.in"
Expand Down Expand Up @@ -63,6 +62,7 @@ source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/hifiberry-analytics/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/smbtools/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/hifiberry-automount/Config.in"
#source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/wisa-scripts/Config.in"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/ir-remote/Config.in"

comment "GUI"
source "$BR2_EXTERNAL_HIFIBERRY_PATH/package/beocreate/Config.in"
Expand Down
3 changes: 0 additions & 3 deletions buildroot/package/beocreate/beocreate2.service
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@ WorkingDirectory=/opt/beocreate/
User=root
Restart=on-failure
RestartSec=10s
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=beocreate2
TimeoutStopSec=10

[Install]
Expand Down
2 changes: 1 addition & 1 deletion buildroot/package/copy-overlays/copy-overlays.mk
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif
define COPY_OVERLAYS_INSTALL_TARGET_CMDS
# Copy overlays
mkdir -p $(TARGET_DIR)/usr/lib/firmware/rpi/overlays
for i in hifiberry vc4 i2c-gpio cma dwc disable rpi- spi i2c uart; do \
for i in hifiberry vc4 i2c-gpio gpio-ir cma dwc disable rpi- spi i2c uart; do \
cp -v $(BUILD_DIR)/linux-custom/arch/arm/boot/dts/overlays/$$i*.dtbo $(BINARIES_DIR)/rpi-firmware/overlays; \
cp -v $(BUILD_DIR)/linux-custom/arch/arm/boot/dts/overlays/$$i*.dtbo $(TARGET_DIR)/usr/lib/firmware/rpi/overlays; \
done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

HIFIBERRY_SHAIRPORT_VERSION = b622c179bffab7ba09819be534c8e2108a2300f2
HIFIBERRY_SHAIRPORT_VERSION = ead5da5a55434563c58d569f5e5c3c0e9d9ade92
HIFIBERRY_SHAIRPORT_SITE = $(call github,mikebrady,shairport-sync,$(HIFIBERRY_SHAIRPORT_VERSION))

HIFIBERRY_SHAIRPORT_LICENSE = MIT, BSD-3-Clause
Expand Down
Binary file added buildroot/package/hifiberry-test/sine1k.wav
Binary file not shown.
6 changes: 6 additions & 0 deletions buildroot/package/hifiberry-tools/detect-hifiberry
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ function detect_card {
EEPROM=0
return
fi

if [ "$HATCARD" == "Amp3" ]; then
DETECTED="amp3"
EEPROM=0
return
fi

# DAC+ ADC Pro
res=`i2cget -y 1 0x4a 25 2>/dev/null`
Expand Down
2 changes: 1 addition & 1 deletion buildroot/package/hifiberry-tools/enable-updi
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ fi
if [ "$CHANGED" != "" ]; then
mount -o remount,rw /boot
cp /tmp/config.txt /boot/config.txt
echo "Rebooing in 5 seconds"
echo "Rebooting in 5 seconds"
sleep 5
sync
reboot
Expand Down
2 changes: 2 additions & 0 deletions buildroot/package/hifiberry-tools/hifiberry-tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ define HIFIBERRY_TOOLS_INSTALL_TARGET_CMDS
$(TARGET_DIR)/opt/hifiberry/bin
$(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-tools/shutdown-system \
$(TARGET_DIR)/opt/hifiberry/bin
$(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-tools/set-host-ip \
$(TARGET_DIR)/opt/hifiberry/bin
$(INSTALL) -D -m 0755 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/hifiberry-tools/snd_soc_core_disable_pm.conf \
$(TARGET_DIR)/etc/modprobe.d/snd_soc_core_disable_pm.conf
touch $(TARGET_DIR)/resize-me
Expand Down
51 changes: 28 additions & 23 deletions buildroot/package/hifiberry-tools/reconfigure-players
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,13 @@ guess_volume_control() {
return
fi

# Amp3 uses "A.Mstr Vol"
MSTRVOL=`amixer scontrols | grep "A.Mstr Vol"`
if [ "$MSTRVOL" != "" ]; then
MIXER_CONTROL="A.Mstr Vol"
return
fi

# Amp+ uses "Master"
# however, as shairport-sync doen't work with this, we'll use softvol
MASTER=`amixer scontrols | grep Master`
Expand Down Expand Up @@ -248,6 +255,18 @@ guess_card() {
return
fi

if [ "$HATINFO" == "HiFiBerry Amp3" ]; then
if [ "$HAS_DSP" == "1" ]; then
CARD="Amp3 + DSP Module"
DSPTYPE="DSP add-on"
SECONDARY_MIXER_CONTROL="Digital"
else
CARD="Amp3"
fi
INTPIN=3
return
fi

DAC2HD=`aplay -l | grep hifiberry_dacplushd`
if [ "$DAC2HD" != "" ]; then
if [ "$HAS_DSP" == "1" ]; then
Expand Down Expand Up @@ -442,7 +461,7 @@ reconfigure_spotify() {

RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i s/mixer\ =.*/mixer\ =\ $MIXER_CONTROL/ /etc/spotifyd.conf
sed -i "s/mixer\ =.*/mixer\ =\ $MIXER_SED_SPACES/" /etc/spotifyd.conf
RESTART=1
echo " updated mixer"
fi
Expand All @@ -467,7 +486,7 @@ reconfigure_vollibrespot() {

RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i s/mixer-name\ =.*/mixer-name\ =\ \'$MIXER_CONTROL\'/ /etc/vollibrespot.conf
sed -i "s/mixer-name\ =.*/mixer-name\ =\ \'$MIXER_SED_SPACES\'/" /etc/vollibrespot.conf
RESTART=1
echo " updated mixer"
fi
Expand Down Expand Up @@ -498,7 +517,7 @@ reconfigure_shairport() {

RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i s/mixer_control_name\ =\ .*/mixer_control_name\ =\ \"$MIXER_CONTROL\"\;/ /etc/shairport-sync.conf
sed -i "s/mixer_control_name\ =\ .*/mixer_control_name\ =\ \"$MIXER_SED_SPACES\"\;/" /etc/shairport-sync.conf
RESTART=1
echo " updated mixer"
fi
Expand All @@ -516,7 +535,7 @@ reconfigure_shairport() {
reconfigure_audiocontrol2() {
RESTART=0
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i s/mixer_control.*=.*/mixer_control=$MIXER_CONTROL/ /etc/audiocontrol2.conf
sed -i "s/mixer_control=.*/mixer_control=$MIXER_SED_SPACES/" /etc/audiocontrol2.conf
RESTART=1
echo " updated mixer"
fi
Expand Down Expand Up @@ -573,7 +592,7 @@ reconfigure_dlna() {
fi

if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i "s/mixer\=.*/mixer=$MIXER_CONTROL/" /etc/dlnampris.conf
sed -i "s/mixer\=.*/mixer=$MIXER_SED_SPACES/" /etc/dlnampris.conf
UPDATE=1
fi

Expand All @@ -588,7 +607,7 @@ reconfigure_mpd() {
fi

if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i s/mixer_control\ .*/mixer_control\ \ \ \"$MIXER_CONTROL\"/ /etc/mpd.conf
sed -i "s/mixer_control\ .*/mixer_control\ \ \ \"$MIXER_SED_SPACES\"/" /etc/mpd.conf
restart_service mpd
echo " updated mixer"
fi
Expand All @@ -606,19 +625,6 @@ reconfigure_upmpdcli() {
fi
}

# Reconfigure Mopidy
reconfigure_mopidy() {
if [ ! -f /etc/mopidy.conf ]; then
echo "modidy not installed, ignoring"
return
fi
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
sed -i "/#ALSAMIXER/ N; s/#ALSAMIXER\ncontrol.*/#ALSAMIXER\ncontrol=$MIXER_CONTROL/g" /etc/mopidy.conf
restart_service mopidy
echo " updated mixer"
fi
}

# Reconfigure RAAT
reconfigure_raat() {
if [ ! -d /opt/raat ]; then
Expand All @@ -641,7 +647,7 @@ reconfigure_beocreate() {

# Update mixer control
if [ "$MIXER_CONTROL" != "$CURRENT_MIXER_CONTROL" ]; then
/bin/node /opt/beocreate/beo-system/configure.js sound mixer $MIXER_CONTROL
/bin/node /opt/beocreate/beo-system/configure.js sound mixer "$MIXER_CONTROL"
echo " updated mixer"
UPDATE=1
fi
Expand Down Expand Up @@ -670,7 +676,7 @@ reconfigure_beocreate() {
}

# Reconfigure avahi
reconfigure_avahid() {
reconfigure_avahi() {
# System name
if [ "$SYSNAME" != "$CURRENT_SYSNAME" ]; then
avahi-set-host-name $SYSNAME_NO_SPACES
Expand Down Expand Up @@ -720,6 +726,7 @@ check_pi3a
check_genuine

CARD_SED_SPACES=`echo $CARD | sed 's/\ /\\\\\\ /g' | sed 's/\//\\\\\\//g'`
MIXER_SED_SPACES=`echo $MIXER_CONTROL | sed 's/\ /\\\\\\ /g' | sed 's/\//\\\\\\//g'`

FEATURES=`echo $FEATURES | xargs`

Expand Down Expand Up @@ -804,8 +811,6 @@ echo "Reconfiguring MPD"
reconfigure_mpd
echo "Reconfiguring DLNA"
reconfigure_dlna
echo "Reconfiguring Mopidy"
reconfigure_mopidy
echo "Reconfigure AudioControl2"
reconfigure_audiocontrol2
echo "Reconfigure upmpdcli"
Expand Down
25 changes: 25 additions & 0 deletions buildroot/package/hifiberry-tools/set-host-ip
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash

IP=$2
HOST=$1
if [ "$HOST" == "" ]; then
echo "start with $0 hostname ip"
exit 1
fi

[[ $IP =~ ^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$ ]] && MATCH=1
if [ "$MATCH" != "1" ]; then
echo "start with $0 hostname ip"
exit 1
fi

grep "$IP $HOST" /etc/hosts >/dev/null
if [ "$?" == "0" ]; then
# entry already exists
exit 0
fi

cat /etc/hosts | grep -v ^$IP > /tmp/hosts
echo "$IP $HOST" >> /tmp/hosts
mv /tmp/hosts /etc/hosts

1 change: 1 addition & 0 deletions buildroot/package/hifiberry-updater/config-files
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@
/custom
/opt/wisa/etc/room.cfg
/etc/modprobe.d/snd_soc_core_disable_pm.conf
/etc/rc_keymaps/keymap.toml
9 changes: 9 additions & 0 deletions buildroot/package/ir-remote/Config.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
config BR2_PACKAGE_IR_REMOTE
bool "IR Remote"
help
"Control HiFiBerryOS using an IR remote control"
depends on BR2_PACKAGE_CONFIGTXT
depends on BR2_PACKAGE_COPY_OVERLAYS
depends on BR2_PACKAGE_HIFIBERRY_UPDATER
select BR2_PACKAGE_LIBV4L
select BR2_PACKAGE_LIBV4L_UTILS
17 changes: 17 additions & 0 deletions buildroot/package/ir-remote/ir-remote.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
################################################################################
#
# ir-remote
#
################################################################################

IR_REMOTE_INSTALL_TARGET = YES
IR_REMOTE_DEPENDENCIES = libv4l

define IR_REMOTE_INSTALL_TARGET_CMDS
$(INSTALL) -D -m 0644 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/ir-remote/keymap.toml \
$(TARGET_DIR)/etc/rc_keymaps/keymap.toml
$(INSTALL) -D -m 0644 $(BR2_EXTERNAL_HIFIBERRY_PATH)/package/ir-remote/ir.service \
$(TARGET_DIR)/lib/systemd/system/ir.service
endef

$(eval $(generic-package))
10 changes: 10 additions & 0 deletions buildroot/package/ir-remote/ir.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[Unit]
Description=Setup ir-keytable
After=hifiberry.target

[Service]
Type=oneshot
ExecStart=/usr/bin/ir-keytable --write=/etc/rc_keymaps/keymap.toml -c

[Install]
WantedBy=multi-user.target
8 changes: 8 additions & 0 deletions buildroot/package/ir-remote/keymap.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[[protocols]]
name = "rc6_0"
protocol = "rc6"
variant = "rc6_0"
[protocols.scancodes]
0x0d = "KEY_MUTE"
0x10 = "KEY_VOLUMEUP"
0x11 = "KEY_VOLUMEDOWN"
2 changes: 1 addition & 1 deletion buildroot/package/nqptp/nqptp.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
################################################################################

NQPTP_VERSION = 4df1dee820e97f1307e745f5e2107736b7df8feb
NQPTP_VERSION = 44e74cc0870820d73d238c28380135f98d895348
NQPTP_SITE = $(call github,mikebrady,nqptp,$(NQPTP_VERSION))

# git clone, no configure
Expand Down
3 changes: 2 additions & 1 deletion buildroot/package/python-pymcuprog/python-pymcuprog.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#
################################################################################

PYTHON_PYMCUPROG_VERSION = dfa0f9b4352c41dbd58d32f3f091517112a1908c
#PYTHON_PYMCUPROG_VERSION = dfa0f9b4352c41dbd58d32f3f091517112a1908c
PYTHON_PYMCUPROG_VERSION = 44c2e6e11e1f8b5246627d01283996784c6797ee
PYTHON_PYMCUPROG_SITE = $(call github,microchip-pic-avr-tools,pymcuprog,$(PYTHON_PYMCUPROG_VERSION))
PYTHON_PYMCUPROG_SETUP_TYPE = setuptools

Expand Down
1 change: 1 addition & 0 deletions buildroot/package/spotifyd/spotify.service
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Environment=DBUS_SESSION_BUS_ADDRESS=unix:path=/run/dbus/system_bus_socket
Environment=SPOTIFYD_CLIENT_ID=9223bb6a6d924c8da9b02519d03c987a
ExecStartPre=/opt/hifiberry/bin/bootmsg "Starting Spotify"
ExecStartPre=/opt/hifiberry/bin/store-volume /tmp/spotifyvol
ExecStartPre=/opt/hifiberry/bin/set-host-ip ap-gew4.spotify.com 104.199.65.124
ExecStart=/opt/hifiberry/bin/spotify-start
ExecStartPost=sleep 1
ExecStartPost=/opt/hifiberry/bin/restore-volume /tmp/spotifyvol
Expand Down
1 change: 1 addition & 0 deletions buildroot/package/vollibrespot/vollibrespot.service
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ConditionPathExists=!/custom/service/spotify.disable
Type=simple
ExecStartPre=/opt/hifiberry/bin/bootmsg "Starting Vollibrespot"
ExecStartPre=/opt/hifiberry/bin/store-volume /tmp/spotifyvol
ExecStartPre=/opt/hifiberry/bin/set-host-ip ap-gew4.spotify.com 104.199.65.124
ExecStart=/usr/bin/vollibrespot -c /etc/vollibrespot.conf
ExecStartPost=sleep 1
ExecStartPost=/opt/hifiberry/bin/restore-volume /tmp/spotifyvol
Expand Down
Loading

0 comments on commit 3b1ad09

Please sign in to comment.