http://www.oxfordscholarship.com/view/10.1093/acprof:osobl/9...
From the abstract: "This chapter suggests that the original function of music is most likely associated with social bonding once group sizes became too large to be adequately bonded using grooming alone. It also contends that music served a natural bridge to language as language became inevitable as a mechanism for group bonding and cohesion."
I imagine a prehistoric tribe dancing in trance around the fire, playing with improvised instruments.
The human experience is so "lonely" - we all are separate entities in desperate need to belong - and sharing a common experience and emotion definitely bonds people. It would help glue a tribe together, which is decidedly a survival advantage. And the poor fella who didn't join in because he didn't care much for music would have been marked as an outcast :-)
This is basically how I, and others, tend to feel when attending goa/acidcore/dnb (that one to a lesser extent though) parties. All together in front of the speakers, just us and the music, then the sun coming up. Pure bless. And that's even without drugs, or at least not a lot, go imagine what it's like with certain substances :P.
I tried hard, but this doesn't work for me at all with more popular/known genres, presumably both because of music and audience, too much people just chatting instead of dancing etc, and also never got that connection with metal etc. Would love to see research on that.
This is going to sound crazy but maybe it does have a survival reason. In societies where music is enjoyed (all major societies today), music has the capacity to not only gather people but also have them experience a shared emotion or thought. Not only that, but music has the capacity to carry a story through time, from generation to generation, and thus the capacity to carry the morals of that story through time too.
Maybe music is a way to disseminate important cultural information across a population and across time, and the societies that did not have music were weaker (eg. due to less shared morals across the society and across time) and therefore lost when they were confronted in battle by a society with music. If music is used in war to inspire courage in soldiers, perhaps it has a function beyond aesthetics and is actually used for survival, in a literal darwinian sense.