Sound support: NAS

Table of Contents

Configuration
Sound server: NAS

Sound server: NAS

by ross at 17:58:40 on March 20, 2014

Sound server is optional. All the software will use bundled OSS sound by default. But if you need to play sound over network, for example, then you install a network-capable sound server.

Check all the ports that use sound to see what sound servers are supported. Choose the one that is supported by all such ports. I only use:

  • (s)mplayer (aRts, EsounD, JackIt, NAS, OpenAL and PulseAudio),
  • festival (NAS and EsounD),
  • shell-fm (uses libao which supports aRts, EsounD, NAS and PulseAudio).

Network Audio System

So I choose NAS. Playing sound over network is simple: define environment variable AUDIOSERVER:

(ba)sh:
> export AUDIOSERVER="tcp:/slim.lan:8000"
(t)csh:
> setenv AUDIOSERVER "tcp:/slim.lan:8000"
start app

Install

# cd /usr/ports/audio/nas
# make install clean
# rehash
# cd /usr/local/etc
# cp nasd.conf.eg nasd.conf

Add to /etc/rc.conf:

nasd_enable="YES"

Create /usr/local/etc/rc.d/nasd:

#!/bin/sh

# PROVIDE: nasd
# REQUIRE: DAEMON
# BEFORE:  LOGIN

. /etc/rc.subr

name="nasd"
rcvar=`set_rcvar`
command="/usr/local/bin/nasd"

load_rc_config $name

: ${nasd_enable="NO"}
: ${nasd_flags="-aa -b"}

run_rc_command "$1"
# chmod a+x /usr/local/etc/rc.d/nasd
# service nasd start

If you want to disable network features of NAS add to your rc.conf:

nasd_flags="-local -b"

 

Comments