Serveur audio

Cette page est une archive.

Le but est de configurer et mettre en place un système audio (multiroom) destiné à remplacer le système propriétaire que nous utilisons pour le moment.

Le système audio devra être contrôlable depuis tout système d'exploitation (Linux, OS X, Windows, BSD) via diverses interfaces (web, mobile, physique dans le hackerspace).

Configuration

Schéma

audio1.PNG

Explications

Serveur

# defaults file for snapserver
 
# start snapserver automatically?
START_SNAPSERVER=true
 
# Allowed options:
#   -h, --help                          Produce help message
#   -v, --version                       Show version number
#   -p, --port arg (=1704)              Server port
#   --controlPort arg (=1705)           Remote control port
#   -s, --stream arg (=pipe:///tmp/snapfifo?name=default)
#                                       URI of the PCM input stream.
#                                       Format: TYPE://host/path?name=NAME
#                                       [&codec=CODEC]
#                                       [&sampleformat=SAMPLEFORMAT]
#   --sampleformat arg (=48000:16:2)    Default sample format
#   -c, --codec arg (=flac)             Default transport codec
#                                       (flac|ogg|pcm)[:options]
#                                       Type codec:? to get codec specific options
#   --streamBuffer arg (=20)            Default stream read buffer [ms]
#   -b, --buffer arg (=1000)            Buffer [ms]
#   -d, --daemon [=arg(=0)]             Daemonize
#                                       optional process priority [-20..19]
#   --user arg                          the user[:group] to run snapserver as when daemonized
 
USER_OPTS="--user snapserver:snapserver"
 
SNAPSERVER_OPTS="-d \
#-s pipe:///tmp/localfifo?name=MPD&codec=ogg&sampleformat=44100:16:2 --buffer=2000 \
#-s pipe:///tmp/mopidyfifo?name=Mopidy&codec=ogg&sampleformat=44100:16:2 --buffer=2000 \
-s spotify:///librespot?name=Spotify&devicename=LgHS-Spotify&bitrate=320 \
"
 
# -S spotify:///librespot?name=Spotify&username=laubdaul&password=AlMinGENThYEPTiblE&devicename=SnapSpotify&bitrate=320 --buffer=500"

Sortie(s) individuelle(s)

Les sorties consistent en pi zero pour l'instant.

Il suffit cependant d'installer |//snapcast// sur n'importe quelle machine pour en faire une sortie audio.

Si on se trouve sur un OS avec systemd, on active le service snapclient avec la commande sudo systemctl enable snapclient; pour démarrer le service sans redémarrage de la machine, sudo systemctl start snapclient.

# defaults file for snapclient
 
# start snapclient automatically?
START_SNAPCLIENT=true
 
# Allowed options:
#   --help                          produce help message
#   -v, --version                   show version number
#   -h, --host arg                  server hostname or ip address
#   -p, --port arg (=1704)          server port
#   -l, --list                      list pcm devices
#   -s, --soundcard arg (=default)  index or name of the soundca$
#   -d, --daemon [=arg(=-3)]        daemonize, optional process $
#   --user arg                      the user[:group] to run snap$
#   --latency arg (=0)              latency of the soundcard
#   -i, --instance arg (=1)         instance id
 
USER_OPTS="--user snapclient:audio"
 
SNAPCLIENT_OPTS="-d -s 5 --latency=50"

Utilisation

Le système fonctionne pour l'instant à partir du Wyse (192.168.42.11), du NAS et des sorties individuelles.

Sur chaque sortie individuelle (pi zero en l'occurence) se trouve une instance snapclient.

Comment utiliser le système audio

Limitations actuelles


Révision #2
Créé 20 juin 2020 15:20:21
Mis à jour 21 juin 2020 10:50:31