forked from MiczFlor/RPi-Jukebox-RFID
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix path to config.txt for bookworm support (MiczFlor#2298)
* fix path for config.txt * fix service name * updated pirateAudioHAT readme
- Loading branch information
1 parent
8830728
commit 7e7e0a6
Showing
4 changed files
with
59 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,88 +1,16 @@ | ||
# How to setup a Pimoroni PirateAudio HAT | ||
|
||
These instructions are for the following Pimoroni PirateAudio HATs: | ||
> [!NOTE] | ||
> The display of the HATs currently only work with the 'spotify' edition, not with 'classic'! | ||
> See [here](https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/1109) | ||
<https://shop.pimoroni.com/?q=pirate+audio> | ||
These instructions are for the [Pimoroni PirateAudio HATs](https://shop.pimoroni.com/collections/audio?q=pirate%20audio) | ||
|
||
The PirateAudio HATs use the same DAC as the hifiberry, so some of the instructions | ||
from <https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/HiFiBerry-Soundcard-Details> can be applied as well. | ||
## Installation | ||
|
||
The `setup_pirateAudioHAT.sh` script can be used to set it up to work with Phoniebox. | ||
Run the `setup_pirateAudioHAT.sh` script to set it up to work with Phoniebox. | ||
|
||
## Install steps in writing | ||
## Troubleshooting | ||
|
||
(Discussions regarding *Pirate Audio HAT* should take place in the same thread where the below instructions were taken from: [#950](https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/950) | ||
|
||
NOTE: changes to the installation should find their way into the script `setup_pirateAudioHAT.sh`. Please create pull requests *after* having tested your changes. :) | ||
|
||
1. Connect Pirate Audio Hat to your Raspberry Pi | ||
2. Install Phoniebox (develop branch!) | ||
3. Stop and disable the GPIO button service: | ||
`sudo systemctl stop phoniebox-gpio-buttons.service` | ||
`sudo systemctl disable phoniebox-gpio-buttons.service` | ||
4. Add the following two lines to /boot/config.txt | ||
`gpio=25=op,dh` | ||
`dtoverlay=hifiberry-dac` | ||
5. Add settings to /etc/asound.conf (create it, if it does not exist yet) | ||
|
||
```bash | ||
pcm.hifiberry { | ||
type softvol | ||
slave.pcm "plughw:CARD=sndrpihifiberry,DEV=0" | ||
control.name "Master" | ||
control.card 1 | ||
} | ||
pcm.!default { | ||
type plug | ||
slave.pcm "hifiberry" | ||
} | ||
ctl.!default { | ||
type hw | ||
card 1 | ||
} | ||
``` | ||
|
||
6. Add the following section to /etc/mpd.conf | ||
|
||
```bash | ||
audio_output { | ||
enabled "yes" | ||
type "alsa" | ||
name "HiFiBerry DAC+ Lite" | ||
device "hifiberry" | ||
auto_resample "no" | ||
auto_channels "no" | ||
auto_format "no" | ||
dop "no" | ||
} | ||
``` | ||
|
||
7. Set mixer_control name in /etc/mpd.conf | ||
`mixer_control "Master"` | ||
8. Enable SPI | ||
`sudo raspi-config nonint do_spi 0` | ||
9. Install Python dependencies | ||
`sudo apt-get install python3-pil python3-numpy` | ||
10. Install Mopidy plugins | ||
`sudo pip3 install Mopidy-PiDi pidi-display-pil pidi-display-st7789 mopidy-raspberry-gpio` | ||
11. Add the following sections to /etc/mopidy/mopidy.conf: | ||
|
||
```bash | ||
[raspberry-gpio] | ||
enabled = true | ||
bcm5 = play_pause,active_low,150 | ||
bcm6 = volume_down,active_low,150 | ||
bcm16 = next,active_low,150 | ||
bcm20 = volume_up,active_low,150 | ||
bcm24 = volume_up,active_low,150 | ||
[pidi] | ||
enabled = true | ||
display = st7789 | ||
``` | ||
|
||
**Attention:** Early revisions of PirateAudio HAT used bcm20 for Volume up, later revisions use bcm24. see also <https://github.com/pimoroni/pirate-audio/issues/63#issuecomment-916860634> | ||
|
||
12. Enable access for modipy user | ||
`sudo usermod -a -G spi,i2c,gpio,video mopidy` | ||
13. Reboot Raspberry Pi | ||
The PirateAudio HATs use the same DAC as the HiFiBerry, so some of the instructions | ||
from [HiFiBerry Soundcard Details](https://github.com/MiczFlor/RPi-Jukebox-RFID/wiki/HiFiBerry-Soundcard-Details) can be applied as well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
is_raspbian() { | ||
if [[ $( . /etc/os-release; printf '%s\n' "$ID"; ) == *"raspbian"* ]]; then | ||
echo true | ||
else | ||
echo false | ||
fi | ||
} | ||
|
||
get_debian_version_number() { | ||
source /etc/os-release | ||
echo "$VERSION_ID" | ||
} | ||
|
||
_get_boot_file_path() { | ||
local filename="$1" | ||
if [ "$(is_raspbian)" = true ]; then | ||
local debian_version_number=$(get_debian_version_number) | ||
|
||
# Bullseye and lower | ||
if [ "$debian_version_number" -le 11 ]; then | ||
echo "/boot/${filename}" | ||
# Bookworm and higher | ||
elif [ "$debian_version_number" -ge 12 ]; then | ||
echo "/boot/firmware/${filename}" | ||
else | ||
echo "unknown" | ||
fi | ||
else | ||
echo "unknown" | ||
fi | ||
} | ||
|
||
get_boot_config_path() { | ||
echo $(_get_boot_file_path "config.txt") | ||
} |