Spacesound: Difference between revisions

From NURDspace
(Created page with "=== Info === Audio VM running Snapcast. All audio related stuff for the space happens here, such as MPD, the soundboard etc. However, due to the nature of Snapcast there is a...")
 
No edit summary
Line 1: Line 1:
=== Info ===


Audio VM running Snapcast. All audio related stuff for the space happens here, such as MPD, the soundboard etc. However, due to the nature of Snapcast there is a artifical delay introduced to keep all the clients in-sync. As such, audio visualisation such as LedFX would still be running on Slabpi to provide a low-latency audio RGB-barfing experience in zaal 1.
{{Inventory
|Name=Spacesound
|Owner=Space
|Status=Infra
|Hostname=spacesound.vm.nurd.space
|Location=Near the amp
|Picture=spacesound.jpg
|Tool=No
}}


Under the hood, Snapcast provides a FIFO under <code>/tmp/snapfifo</code> where you can dump audio. Pulseaudio for example is configured to send audio to this fifo. We are still running Pulseaudio under the hood, to provide an interface for multiple audio programs to run at once.


=== Notes ===
=== Info ===


* Disabled protected fifos <code>sudo sysctl fs.protected_fifos=0</code> (Set in <code>sysctl.conf</code>)
A raspberry Pi 4 running Snapcast. All audio related stuff for the space happens here, such as MPD, soundboard etc. However, due to the nature of Snapcast there is a artificial delay introduced to keep all the clients in-sync. As such, audio visualization such as LedFX are run on [[Soundfx]].
* Added user nurds to the group pulse
* Added user pulse to the group snapserver <code>usermod -aG snapserver pulse</code>


==== Config changes ====
Under the hood, Snapcast provides a FIFO under <code>/tmp/snapfifo</code> where you can dump audio. Pulseaudio for example is configured to send audio to this fifo. We are still running Pulseaudio under the hood, to provide an interface for multiple audio programs to run at once.
 
===== system.pa =====
 
Both <code>native-protocol-tcp</code> and <code>module-native-protocol-unix</code> have been enabled to allow programs to access pulseaudio. Without the latter line for example, everything trying to play audio through pulse gets a access denied. For <code>native-protocol-unix</code> to work, remove the other entries.
 
<pre>load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1;10.0.0.0/24 
load-module module-native-protocol-unix auth-anonymous=1</pre>
To make Pulseaudio send audio to snapcast
 
<pre>load-module module-pipe-sink file=/tmp/snapfifo sink_name=Snapcast format=s16le rate=48000
update-sink-proplist Snapcast device.description=Snapcast</pre>
===== client.conf =====


Needed to make clients know where to connect to, because we are running system wide.
Note:
The hostname is spacesound.vm.nurd.space as spacesound used to be a vm running on [[Coherence]] but has been moved to hardware as stutters kept happening when running in an LXC.


<pre>default-server = 127.0.0.1</pre>
=== Running services ===
=== Running services ===


* Icecast + Darkice
* Icecast + Darkice (Accessible on the web)
* themesongs.service (/home/nurds/scripts)
* espeak-server (/home/nurds/scripts)
* espeak-server (/home/nurds/scripts)
* icecast-title (/home/nurds/scripts)
* icecast-title (/home/nurds/scripts)
* [[Soundboard]]


=== Configs ===
===== /etc/default/snapserver =====
===== snapserver.conf =====
<pre>source = pipe:///tmp/snapfifo?name=default&amp;mode=create 
buffer = 100
sampleformat = 48000:16:2
codec = pcm</pre>
===== /usr/share/dbus-1/system.d/pulseaudio.conf =====
<pre>
<source lang="xml"><?xml version="1.0"?> <!--*-nxml-*--> 
<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN" 
"http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd"> 
<busconfig> 
<policy group="pulse"> 
<allow own="org.pulseaudio.Server"/> 
</policy> 
 
<policy context="default"> 
<allow send_destination="org.pulseaudio.Server"/> 
<allow receive_sender="org.pulseaudio.Server"/> 
</policy> 
</busconfig></pre>
===== /etc/systemd/system/pulseaudio.service =====
<pre>
</source>
[Unit]<br />
Description=PulseAudio Daemon
[Install]<br />
WantedBy=multi-user.target
[Service]<br />
Type=simple<br />
ExecStart=/usr/bin/pulseaudio –system –realtime –disallow-exit –no-cpu-limit
<pre>


- OS: Ubuntu 20.01 LTS
=== Todo ===
</pre>
* Get a better case for cooling


==== Installed ====
* Document the web accessible mpd interface
<pre>
apt-get install alsa-utils alsa-tools mpc mpd ncmpcpp pamix nfs-common mplayer pulseaudio espeak </pre>

Revision as of 22:03, 17 April 2022


Spacesound
Spacesound.jpg
Owner Space
Status Infra
Hostname spacesound.vm.nurd.space
Location Near the amp
Tool No
Tool category

Spacesound

spacesound.jpg {{{InventoryOwner}}}Property "Tool Owner" (as page type) with input value "{{{InventoryOwner}}}" contains invalid characters or is incomplete and therefore can cause unexpected results during a query or annotation process. Near the amp


Info

A raspberry Pi 4 running Snapcast. All audio related stuff for the space happens here, such as MPD, soundboard etc. However, due to the nature of Snapcast there is a artificial delay introduced to keep all the clients in-sync. As such, audio visualization such as LedFX are run on Soundfx.

Under the hood, Snapcast provides a FIFO under /tmp/snapfifo where you can dump audio. Pulseaudio for example is configured to send audio to this fifo. We are still running Pulseaudio under the hood, to provide an interface for multiple audio programs to run at once.

Note: The hostname is spacesound.vm.nurd.space as spacesound used to be a vm running on Coherence but has been moved to hardware as stutters kept happening when running in an LXC.

Running services

  • Icecast + Darkice (Accessible on the web)
  • espeak-server (/home/nurds/scripts)
  • icecast-title (/home/nurds/scripts)
  • Soundboard


Todo

  • Get a better case for cooling
  • Document the web accessible mpd interface