revision after reinstall
This commit is contained in:
259
README.md
259
README.md
@@ -1,180 +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)
|
|
||||||
|
|
||||||
## alsa plugin equalizer
|
[Raspberry PI OS](https://www.raspberrypi.com) bookworm.
|
||||||
|
|
||||||
### Install
|
|
||||||
|
|
||||||
sudo apt install -y libasound2-plugin-equal
|
|
||||||
|
|
||||||
### Hot to use
|
|
||||||
|
|
||||||
alsamixer -D equal
|
|
||||||
|
|
||||||
## 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
|
||||||
|
|
||||||
## Bluealsa/bluealsa-aplay
|
|
||||||
*Using pi as bluetooth speaker*
|
|
||||||
|
|
||||||
### Install
|
|
||||||
|
|
||||||
sudo apt install bluealsa -y
|
|
||||||
|
|
||||||
|
|
||||||
### Start on boot
|
|
||||||
|
|
||||||
sudo service bluealsa enable && sudo service bluealsa start
|
|
||||||
|
|
||||||
### How to use
|
|
||||||
|
|
||||||
#### Manual initialization
|
|
||||||
|
|
||||||
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). To control service start/stop use [onlyone](#onlyone) utility
|
|
||||||
|
|
||||||
|
|
||||||
#### Service Setup
|
|
||||||
**Atention! Step not required if using [onlyone](#onlyone) utility**
|
|
||||||
|
|
||||||
*if used with squeezelite only one can be used on boot*
|
|
||||||
|
|
||||||
Download/copy file [etc/systemd/system/bluealsaaplay.service](etc/systemd/system/bluealsaaplay.service) to /etc/systemd/system/
|
|
||||||
|
|
||||||
Start service
|
|
||||||
|
|
||||||
sudo systemctl start bluealsaaplay
|
|
||||||
|
|
||||||
Start on boot
|
|
||||||
|
|
||||||
sudo systemctl enable bluealsaaplay
|
|
||||||
|
|
||||||
|
|
||||||
## SqueezeLite
|
## SqueezeLite
|
||||||
|
|
||||||
*Requires Logitech Media Server check [instructions](/marcio.fernandes/lms) for server setup*
|
*Requires Logitech Media Server check [instructions](/marcio.fernandes/lms) for server setup*
|
||||||
|
|
||||||
### Install
|
**Install:**
|
||||||
1. Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) SqueezeLite
|
|
||||||
1. Download latest version
|
|
||||||
|
|
||||||
cd /tmp
|
Check latest [version](https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/) SqueezeLite.
|
||||||
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-1.9.9.1392-armhf.tar.gz
|
|
||||||
|
|
||||||
1. Untar downloaded files
|
```bash
|
||||||
|
# set version
|
||||||
|
FILE="squeezelite-2.0.0.1541-armhf.tar.gz"
|
||||||
|
|
||||||
tar -xvzf squeezelite-1.9.9.1392-armhf.tar.gz
|
cd /tmp
|
||||||
|
# Download
|
||||||
|
wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/$FILE
|
||||||
|
|
||||||
1. Move untar file file to /usr/local/bin/
|
# untar file
|
||||||
|
tar -xvzf "$FILE"
|
||||||
|
|
||||||
sudo mv squeezelite /usr/local/bin
|
# move to bin
|
||||||
|
sudo mv squeezelite /usr/local/bin
|
||||||
|
sudo chmod +x /usr/local/bin/squeezelite
|
||||||
|
```
|
||||||
|
|
||||||
1. Check if is executable
|
**Manual initialization:**
|
||||||
|
|
||||||
ls -la /usr/local/bin/squeezelite
|
``` bash
|
||||||
|
squeezelite
|
||||||
|
```
|
||||||
|
|
||||||
1. If not make executable
|
**Setup as service:**
|
||||||
|
|
||||||
sudo chmod +x /usr/local/bin/squeezelite
|
Download/copy file [etc/systemd/system/squeezelite.service](/etc/systemd/system/squeezelite.service) to /etc/systemd/system/
|
||||||
|
|
||||||
### Setup
|
|
||||||
ALSA only allows one application using sound (bad sound quality experience with DMUX or pulseaudio). To control service start/stop use [onlyone](#onlyone) utility
|
|
||||||
|
|
||||||
#### Manual initialization
|
|
||||||
|
|
||||||
/usr/bin/squeezelite
|
|
||||||
|
|
||||||
#### Setup as service
|
|
||||||
**Atention! Step not required if using [onlyone](#onlyone) utility**
|
|
||||||
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*
|
*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
|
Start service
|
||||||
|
|
||||||
sudo systemctl start squeezelite
|
```bash
|
||||||
|
sudo systemctl start bluealsaaplay
|
||||||
Enable on boot
|
```
|
||||||
|
|
||||||
sudo systemctl enable squeezelite
|
|
||||||
|
|
||||||
## onlyone
|
|
||||||
|
|
||||||
[Git repository](/marcio.fernandes/onlyone)
|
|
||||||
|
|
||||||
**Prerequisites**
|
|
||||||
- Git
|
|
||||||
|
|
||||||
sudo apt install git
|
|
||||||
|
|
||||||
- Chech [Git repository](/marcio.fernandes/onlyone) for more information on dependencies
|
|
||||||
|
|
||||||
|
|
||||||
### Setup
|
|
||||||
|
|
||||||
1. Download git
|
|
||||||
|
|
||||||
|
|
||||||
git clone https://git.limbosolutions.com/marcio.fernandes/onlyone.git
|
|
||||||
cp -r onlyone/onlyone /srv
|
|
||||||
|
|
||||||
1. Copy/download [configuration file](etc/onlyone/config.yaml) to /etc/onlyone
|
|
||||||
|
|
||||||
1. Change configuration file squeezelite player name
|
|
||||||
|
|
||||||
1. Setup as service
|
|
||||||
Copy/download [service file](etc/systemd/system/onlyone.service) to etc/system/systemd
|
|
||||||
|
|
||||||
sudo systemctl enable onlyone.service && sudo systemctl start onlyone.service
|
|
||||||
|
|
||||||
### How to use onlyone
|
|
||||||
- user must be part of group onlyone (group is created on first service start)
|
|
||||||
|
|
||||||
usermod -a -G onlyone USERNAME
|
|
||||||
|
|
||||||
- Start squeezelite
|
|
||||||
|
|
||||||
echo "squeezelite" > /tmp/onlyone_fifo
|
|
||||||
|
|
||||||
- Start bluealsaaplay
|
|
||||||
|
|
||||||
echo "bluetooth" > /tmp/onlyone_fifo
|
|
||||||
|
|
||||||
- checking onlyone for errors or Information
|
|
||||||
|
|
||||||
sudo systemctl status onlyone
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Start on boot
|
||||||
|
|
||||||
|
```bash
|
||||||
|
sudo systemctl enable bluealsaaplay
|
||||||
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +0,0 @@
|
|||||||
pcm.!default {
|
|
||||||
type plug
|
|
||||||
slave.pcm plugequal;
|
|
||||||
}
|
|
||||||
ctl.!default {
|
|
||||||
type hw card 0
|
|
||||||
}
|
|
||||||
ctl.equal {
|
|
||||||
type equal;
|
|
||||||
}
|
|
||||||
pcm.plugequal {
|
|
||||||
type equal;
|
|
||||||
slave.pcm "plughw:0,0";
|
|
||||||
}
|
|
||||||
pcm.equal {
|
|
||||||
type plug;
|
|
||||||
slave.pcm plugequal;
|
|
||||||
}
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
# file located at /lib/systemd/system/
|
|
||||||
|
|
||||||
|
|
||||||
[Unit]
|
|
||||||
Description=onlyone
|
|
||||||
|
|
||||||
Requires=network.target sound.target
|
|
||||||
After=network.target sound.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=simple
|
|
||||||
|
|
||||||
# change for user you want!
|
|
||||||
User=root
|
|
||||||
|
|
||||||
# note use your mac address as given by ifconfig and the name you wish to give your player
|
|
||||||
Environment=PYTHONPATH=/srv
|
|
||||||
ExecStart=/usr/bin/python3 -m onlyone --server
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -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/local/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