Switch musicdolphin from a Pi 4 to a Pi 5
The SD card moves over as is, so: - pi_standard_setup can install the Pi 5 kernel (linux-image-rpi-2712, an arm64 package on the armhf userland), which a Pi 4 image lacks. Opt-in via pi_standard_setup_install_pi5_kernel. - The Pi is powered through the HiFiBerry board's GPIO header, so it cannot negotiate a 5A supply and would cap USB at 600mA. pi_hifiberry_amp sets usb_max_current_enable=1 when hifiberry_powers_pi is true (default false). - The DHT22 poller is off: Adafruit_DHT bit-bangs BCM283x registers, which the Pi 5 no longer has (GPIO sits behind the RP1 chip). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -9,7 +9,16 @@ main_user: root
|
|||||||
|
|
||||||
mediapi_has_hifiberry_amp: true
|
mediapi_has_hifiberry_amp: true
|
||||||
mediapi_ir_control: irserver
|
mediapi_ir_control: irserver
|
||||||
mediapi_has_dhtsensor: true
|
# Off for the Pi 5: the legacy Adafruit_DHT library bit-bangs the BCM283x registers,
|
||||||
|
# which the Pi 5 no longer has (GPIO sits behind the RP1 chip), so the poller cannot
|
||||||
|
# work there. Needs a libgpiod-based replacement before this goes back to true.
|
||||||
|
mediapi_has_dhtsensor: false
|
||||||
|
|
||||||
|
# Raspberry Pi 5. The SD card came from a Pi 4, whose image has no Pi 5 kernel.
|
||||||
|
pi_standard_setup_install_pi5_kernel: true
|
||||||
|
# The Pi is fed 5V through the HiFiBerry board's GPIO header, not USB-C, so it cannot
|
||||||
|
# negotiate a 5A supply and would cap USB current at 600mA.
|
||||||
|
hifiberry_powers_pi: true
|
||||||
|
|
||||||
# Display-only MusicMouse instance: no physical mouse attached, shown on the monitor
|
# Display-only MusicMouse instance: no physical mouse attached, shown on the monitor
|
||||||
# via pi_kiosk instead. See roles/pi_musicmouse/files/config-musicdolphin.yml.
|
# via pi_kiosk instead. See roles/pi_musicmouse/files/config-musicdolphin.yml.
|
||||||
|
|||||||
@@ -3,4 +3,7 @@
|
|||||||
Deactivates the Pi's onboard analog audio and activates a HiFiBerry
|
Deactivates the Pi's onboard analog audio and activates a HiFiBerry
|
||||||
amp/DAC overlay instead.
|
amp/DAC overlay instead.
|
||||||
|
|
||||||
**Key vars:** `hifiberry_overlay`
|
**Key vars:** `hifiberry_overlay`, `hifiberry_powers_pi`
|
||||||
|
|
||||||
|
`hifiberry_powers_pi` (default `false`) is for a Pi fed through the HiFiBerry board's
|
||||||
|
GPIO header. On a Pi 5 that sets `usb_max_current_enable=1`, or USB is capped at 600mA.
|
||||||
|
|||||||
2
roles/pi_hifiberry_amp/defaults/main.yml
Normal file
2
roles/pi_hifiberry_amp/defaults/main.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
---
|
||||||
|
hifiberry_powers_pi: false
|
||||||
@@ -11,3 +11,13 @@
|
|||||||
regexp: "^#?dtoverlay=hifiberry-amp"
|
regexp: "^#?dtoverlay=hifiberry-amp"
|
||||||
line: "dtoverlay={{ hifiberry_overlay }}"
|
line: "dtoverlay={{ hifiberry_overlay }}"
|
||||||
notify: Reboot
|
notify: Reboot
|
||||||
|
- name: Lift the Pi 5's USB current cap when the HiFiBerry board powers it
|
||||||
|
# A Pi 5 fed over the GPIO header has no USB-C power negotiation, so it assumes a
|
||||||
|
# weak supply and limits USB ports to 600mA. Unknown to a Pi 4, which ignores it.
|
||||||
|
ansible.builtin.lineinfile:
|
||||||
|
path: /boot/firmware/config.txt
|
||||||
|
regexp: "^#?usb_max_current_enable="
|
||||||
|
line: "usb_max_current_enable=1"
|
||||||
|
insertafter: EOF
|
||||||
|
when: hifiberry_powers_pi
|
||||||
|
notify: Reboot
|
||||||
|
|||||||
@@ -9,3 +9,8 @@ pi_standard_setup_wifi_pass_url: "bauer_wifi" # has to be in keepass with url "w
|
|||||||
ansible_ssh_pass: "raspberry"
|
ansible_ssh_pass: "raspberry"
|
||||||
ansible_become_password: "raspberry"
|
ansible_become_password: "raspberry"
|
||||||
ansible_become: true
|
ansible_become: true
|
||||||
|
|
||||||
|
# Install the Pi 5 (BCM2712) kernel, kernel_2712.img (an arm64 package, hence the :arm64 on
|
||||||
|
# the armhf userland). A card imaged on a Pi 4 does not have
|
||||||
|
# it, and a Pi 5 will not boot without. Harmless on a Pi 4, which keeps its own kernel.
|
||||||
|
pi_standard_setup_install_pi5_kernel: false
|
||||||
|
|||||||
@@ -115,6 +115,13 @@
|
|||||||
- telnet
|
- telnet
|
||||||
cache_valid_time: 7200
|
cache_valid_time: 7200
|
||||||
state: present
|
state: present
|
||||||
|
- name: Install the Pi 5 kernel
|
||||||
|
ansible.builtin.apt:
|
||||||
|
name: "linux-image-rpi-2712:arm64"
|
||||||
|
cache_valid_time: 7200
|
||||||
|
state: present
|
||||||
|
when: pi_standard_setup_install_pi5_kernel
|
||||||
|
notify: Reboot
|
||||||
- name: Copy vim config
|
- name: Copy vim config
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
src: vimrc
|
src: vimrc
|
||||||
|
|||||||
Reference in New Issue
Block a user