Sound support: NAS

Table of Contents

Sound server: NAS


by ross at 03:08:13 on June 3, 2012

Sound driver

# kldload snd_driver

# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
Installed devices:
pcm0: <HDA VIA VT1708S_0 PCM #0 Analog> (play/rec) default
pcm1: <HDA VIA VT1708S_0 PCM #1 Digital> (play)

In my case I see that I need hda driver. Add to /boot/loader.conf:


To see the list of support audio systems run:

> grep snd /boot/defaults/loader.conf

That's it. Local sound support is enabled.


To test the sound install a simple wav-player and download the test signal:

# cd /usr/ports/audio/waveplay
# make install clean
# rehash
# cd
# fetch
# waveplay ~/test.wav

If you hear nothing read on.

Switching sound channels

Motherboard and HDMI video card sound channels example:

# cat /dev/sndstat                                                                              [7:33:21]
FreeBSD Audio Driver (newpcm: 32bit 2009061500/i386)
Installed devices:
pcm0: <HDA Realtek ALC662 PCM #0 Analog> (play/rec) default
pcm1: <HDA Realtek ALC662 PCM #1 Digital> (play)
pcm2: <HDA NVidia GT21x HDMI PCM #0 DisplayPort> (play)
pcm3: <HDA NVidia GT21x HDMI PCM #0 DisplayPort> (play)
pcm4: <HDA NVidia GT21x HDMI PCM #0 DisplayPort> (play)
pcm5: <HDA NVidia GT21x HDMI PCM #0 DisplayPort> (play)

Here you can see 2 motherboard and 4 HDMI sound channels. The system will use pcm0 by default. But it's possible that HDMI will appear before motherboard channels. In this case you will need to switch channel to get motherboard sound to work.

You can switch channels like this:

# sysctl hw.snd.default_unit=1
# waveplay ~/test.wav

In the example above the channel is set to pcm1 (default_unit=1). If you still hear nothing then switch to channel 2 and so on.

Add to /etc/sysctl.conf the correct call: