Make sure you are not using any audio effect configuration in your device trees. Also for dolby media codecs to work add this line in your media codecs config (should be in vendor partition) :-
<Include href="media_codecs_dolby_audio.xml" />
To build, inherit the dolby config by adding this in your device's makefile :-
$(call inherit-product, hardware/dolby/dolby.mk)