Difference between revisions of "SlabPi"

From NURDspace

Jump to: navigation, search
(Added description of Youtube)
 
(9 intermediate revisions by 4 users not shown)
Line 1: Line 1:
 
{{Inventory
 
{{Inventory
 
|Name=SlabPi
 
|Name=SlabPi
|Owner=Invict
+
|Owner=Space
 
|Status=Infra
 
|Status=Infra
 
|Hostname=slabpi.dhcp.nurd.space
 
|Hostname=slabpi.dhcp.nurd.space
Line 9: Line 9:
 
}}
 
}}
 
==What==
 
==What==
SlabPi is the replacement for [[Slab]] on a [https://www.raspberrypi.org/products/raspberry-pi-3-model-b/ Raspberry Pi 3]. It has been moved, because of [[downscaling]].
+
SlabPi is the replacement for [[Slab]] on a [https://www.raspberrypi.org/products/raspberry-pi-4-model-b/ Raspberry Pi 4]. It has been moved, because of [[downscaling]]. And recently got upgraded from a rpi3 to a rpi4, it has a DAC+ Hat for better audio quality.
It will be challenged with as much infra a Raspberry Pi can handle.
+
  
It runs the MPD Server and <s>espeak</s>. It is running on [https://www.raspberrypi.org/downloads/raspbian/ Raspbian Stretch Lite].
+
*OS: [https://wiki.ubuntu.com/ARM/RaspberryPi Ubuntu 19.10 aarch64]
 +
*Rpi: Raspberry pi 4 4GB
 +
*SD: 32GB
  
A DAC+ Hat has been added for better audio quality.
+
== Setup ==
  
==DAC+==
+
=== Disabled/removed services ===
 +
* disabled unattented-upgrades
 +
* disabled wpa_supplicant
 +
* disabled accounts-daemon
 +
* disabled multipathd
 +
* ubuntu motd spam
 +
* removed snapd
  
PiFi HIFI DAC+ Digital Audio Card added for better audio quality.
+
=== Networking ===
 +
It is hooked up with UTP. WLAN has been disabled.
 +
 
 +
==
 +
 
 +
===DAC+===
 +
 
 +
[https://www.itead.cc/hifi-dac-for-raspberry-pi.html PiFi HIFI DAC+] for better audio quality.
  
 
Installation:
 
Installation:
Line 30: Line 44:
 
  dtoverlay=hifiberry-dacplus
 
  dtoverlay=hifiberry-dacplus
  
==MPD==
+
===MPD===
 
+
<s>Currently runs through LiquidSoap, so there is a +- 30 second delay. Ask [[User:R3boot|r3boot]] ;).</s>
+
 
+
Fixed an issue where MPD hangs on song change. Fix it by uncommenting "device" option in the "audio_output" block (in my case ALSA) in mpd.conf.
+
This is a common error.
+
 
+
Connection through client.
+
  
 
Host: slabpi.dhcp.nurd.space
 
Host: slabpi.dhcp.nurd.space
  
Port: 6600
+
Port: 6600 (Technically 6005, see the mpd proxy service)
  
 
It is integrated with Home Assistant view on [[Jarvis]].
 
It is integrated with Home Assistant view on [[Jarvis]].
Line 49: Line 56:
 
* port 7777 (44100:16:2) used by Audiophiles
 
* port 7777 (44100:16:2) used by Audiophiles
  
==PulseAudio==
+
===PulseAudio===
The SlabPI is now running PulseAudio, this allows multiple streams to be play simultaneously without having to stop/kill MPD.
+
All pulseaudio changes need to be made in /etc/pulse/sytem.pa (default.pa isn't used)
  
<s>Eventually, PulseAudio will be made accessible through the network so everyone can dump their audio to the Slabpi.</s>
+
Pulseaudio is running as a system-wide daemon, it's default sample rate is set to 48Khz and priority has been set to real time.
Pulseaudio should be accessible over the network, I don't really know yet if it really works though.
+
  
==Icecast==
+
===Icecast===
There is an icecast server running again on port 8050. It's a direct feed from Pulseaudio so all sounds (Entrance themes, speak commands) will be heard on the stream. Perhaps I'll eventually make MPD send to icecast as well for a "clean signal"
+
There is an icecast server on port 8000. It's a direct feed from Pulseaudio so all sounds (Entrance themes, speak commands) will be heard on the stream.
  
 
Mount point(s):
 
Mount point(s):
 
 
* /nurds (Pulseaudio)
 
* /nurds (Pulseaudio)
  
 
== MPD Control ==
 
== MPD Control ==
For those not wanting to install a MPD client, there now runs a small MPD client on port 80 (ypmd) that can be used to directly control MPD.
+
For those not wanting to install a MPD client, there's a stand alone MPD web interface running called [https://github.com/jcorporation/myMPD Mympd] on port 80
  
 +
==Labelprinter implementation==
  
== Youtube ==
+
Labelprinter is up and running.
You can now add youtube links to MPD by sending (MQTT) the url as a payload to "mpd/youtube/play".
+
See [[Labelprinter]].
It will extract the audio from the video and throw it into MPD. If random mode is enabled, the song will get the highest priority so that it gets played next. However, right now this means that it's acts as a FIFO. If MPD is paused, it will play the song straight away and if it's in normal mode, it will put the song as next in the playlist.
+
  
 +
== Services ==
  
==espeak==
+
===Entrance Themes===
 +
* Location: /home/pi/scripts/theme_songs.py
 +
* Systemd-service: themesongs.service
 +
* Programmer: [[User:Melan]]
  
<s>Espeak is now functional, there were ALSA problems.</s> We Pulseaudio now!
+
A script which plays a part of a song for each individual member entering the space. See [[Entrance themes]].
  
==Motion webcam==
+
=== MPD Icecast update ===
Running motion for webcam, see [http://slabpi:8081/ this link]
+
* Location: /home/pi/scripts/mpd_icecast_update.py
 +
* Systemd-service: mpdicecastupdate.service
 +
* Programmer: [[User:Melan]]
  
Possible resolutions:
+
Updates the current now playing song from MPD to the icecast mount /nurds
  
* 160x120
+
=== Vu Meter ===
* 320x240
+
* Location: /opt/vu
* 640x480
+
* Systemd-service: vu.service
Can be checked with:
+
* Programmer: [[User:Zarya]]
v4l2-ctl --list-formats-ext
+
  
It is included in the Home Assistant view of [[Jarvis]].
+
https://gist.github.com/zarya/3d5447556296d6923bee232e4cc7fca1
  
==Labelprinter implementation==
+
=== Pixelvloed FFT ===
 +
* Location: /opt/pulse-pixelvloed-fft
 +
* Systemd-service: fft.service
 +
* Programmer: [[User:Zarya]]
  
Labelprinter is up and running.
+
=== Pixelvloed waterfall ===
See [[Labelprinter]].
+
* Location: /opt/pulse-pixelvloed-fft
 +
* Systemd-service: waterfall.service
 +
* Programmer: [[User:Zarya]]
 +
 
 +
=== hass-systemd-manager ===
 +
* Location: /opt/hass-systemd-manager
 +
* Systemd-service: waterfall.service
 +
* Programmer: [[User:Zarya]]
 +
* git: https://github.com/NURDspace/hass-systemd-manager
 +
 
 +
A python tool for starting and stopping systemd services via mqtt using homeassistant
 +
 
 +
=== Soundboard ===
 +
* Location: /home/pi/soundboard
 +
* Systemd-service: soundboard.service
 +
* Programmer: [[User:Melan]]
 +
 
 +
Allows samples to be triggered through MQTT, also handles the doorbell sound.
 +
 
 +
===  MPD Vol Proxy ===
 +
* Location: /home/pi/mpdVolProxy
 +
* Systemd-service: mpdvolproxy.service
 +
* Programmer: [[User:Melan]]
 +
 
 +
A small script that intercepts all the clients connecting to MPD on port 6000 and intercepts all setvol commands and instead delegates it to Pulseaudio, meaning that any volume command will not adjust MPD's output, put instead the output to the amplifier.
 +
 
 +
 
 +
=== MPDTube ===
 +
* Location: /home/pi/mpdtube
 +
* Systemd-service: mpdtube.service
 +
* Programmer: [[User:Melan]]
 +
* Git: https://github.com/NURDspace/MPDTube
  
==Entrance Themes==
+
This project has it's own wiki page, [[MPDTube]]
  
It has a script running which plays a part of a song for each individual member entering the space. See [[Entrance themes]].
 
  
==WIP==
+
=== PulseControl ===
 +
* Location: /home/pi/pulseControl
 +
* Programmer: [[User:Melan]]
  
* <strike>espeak [[Nurdbot]] implementation</strike> Seems to work!
+
Part of the multi-room audio setup, it will ping if any of the defined hosts are up and once they are it will add their pulseaudio instance to the output.
* Moar cams
+
* Move logging to mounted location to preserve the micro SD card quality.
+
* Backups
+
* Icecast server?
+
* Scrobble to last.fm?
+

Latest revision as of 15:39, 9 March 2020

SlabPi
Slabpi2.jpg
Owner Space
Status Infra
Hostname slabpi.dhcp.nurd.space
Location Near the amp
Tool No
Tool category

SlabPi

Slabpi2.jpg

{{{InventoryOwner}}}
"{{{InventoryOwner}}}" cannot be used as a page name in this wiki.

Near the amp

What

SlabPi is the replacement for Slab on a Raspberry Pi 4. It has been moved, because of downscaling. And recently got upgraded from a rpi3 to a rpi4, it has a DAC+ Hat for better audio quality.

Setup

Disabled/removed services

  • disabled unattented-upgrades
  • disabled wpa_supplicant
  • disabled accounts-daemon
  • disabled multipathd
  • ubuntu motd spam
  • removed snapd

Networking

It is hooked up with UTP. WLAN has been disabled.

==

DAC+

PiFi HIFI DAC+ for better audio quality.

Installation:

Edit /boot/config.txt

Disable the line

#dtparam=audio=on

add

dtoverlay=hifiberry-dacplus

MPD

Host: slabpi.dhcp.nurd.space

Port: 6600 (Technically 6005, see the mpd proxy service)

It is integrated with Home Assistant view on Jarvis.

HTTPD outputs:

  • port 6666 (8000:16:1) used by the VOIP system
  • port 7777 (44100:16:2) used by Audiophiles

PulseAudio

All pulseaudio changes need to be made in /etc/pulse/sytem.pa (default.pa isn't used)

Pulseaudio is running as a system-wide daemon, it's default sample rate is set to 48Khz and priority has been set to real time.

Icecast

There is an icecast server on port 8000. It's a direct feed from Pulseaudio so all sounds (Entrance themes, speak commands) will be heard on the stream.

Mount point(s):

  • /nurds (Pulseaudio)

MPD Control

For those not wanting to install a MPD client, there's a stand alone MPD web interface running called Mympd on port 80

Labelprinter implementation

Labelprinter is up and running. See Labelprinter.

Services

Entrance Themes

  • Location: /home/pi/scripts/theme_songs.py
  • Systemd-service: themesongs.service
  • Programmer: User:Melan

A script which plays a part of a song for each individual member entering the space. See Entrance themes.

MPD Icecast update

  • Location: /home/pi/scripts/mpd_icecast_update.py
  • Systemd-service: mpdicecastupdate.service
  • Programmer: User:Melan

Updates the current now playing song from MPD to the icecast mount /nurds

Vu Meter

  • Location: /opt/vu
  • Systemd-service: vu.service
  • Programmer: User:Zarya

https://gist.github.com/zarya/3d5447556296d6923bee232e4cc7fca1

Pixelvloed FFT

  • Location: /opt/pulse-pixelvloed-fft
  • Systemd-service: fft.service
  • Programmer: User:Zarya

Pixelvloed waterfall

  • Location: /opt/pulse-pixelvloed-fft
  • Systemd-service: waterfall.service
  • Programmer: User:Zarya

hass-systemd-manager

A python tool for starting and stopping systemd services via mqtt using homeassistant

Soundboard

  • Location: /home/pi/soundboard
  • Systemd-service: soundboard.service
  • Programmer: User:Melan

Allows samples to be triggered through MQTT, also handles the doorbell sound.

MPD Vol Proxy

  • Location: /home/pi/mpdVolProxy
  • Systemd-service: mpdvolproxy.service
  • Programmer: User:Melan

A small script that intercepts all the clients connecting to MPD on port 6000 and intercepts all setvol commands and instead delegates it to Pulseaudio, meaning that any volume command will not adjust MPD's output, put instead the output to the amplifier.


MPDTube

This project has it's own wiki page, MPDTube


PulseControl

  • Location: /home/pi/pulseControl
  • Programmer: User:Melan

Part of the multi-room audio setup, it will ping if any of the defined hosts are up and once they are it will add their pulseaudio instance to the output.

 
Our site is hosted by Site4U
Site4U
Our connectivity is made available by BIT
To BIT's website