- Raspberry Pi 3 only (due to optimization option)
- OS: Raspbian stretch (2017-11-29)
- Music format: mp3, m4a, flac (no dsd)
- Play music stored in a NAS via wired lan (no usb)
- Scrobble to last.fm
- I2S DAC: Hifiberry DAC+ Pro compatible board
- For Japanese (NTP, timezone and language setting)
- Network: dhcp, wired lan
- Write the raspbian image on Windows
Mirror on Japan
- http://ftp.jaist.ac.jp/pub/raspberrypi/raspbian_lite/images/
- https://www.raspbian.org/RaspbianMirrors
Use etcher
Create a file named ssh
on the root folder
- user: pi
- pass: raspberry
The following are configured automatically.
- Build the latest alsa-lib, libflac, mpg123, FFmpeg and MPD with optimization options for Raspberry Pi 3
- Specify high priority to MPD tasks
- Turn off the power led after initialization
- Provide cover art via http using nginx
- Scrobble to last.fm using mpdas
- Disable swap, HDMI, Wi-Fi, Bluetooth, UART, onboard audio, usb-power and unnecessary service
- Put temp and log files to RAM disk
- Decrease GPU assigned memory
- Suppress rsyslog and nginx output
- Specify NTP server, timezone and language for Japanese
- Configure NAS
Download files:
mkdir ~/setup
cd ~/setup
wget https://gist.githubusercontent.com/estshorter/302449b697c1468bcfdb0bf31ed3b35e/raw -O ./setup.sh
chmod u+x ./setup.sh
File urls:
- raspi-autosetup.sh: https://gist.github.com/estshorter/302449b697c1468bcfdb0bf31ed3b35e
Execute all scripts:
Note: specify NAS_USER, NAS_PASS, NAS_ADDR, LAST_FM_USER, LAST_FM_PASS
before third executing.
cd ~/setup
./setup.sh
sudo reboot
cd ~/setup
./setup.sh
sudo reboot
export NAS_USER=user
export NAS_PASS='pass'
export NAS_ADDR=addr
export LAST_FM_USER=user
export LAST_FM_PASS='pass'
cd ~/setup
./setup.sh
sudo reboot
Note: I'm afraid most references in the scripts are written in Japanese.
One time
#!/bin/bash -e
echo none | sudo tee /sys/class/leds/led0/trigger > /dev/null # disable green led
echo none | sudo tee /sys/class/leds/led1/trigger > /dev/null # disable red led
echo 0 | sudo tee /sys/class/leds/led1/brightness > /dev/null
Forever
#!/bin/bash -ue
GREEN_LED_CMD="dtparam=act_led_trigger=none
dtoverlay=pi3-act-led,activelow=on"
echo "${GREEN_LED_CMD}" | sudo tee -a /boot/config.txt > /dev/null
echo "dtparam=pwr_led_trigger=none,pwr_led_activelow=on" | sudo tee -a /boot/config.txt > /dev/null
For CPU/GPU
- Ref: https://www.raspberrypi.org/documentation/configuration/config-txt/overclocking.md
- Ref: http://community.phileweb.com/mypage/entry/4787/20171122/
For SD card
- Ref: https://github.com/raspberrypi/linux/blob/rpi-4.9.y/arch/arm/boot/dts/overlays/README
- Ref: http://community.phileweb.com/mypage/entry/4787/20171105/57539/
sudo rpi-update
Create and edit /etc/apt/sources.list.d/upmpdcli.list
and add the following lines.
deb http://www.lesbonscomptes.com/upmpdcli/downloads/raspbian-stretch/ stretch main
deb-src http://www.lesbonscomptes.com/upmpdcli/downloads/raspbian-stretch/ stretch main
Setup:
sudo apt -y install dirmngr
gpg --keyserver pool.sks-keyservers.net --recv-key 'F8E3 3472 5692 2A8A E767 605B 7808 CE96 D38B 9201'
gpg --export '7808CE96D38B9201' | sudo apt-key add -
sudo apt -y update
sudo apt -y install upmpdcli