Using Raspbian Jessie, when I try to output a short beep sound (approx 0.5s) through HDMI, the sound is somehow distorted. The first few 100ms of the audio is not played, or the audio is played too fast, or both. Sometimes it makes no sound at all.
Symptoms can be reproduced with a sample WAV file:
omxplayer -o hdmi /usr/share/sounds/alsa/Front_Center.wav
When I try with a long MP3 it works fine. When I add silence to the start and end of the beep file it also plays normally. Unfortunately the sound needs to be instant and short (as a touchscreen "tap" notification).
What's causing this, and is there a fix?
Edit: I also tried playing the beep through a web audio component using chromium-browser. The first beep is ignored, subsequent beeps seem to work fine. After a few minutes of no activity its silent again. Is an HDMI audio channel closing/opening somehow? Can I force it to remain open?