Compare commits

..

20 Commits

Author SHA1 Message Date
26a7c27a52 revision after reinstall 2025-09-28 23:35:19 +01:00
1bf7a0529b Update 'etc/onlyone/config.yaml' 2022-01-22 11:16:29 +00:00
a3b5326365 Update 'README.md' 2022-01-21 14:04:31 +00:00
f543c70876 Update 'etc/onlyone/config.yaml' 2022-01-21 14:00:24 +00:00
372352e779 Update 'etc/asound.conf' 2022-01-21 13:59:06 +00:00
e9e19a266c Update 'README.md' 2022-01-21 12:45:37 +00:00
cd77f8699c Update 'README.md' 2022-01-21 12:32:38 +00:00
6f89fc468c Update 'README.md' 2022-01-21 12:24:06 +00:00
e625fbd31a Update 'README.md' 2022-01-21 12:20:42 +00:00
effd43bbaf Update 'README.md' 2022-01-21 12:17:38 +00:00
4d6d9b6c41 Add 'etc/systemd/system/onlyone.service' 2022-01-21 12:14:31 +00:00
0c04ba5b55 Update 'etc/systemd/system/bluealsaaplay.service' 2022-01-21 12:13:10 +00:00
2c59efc971 Update 'README.md' 2022-01-21 12:12:11 +00:00
26c06e2c37 Update 'README.md' 2022-01-21 11:53:33 +00:00
2c6e3cf1af Add 'etc/onlyone/config.yaml' 2022-01-21 11:15:58 +00:00
666691cfc1 squeezelite 2022-01-18 09:12:59 +00:00
962efeadff squeezelite.service 2022-01-18 09:12:40 +00:00
2398460728 readme.md 2022-01-17 11:23:42 +00:00
a37f6fdd23 readme.md 2022-01-17 11:08:12 +00:00
02b6d792e7 readme.md 2022-01-17 11:05:25 +00:00
5 changed files with 145 additions and 94 deletions

193
README.md
View File

@@ -1,108 +1,151 @@
# Hardware # pi.speaker
- Raspberry PI W
- HiFiBerry - DAC Plus
# Setup - [Hardware](#hardware)
- OS Setup, [Instructions](/marcio.fernandes/raspberrypi) - [Operating System](#operating-system)
- HiFiBerry Setup ([Information source](https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/)) - [HiFiBerry Setup](#hifiberry-setup)
- [SqueezeLite](#squeezelite)
- [alsa plugin equalizer](#alsa-plugin-equalizer)
- [Bluealsa/bluealsa-aplay](#bluealsabluealsa-aplay)
- Remove/comment from /boot/config.txt if it exists, for disabling onboard sound. ## Hardware
dtparam=audio=on - Raspberry PI W
- HiFiBerry - DAC Plus
- Add this lines to /boot/config.txt ## Operating System
force_eeprom_read=0 [Raspberry PI OS](https://www.raspberrypi.com) bookworm.
dtoverlay=hifiberry-dacplus
- Copy file etc/asound.conf ## HiFiBerry Setup
- Reboot *[Information source](https://www.hifiberry.com/docs/software/configuring-linux-3-18-x/)*
- SqueezeLite ```bash
- Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) #/boot/firmware/config.txt
- Download latest version
cd /tmp # disable onboard audio
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-1.9.9.1392-armhf.tar.gz #dtparam=audio=on
- Untar downloaded files # configurations for hifiberry-dacplus
force_eeprom_read=0
dtoverlay=hifiberry-dacplus
```
tar -xvzf squeezelite-1.9.9.1392-armhf.tar.gz ``` bash
# list audio devices
aplay -l
```
- Move untar file file to /usr/bin/ **Set /etc/asound.conf:**
sudo mv squeezelite /usr/bin *Replace with sound card number.*
```bash
#/etc/asound.conf
defaults.pcm.card 1
defaults.pcm.device 1
defaults.ctl.card 1
```
- Check if is executable Reboot
ls -la /usr/bin/squeezelite ## SqueezeLite
- If not make executable *Requires Logitech Media Server check [instructions](/marcio.fernandes/lms) for server setup*
sudo chmod +x /usr/bin/squeezelite **Install:**
- Start on boot (as a service) Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) SqueezeLite.
- Download/copy file [etc/systemd/system/squeezelite.service](etc/systemd/system/squeezelite.service) to /etc/systemd/system/ ```bash
*check file for squeezelite configurations* # set version
*squeezelite --help for arguments* FILE="squeezelite-2.0.0.1541-armhf.tar.gz"
- Start service cd /tmp
*if used with bluealsa only one can be running* # Download
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/$FILE
sudo systemctl start squeezelite # untar file
tar -xvzf "$FILE"
- Enable service on boot
*if used with bluealsa only one can be used on boot*
sudo systemctl enable squeezelite
- Bluealsa - using pi as bluetooth speaker
- Install
sudo apt update && sudo apt install bluealsa -y
- Start on boot (as a service)
sudo service bluealsa enable && sudo service bluealsa start
- Setup bluealsa-aplay
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 squeelite
- 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'
# 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
```

View File

@@ -1,6 +0,0 @@
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}

10
etc/onlyone/config.yaml Normal file
View 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

View File

@@ -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