SpaceMusic: Difference between revisions
(Created page with "{{project |name = SpaceMusic |status = beta |image = |description = MPD Service to play music at the space |author = Jan |username = |...") |
No edit summary |
||
(8 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
{{outdated|type=space documentation}} | |||
{{project | {{project | ||
|name = SpaceMusic | |name = SpaceMusic | ||
|status = | |status = obsolete | ||
|image = | |image = | ||
|description = | |description = | ||
|author = [[User: | |author = [[User:Tiefpunkt|Severin]] | ||
|username = | |username = | ||
|version = | |version = | ||
Line 14: | Line 15: | ||
== What is it? == | == What is it? == | ||
We have | We have an awesome sound system at the space. It is attached to the [[Docker]] running an instance of mpd (music player daemon), as well as targets for AirPlay, UPnP and Spotify Connect. | ||
== Settings == | == Settings == | ||
IP: | * Hostname: music.intern.munichmakerlab.de | ||
Port: 6600 | * IP: 10.10.20.66 | ||
Password: ''none'' | * Port: 6600 | ||
* Password: ''none'' | |||
== How to use == | == How to use == | ||
You can control mpd using a media player client software. We recommend gmpc for Mausschubsers and ncmpc for the nerds. | You can control mpd using a media player client software. We recommend gmpc for Mausschubsers and ncmpc for the nerds. | ||
<code>ncmpc -h | <code>ncmpc -h 10.10.20.50</code> | ||
Alternatively, there's a webinterface at http://music.intern.munichmakerlab.de | |||
== MQTT Control == | |||
The MPD can also be controlled via MQTT. Therefore, we have a service running that translates MQTT messages into MPD commands. It's currently running on the [[Docker]] machine (10.10.20.66), and the code that's used can be found at https://github.com/munichmakerlab/mqtt2mpd | |||
Topics | |||
* <code>mumalab/mpd/command</code>: understands the following commands: play, pause, next, previous, toggle, volume up, volume down | |||
== Implementation Details == | |||
On docker01, we are running the following services: | |||
* [https://github.com/mikebrady/shairport-sync shairport-sync] for AirPlay | |||
** Installed via the standard Debian repository | |||
** Changed name in /etc/shairport-sync.conf | |||
* [https://wiki.gnome.org/Projects/Rygel Rygel] for UPnP Streaming | |||
** Installed from Debian repository | |||
** Configuration see below | |||
* [https://github.com/Spotifyd/spotifyd spotifyd] for Spotify Connect | |||
** Compiled from source, see below | |||
* MPD | |||
** Installed from Debian repository | |||
* YMPC as MPD Web Frontend | |||
** Running as a docker container | |||
=== Rygel === | |||
* Install via Debian repo | |||
<pre> | |||
apt install rygel rygel-playbin | |||
</pre> | |||
* Create dedicated user and group | |||
<pre> | |||
mkdir /var/lib/rygel | |||
groupadd -r rygel | |||
useradd -r -d /var/lib/rygel -g rygel -G audio rygel | |||
chown rygel:rygel /var/lib/rygel | |||
</pre> | |||
* Create Unitfile /lib/systemd/system/rygel.service | |||
<pre> | |||
[Unit] | |||
Description=Rygel DLNA server | |||
After=syslog.target | |||
[Service] | |||
User=rygel | |||
Group=rygel | |||
ExecStart=/usr/bin/rygel | |||
# ExecStart=/usr/bin/wrap-dbus /usr/bin/rygel | |||
[Install] | |||
WantedBy=multi-user.target | |||
</pre> | |||
* Enable and start systemd service | |||
<pre> | |||
systemctl daemon-reload | |||
systemctl enable rygel | |||
systemctl start rygel | |||
</pre> | |||
=== spotifyd === | |||
* Install prerequisites | |||
<pre> | |||
apt install libasound2-dev libssl-dev libpulse-dev libdbus-1-dev | |||
</pre> | |||
* Install rust -> https://rustup.rs/ | |||
* Download and compile | |||
<pre> | |||
git clone https://github.com/Spotifyd/spotifyd.git | |||
cd spotifyd | |||
cargo build --release | |||
cp target/release/spotifyd /usr/local/bin/ | |||
</pre> | |||
* Create group and user | |||
<pre> | |||
mkdir /var/lib/spotifyd | |||
groupadd -r spotifyd | |||
useradd -r -d /var/lib/spotifyd -g spotifyd -G audio spotifyd | |||
chown spotifyd:spotifyd /var/lib/spotifyd | |||
</pre> | |||
* Create Configuration file /etc/spotifyd.conf | |||
<pre> | |||
[global] | |||
# The name that gets displayed under the connect tab on | |||
# official clients. Spaces are not allowed! | |||
device_name = Soundsystem@MuMaLab | |||
# The audio bitrate. 96, 160 or 320 kbit/s | |||
bitrate = 160 | |||
</pre> | |||
* Create Unit file /lib/systemd/system/spotifyd.service | |||
<pre> | |||
[Unit] | |||
Description=Spotify Connect server | |||
After=syslog.target | |||
[Service] | |||
User=spotifyd | |||
Group=spotifyd | |||
ExecStart=/usr/local/bin/spotifyd --no-daemon | |||
[Install] | |||
WantedBy=multi-user.target | |||
</pre> | |||
* Enable and start systemd service | |||
<pre> | |||
systemctl daemon-reload | |||
systemctl enable spotifyd | |||
systemctl start spotifyd | |||
</pre> | |||
[[Category:Infrastructure]] |
Latest revision as of 12:04, 10 September 2022
SpaceMusic Release status: obsolete [box doku] | |
---|---|
Description | |
Author(s) | Severin |
What is it?
We have an awesome sound system at the space. It is attached to the Docker running an instance of mpd (music player daemon), as well as targets for AirPlay, UPnP and Spotify Connect.
Settings
- Hostname: music.intern.munichmakerlab.de
- IP: 10.10.20.66
- Port: 6600
- Password: none
How to use
You can control mpd using a media player client software. We recommend gmpc for Mausschubsers and ncmpc for the nerds.
ncmpc -h 10.10.20.50
Alternatively, there's a webinterface at http://music.intern.munichmakerlab.de
MQTT Control
The MPD can also be controlled via MQTT. Therefore, we have a service running that translates MQTT messages into MPD commands. It's currently running on the Docker machine (10.10.20.66), and the code that's used can be found at https://github.com/munichmakerlab/mqtt2mpd
Topics
mumalab/mpd/command
: understands the following commands: play, pause, next, previous, toggle, volume up, volume down
Implementation Details
On docker01, we are running the following services:
- shairport-sync for AirPlay
- Installed via the standard Debian repository
- Changed name in /etc/shairport-sync.conf
- Rygel for UPnP Streaming
- Installed from Debian repository
- Configuration see below
- spotifyd for Spotify Connect
- Compiled from source, see below
- MPD
- Installed from Debian repository
- YMPC as MPD Web Frontend
- Running as a docker container
Rygel
- Install via Debian repo
apt install rygel rygel-playbin
- Create dedicated user and group
mkdir /var/lib/rygel groupadd -r rygel useradd -r -d /var/lib/rygel -g rygel -G audio rygel chown rygel:rygel /var/lib/rygel
- Create Unitfile /lib/systemd/system/rygel.service
[Unit] Description=Rygel DLNA server After=syslog.target [Service] User=rygel Group=rygel ExecStart=/usr/bin/rygel # ExecStart=/usr/bin/wrap-dbus /usr/bin/rygel [Install] WantedBy=multi-user.target
- Enable and start systemd service
systemctl daemon-reload systemctl enable rygel systemctl start rygel
spotifyd
- Install prerequisites
apt install libasound2-dev libssl-dev libpulse-dev libdbus-1-dev
- Install rust -> https://rustup.rs/
- Download and compile
git clone https://github.com/Spotifyd/spotifyd.git cd spotifyd cargo build --release cp target/release/spotifyd /usr/local/bin/
- Create group and user
mkdir /var/lib/spotifyd groupadd -r spotifyd useradd -r -d /var/lib/spotifyd -g spotifyd -G audio spotifyd chown spotifyd:spotifyd /var/lib/spotifyd
- Create Configuration file /etc/spotifyd.conf
[global] # The name that gets displayed under the connect tab on # official clients. Spaces are not allowed! device_name = Soundsystem@MuMaLab # The audio bitrate. 96, 160 or 320 kbit/s bitrate = 160
- Create Unit file /lib/systemd/system/spotifyd.service
[Unit] Description=Spotify Connect server After=syslog.target [Service] User=spotifyd Group=spotifyd ExecStart=/usr/local/bin/spotifyd --no-daemon [Install] WantedBy=multi-user.target
- Enable and start systemd service
systemctl daemon-reload systemctl enable spotifyd systemctl start spotifyd