152 lines
2.6 KiB
Markdown
152 lines
2.6 KiB
Markdown
# pi.speaker
|
|
|
|
- [Hardware](#hardware)
|
|
- [Operating System](#operating-system)
|
|
- [HiFiBerry Setup](#hifiberry-setup)
|
|
- [SqueezeLite](#squeezelite)
|
|
- [alsa plugin equalizer](#alsa-plugin-equalizer)
|
|
- [Bluealsa/bluealsa-aplay](#bluealsabluealsa-aplay)
|
|
|
|
## Hardware
|
|
|
|
- Raspberry PI W
|
|
- HiFiBerry - DAC Plus
|
|
|
|
## Operating System
|
|
|
|
[Raspberry PI OS](https://www.raspberrypi.com) bookworm.
|
|
|
|
## HiFiBerry Setup
|
|
|
|
*[Information source](https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/)*
|
|
|
|
```bash
|
|
#/boot/firmware/config.txt
|
|
|
|
# disable onboard audio
|
|
#dtparam=audio=on
|
|
|
|
# configurations for hifiberry-dacplus
|
|
force_eeprom_read=0
|
|
dtoverlay=hifiberry-dacplus
|
|
```
|
|
|
|
``` bash
|
|
# list audio devices
|
|
aplay -l
|
|
```
|
|
|
|
**Set /etc/asound.conf:**
|
|
|
|
*Replace with sound card number.*
|
|
```bash
|
|
#/etc/asound.conf
|
|
defaults.pcm.card 1
|
|
defaults.pcm.device 1
|
|
defaults.ctl.card 1
|
|
```
|
|
|
|
Reboot
|
|
|
|
## SqueezeLite
|
|
|
|
*Requires Logitech Media Server check [instructions](/marcio.fernandes/lms) for server setup*
|
|
|
|
**Install:**
|
|
|
|
Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) SqueezeLite.
|
|
|
|
```bash
|
|
# set version
|
|
FILE="squeezelite-2.0.0.1541-armhf.tar.gz"
|
|
|
|
cd /tmp
|
|
# Download
|
|
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/$FILE
|
|
|
|
# untar file
|
|
tar -xvzf "$FILE"
|
|
|
|
# move to bin
|
|
sudo mv squeezelite /usr/local/bin
|
|
sudo chmod +x /usr/local/bin/squeezelite
|
|
```
|
|
|
|
**Manual initialization:**
|
|
|
|
``` bash
|
|
squeezelite
|
|
```
|
|
|
|
**Setup as service:**
|
|
|
|
Download/copy file [etc/systemd/system/squeezelite.service](/etc/systemd/system/squeezelite.service) to /etc/systemd/system/
|
|
|
|
*check file for squeezelite configurations*
|
|
*squeezelite --help for arguments*
|
|
*if used with bluealsa only one can be running*
|
|
|
|
Start service:
|
|
|
|
```bash
|
|
sudo systemctl enable squeezelite
|
|
sudo systemctl start squeezelite
|
|
sudo systemctl status squeezelite
|
|
```
|
|
|
|
## alsa plugin equalizer
|
|
|
|
Install:
|
|
|
|
```bash
|
|
sudo apt install -y libasound2-plugin-equal
|
|
```
|
|
|
|
Manual usage:
|
|
|
|
```bash
|
|
alsamixer -D equal
|
|
```
|
|
|
|
## Bluealsa/bluealsa-aplay
|
|
|
|
*Using pi as bluetooth speaker:*
|
|
|
|
Install:
|
|
|
|
```bash
|
|
sudo apt install bluealsa -y
|
|
```
|
|
|
|
Start on boot:
|
|
|
|
```bash
|
|
sudo service bluealsa enable && sudo service bluealsa start
|
|
```
|
|
|
|
Manual initialization:
|
|
|
|
```bash
|
|
bluealsa-aplay 00:00:00:00:00:00
|
|
```
|
|
|
|
Automatically on boot:
|
|
|
|
ALSA only allows one application using sound (bad sound quality experience with DMUX or pulseaudio).
|
|
|
|
|
|
Download/copy file [etc/systemd/system/bluealsaaplay.service](etc/systemd/system/bluealsaaplay.service) to /etc/systemd/system/
|
|
|
|
Start service
|
|
|
|
```bash
|
|
sudo systemctl start bluealsaaplay
|
|
```
|
|
|
|
Start on boot
|
|
|
|
```bash
|
|
sudo systemctl enable bluealsaaplay
|
|
```
|
|
|