Sometimes, when you plug in your earphones, the audio stop coming (from the earphones), but the notification sounds continue to come. You've to restart your device multiple times to resolve the issue.
The corresponding logs in logcat --
08-11 22:41:36.375 315 8872 E qcvirt : [vendor/qcom/proprietary/mm-audio-noship/audio-effects/safx/android-adapter/qcvirt/qcvirt.c:477] Assertion fail: status == PPSUCCESS
Solution -- disable the equalizer in audioFX.