How to enable 5.1 channel playback on a Realtek ALC887-VD chip?

I have an ASUS F2A55-M LE board which includes a Realtek ALC887-VD chip. Stereo audio playback works just fine but I have a 5.1 speaker set that I would like to use. I am able to achieve full surround playback in Windows 10 using the same machine but I can't seem to get it working within Ubuntu 16.04.

I've tried setting default-sample-channels = 6 in /etc/pulse/daemon.conf but even after rebooting it doesn't make a difference. Playback is still only two channels.


In addition to changing default-sample-channels in /etc/pulse/daemon.conf, it was also necessary to launch alsamixer and change the number of channels to 6:

enter image description here

Note: you may need to restart between changing daemon.conf and using alsamixer.