After much experimentation, I found that putting the display to sleep (e.g. when the screen is turned off after a period of inactivity), waking it, and then restarting pulseaudio makes the sound work until the next reboot.
I'm using the PC as an HTPC that loads kodi at bootup, so I automated this by creating a little script to launch kodi:
xset dpms force off
In earlier attempts at fixing the issue I set pulseaudio to never let the sound device sleep (commented out
load-module module-suspend-on-idle in
/etc/pulse/default.pa), and also set the default sampling rate to 48000 (
default-sample-rate = 48000 in
/etc/pulse/daemon.conf). Not sure if these settings contributed to the fix, but they are not sufficient on their own.
I also reported a bug against Ubuntu 16.04: