I have exactly the same issue as darchik described. Optical sound output just stops working but not in the middle of playback, always in between. For example, watch youtube, pause, alt tab, alt tab back, resume, no sound. I also hear a loud crack when any audio starts playing.
When audio is dead, windows still reports that audio is playing, this must be hardware issue.
The only way to fix this is reboot or actually just sleep and wake up works most of the time too!
Realtek audio driver 6.3.6900.2342