Compare commits
17 Commits
2398460728
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 26a7c27a52 | |||
| 1bf7a0529b | |||
| a3b5326365 | |||
| f543c70876 | |||
| 372352e779 | |||
| e9e19a266c | |||
| cd77f8699c | |||
| 6f89fc468c | |||
| e625fbd31a | |||
| effd43bbaf | |||
| 4d6d9b6c41 | |||
| 0c04ba5b55 | |||
| 2c59efc971 | |||
| 26c06e2c37 | |||
| 2c6e3cf1af | |||
| 666691cfc1 | |||
| 962efeadff |
186
README.md
186
README.md
@@ -1,117 +1,151 @@
|
|||||||
# Hardware
|
# pi.speaker
|
||||||
- Raspberry PI W
|
|
||||||
- HiFiBerry - DAC Plus
|
- [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
|
||||||
|
|
||||||
# Setup
|
|
||||||
## Operating System
|
## Operating System
|
||||||
[Raspberry PI OS](/marcio.fernandes/raspberrypi)
|
|
||||||
|
[Raspberry PI OS](https://www.raspberrypi.com) bookworm.
|
||||||
|
|
||||||
## HiFiBerry Setup
|
## HiFiBerry Setup
|
||||||
|
|
||||||
*[Information source](https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/)*
|
*[Information source](https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/)*
|
||||||
|
|
||||||
Remove/comment from /boot/config.txt if it exists, for disabling onboard sound.
|
```bash
|
||||||
|
#/boot/firmware/config.txt
|
||||||
|
|
||||||
dtparam=audio=on
|
# disable onboard audio
|
||||||
|
#dtparam=audio=on
|
||||||
|
|
||||||
Add this lines to /boot/config.txt
|
# configurations for hifiberry-dacplus
|
||||||
|
force_eeprom_read=0
|
||||||
|
dtoverlay=hifiberry-dacplus
|
||||||
|
```
|
||||||
|
|
||||||
force_eeprom_read=0
|
``` bash
|
||||||
dtoverlay=hifiberry-dacplus
|
# list audio devices
|
||||||
|
aplay -l
|
||||||
|
```
|
||||||
|
|
||||||
Copy/download file [etc/asound.conf](etc/asound.conf) to /etc/
|
**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
|
Reboot
|
||||||
|
|
||||||
## SqueezeLite
|
## SqueezeLite
|
||||||
*Requires Logitech Media Server check [instructions](/marcio.fernandes/lms) for setup*
|
|
||||||
### Install
|
|
||||||
1. Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) SqueezeLite
|
|
||||||
1. Download latest version
|
|
||||||
|
|
||||||
cd /tmp
|
*Requires Logitech Media Server check [instructions](/marcio.fernandes/lms) for server setup*
|
||||||
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-1.9.9.1392-armhf.tar.gz
|
|
||||||
|
|
||||||
1. Untar downloaded files
|
**Install:**
|
||||||
|
|
||||||
tar -xvzf squeezelite-1.9.9.1392-armhf.tar.gz
|
Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) SqueezeLite.
|
||||||
|
|
||||||
1. Move untar file file to /usr/bin/
|
```bash
|
||||||
|
# set version
|
||||||
|
FILE="squeezelite-2.0.0.1541-armhf.tar.gz"
|
||||||
|
|
||||||
sudo mv squeezelite /usr/bin
|
cd /tmp
|
||||||
|
# Download
|
||||||
|
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/$FILE
|
||||||
|
|
||||||
1. Check if is executable
|
# untar file
|
||||||
|
tar -xvzf "$FILE"
|
||||||
|
|
||||||
ls -la /usr/bin/squeezelite
|
# move to bin
|
||||||
|
sudo mv squeezelite /usr/local/bin
|
||||||
|
sudo chmod +x /usr/local/bin/squeezelite
|
||||||
|
```
|
||||||
|
|
||||||
1. If not make executable
|
**Manual initialization:**
|
||||||
|
|
||||||
sudo chmod +x /usr/bin/squeezelite
|
``` bash
|
||||||
|
squeezelite
|
||||||
|
```
|
||||||
|
|
||||||
### Setup as service
|
**Setup as service:**
|
||||||
|
|
||||||
Download/copy file [etc/systemd/system/squeezelite.service](etc/systemd/system/squeezelite.service) to /etc/systemd/system/
|
Download/copy file [etc/systemd/system/squeezelite.service](/etc/systemd/system/squeezelite.service) to /etc/systemd/system/
|
||||||
|
|
||||||
*check file for squeezelite configurations*
|
*check file for squeezelite configurations*
|
||||||
*squeezelite --help for arguments*
|
*squeezelite --help for arguments*
|
||||||
|
*if used with bluealsa only one can be running*
|
||||||
|
|
||||||
Start service
|
Start service:
|
||||||
*if used with bluealsa only one can be running*
|
|
||||||
|
|
||||||
sudo systemctl start squeezelite
|
```bash
|
||||||
|
sudo systemctl enable squeezelite
|
||||||
|
sudo systemctl start squeezelite
|
||||||
|
sudo systemctl status squeezelite
|
||||||
|
```
|
||||||
|
|
||||||
Enable on boot
|
## alsa plugin equalizer
|
||||||
*if used with bluealsa only one can be used on boot*
|
|
||||||
|
|
||||||
sudo systemctl enable squeezelite
|
Install:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo apt install -y libasound2-plugin-equal
|
||||||
|
```
|
||||||
|
|
||||||
|
Manual usage:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
alsamixer -D equal
|
||||||
|
```
|
||||||
|
|
||||||
## Bluealsa/bluealsa-aplay
|
## Bluealsa/bluealsa-aplay
|
||||||
*Using pi as bluetooth speaker*
|
|
||||||
|
|
||||||
## Install
|
*Using pi as bluetooth speaker:*
|
||||||
|
|
||||||
sudo apt update && sudo apt install bluealsa -y
|
Install:
|
||||||
|
|
||||||
## Setup as service
|
```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
|
Start on boot
|
||||||
|
|
||||||
sudo service bluealsa enable && sudo service bluealsa start
|
```bash
|
||||||
|
sudo systemctl enable bluealsaaplay
|
||||||
### bluealsa-aplay as service
|
```
|
||||||
Download/copy file [etc/systemd/system/bluealsaaplay.service](etc/systemd/system/bluealsaaplay.service) to /etc/systemd/system/
|
|
||||||
|
|
||||||
Enable service on boot
|
|
||||||
*if used with squeezelite only one can be used on boot*
|
|
||||||
|
|
||||||
sudo systemctl enable bluealsaaplay
|
|
||||||
|
|
||||||
Start service
|
|
||||||
*if used with squeezelite only one can be running*
|
|
||||||
|
|
||||||
sudo systemctl start bluealsaaplay
|
|
||||||
|
|
||||||
## bluealsa-aplay and Squeezelite
|
|
||||||
|
|
||||||
Squeelite on boot
|
|
||||||
|
|
||||||
sudo systemctl enable squeezelite
|
|
||||||
|
|
||||||
Change to bluealsa-aplay
|
|
||||||
|
|
||||||
sudo sh -c 'systemctl stop squeezelite; systemctl start bluealsaaplay'
|
|
||||||
|
|
||||||
Change to squeezelite
|
|
||||||
|
|
||||||
sudo sh -c 'systemctl stop bluealsaaplay; systemctl start squeezelite'
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +0,0 @@
|
|||||||
pcm.!default {
|
|
||||||
type hw card 0
|
|
||||||
}
|
|
||||||
ctl.!default {
|
|
||||||
type hw card 0
|
|
||||||
}
|
|
||||||
10
etc/onlyone/config.yaml
Normal file
10
etc/onlyone/config.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
defaultProcess: squeezelite
|
||||||
|
processes:
|
||||||
|
- key: squeezelite
|
||||||
|
cmd: /usr/local/bin/squeezelite -o equal -n "Living Room" -v
|
||||||
|
- key: bluetooth
|
||||||
|
cmd: bluealsa-aplay 00:00:00:00:00:00
|
||||||
|
mqtt: #only define if control from mqtt needed
|
||||||
|
brokerAddress: "192.168.1.251" # address of mqtt broker
|
||||||
|
topic: "home/devices/$CLIENTID/audio/input" # topic
|
||||||
|
brokerPort: 8883 # mqtt broker port
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
# file located at /lib/systemd/system/
|
#/etc/systemd/system/squeezelite.service
|
||||||
|
|
||||||
|
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -16,7 +16,11 @@ User=root
|
|||||||
# note use your mac address as given by ifconfig and the name you wish to give your player
|
# note use your mac address as given by ifconfig and the name you wish to give your player
|
||||||
#ExecStart=/usr/bin/squeezelite -n "PlayerName"
|
#ExecStart=/usr/bin/squeezelite -n "PlayerName"
|
||||||
#by default use pi name
|
#by default use pi name
|
||||||
ExecStart=/usr/bin/squeezelite
|
ExecStart=/usr/local/bin/squeezelite -s lms.lan
|
||||||
|
ExecStartPre=/bin/sleep 3
|
||||||
|
Restart=on-failure
|
||||||
|
RestartSec=10
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user