I too am intrigued by the notion of outputting sound out via both HDMI and analogue at the same time.
After doing a bit of digging it does seem like people have experimented with it. Firstly, its not possible in OS's like XBMC because ALSA
is not implemented. ALSA
is the Advanced Linux Sound Architecture. Its software that allows audio software to interface with the Kernel. Which is required for sound through both HDMI and analogue at the same time. This answer gives a nice explanation of it.
Here's the reason for the delay. Without getting into the detail too much here's how it works. HDMI supports both sound and video, so the sound gets outputted along with the video through HDMI. However the sound through the analogue jack is created using PWM. So the sound over HDMI and over the analogue jack take a different route through the hardware on the Pi. This is what generates the latency. This answer here explains it well, if you are after more detail.
How can you reduce the latency. From what limited posts I've seen only I don't think there is a fix for it. The issue is the two audio signals take different paths, and I don't believe there is a way of combining them on the hardware level. So, you would have to use some software magic to slightly delay the transmission time of one or the other. I don't think this is really an option.
The thing is I don't believe the Foundation considered the possibility of people wanting to use two audio outputs simultaneously for the same audio source. However, if you want to distinct pieces of audio to play then the latency between the two isn't really an issue so much.