Andriy Gapon suggested the following patches to enable HDMI audio for
an ATI/AMD video card. But at that time the original poster was not
able to actually get the sound device to properly attach.

Well these patches DO work for DragonFly, at least using a custom kernel
starting from master sometime in the last couple of weeks with
radeon audio patches from Linux 4.7.10 (adding radeon_audio.c and radeon_audio.h
and updating everything related).

I startx using xfce4 and a custom version of pkgsrc with mesa 17, xorg server 19.3

The following patches are safer for DragonFly because by default
no sound drivers are loaded. Original poster actually had
kernel crashes because on his version of FreeBSD sound drivers
were automatically loaded. Also there was a claim at the time,
least if the initial value of corb_size was 0, that Linux actually does
do some default assumption of 256.