Files
pi.bluetooth.speaker/README.md
2022-01-21 12:12:11 +00:00

3.7 KiB

Hardware

  • Raspberry PI W
  • HiFiBerry - DAC Plus

Setup

Operating System

Raspberry PI OS

HiFiBerry Setup

Information source

Remove/comment from /boot/config.txt if it exists, for disabling onboard sound.

dtparam=audio=on

Add this lines to /boot/config.txt

force_eeprom_read=0
dtoverlay=hifiberry-dacplus

Copy/download file etc/asound.conf to /etc/

Reboot

Bluealsa/bluealsa-aplay

Using pi as bluetooth speaker

Install

sudo apt update && 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 utility

Service Setup

Atention! Step not required if using onlyone utility

if used with squeezelite only one can be used on boot Download/copy file etc/systemd/system/bluealsaaplay.service to /etc/systemd/system/

Start service

sudo systemctl start bluealsaaplay

Start on boot

sudo systemctl enable bluealsaaplay

SqueezeLite

Requires Logitech Media Server check instructions for server setup

Install

  1. Check latest version SqueezeLite

  2. Download latest version

    cd /tmp
    wget https://sourceforge.net/projects/lmsclients/files/squeezelite/linux/squeezelite-1.9.9.1392-armhf.tar.gz  
    
  3. Untar downloaded files

    tar -xvzf squeezelite-1.9.9.1392-armhf.tar.gz
    
  4. Move untar file file to /usr/local/bin/

    sudo mv squeezelite /usr/local/bin      
    
  5. Check if is executable

    ls -la /usr/local/bin/squeezelite
    
  6. If not make executable

    sudo chmod +x /usr/local/bin/squeezelite
    

Setup

ALSA only allows one application using sound (bad sound quality experience with DMUX or pulseaudio). To control service start/stop use onlyone utility

Manual initialization

/usr/bin/squeezelite

Setup as service

Atention! Step not required if using onlyone utility
Download/copy file 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

sudo systemctl start squeezelite

Enable on boot

sudo systemctl enable squeezelite

onlyone - utility

Prerequisites

  • Git

    sudo apt install git
    

Setup

  1. Download git

     cd /srv  
     git clone https://git.limbosolutions.com/marcio.fernandes/onlyone.git  
    
  2. Copy/download configuration file to /etc/onlyone

  3. Change configuration file squeezelite player name

  4. Setup as service
    Copy/download service file 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