Coder Social home page Coder Social logo

mpdpi's Introduction

MPD on the Raspberry Pi

This project installs MPD on the Raspberry Pi, copies the web radio playlist and starts playing. Endlessly.

Also, it is possible to stream AirPlay to the Raspberry Pi via shairport-sync.

Install

This project uses Ansible but does not really explain much about Ansible. It's mostly targeted at myself while being open source. Adapt the hosts.ini, then run the playbook:

ansible-playbook playbook.yml

The installation is specifically made for a Raspberry Pi 3B with 64-bit Raspberry Pi OS bookworm. On other systems you may have to adapt the installation.

Allow usage of mpc volume

mpc volume does not seem to work out of the box. Find the control you want to set via amixer scontents.

For the AUX on the Raspberry this is 'Headphone':

Simple mixer control 'Headphone',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback -10239 - 400
  Mono: Playback -2791 [70%] [-27.91dB] [on]

For the HiFiBerry Amp2 this is 'Digital' (after you configure it):

Simple mixer control 'Digital',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 207
  Mono:
  Front Left: Playback 104 [50%] [-51.50dB] [on]
  Front Right: Playback 104 [50%] [-51.50dB] [on]

Set this control in the mpd.conf:

audio_output {
        type            "alsa"
        name            "My ALSA Device"
        mixer_control   "Headphone"
}

(Sadly I had no luck setting that controller as Alsa default in order to let MPD autodetect it. Hints welcome!)

Configure automatic restart

The FRITZ!Box at home automatically resets the network connection at 5-6. MPD is stuck after that and does not continue to play. Shortly after that the mpd should be restarted in order to continue playback. This is currently done at 6:05 by a systemd service.

Changing the time can be done inside the systemd/mpd-restart.timer file. Rerun the install.sh script in order to apply the change.

mpd-internetradio-destuck fixes the same issue but independently of time. The install.sh script downloads the deb package for 64-bit Raspberry Pi 3 and later (arm64). When running an ARMv6 or ARMv7 OS adapt the download link in the install.sh.

Know Issues

When shairport-sync is running, the volume is set higher in order to be able to adjust the volume from the AirPlay source. When the pi is rebooted while it's playing via AirPlay and gets restarted, the volume is still high. The internet radio after the next startup WILL be loud.

mpdpi's People

Contributors

edjopato avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.