What is the earliest halachic source for the minhagim of mourning during sefira? Note that this does not mean the story of R' Akiva, I'm talking about halachic references to prohibitions such as not cutting hair, not listening to music etc.

In addition to the answer from Double AA, the Beit Yosef goes on to say ויש מקומות שנהגו שלא להסתפר .{There are places where the custom is not to have a haircut} during this period. Mishna Berura 493 (1) [3] says one may make a festive meal for an engagement but not to make ריקודין ומחולות {dancing}. Rabbi Mansour writes that the Magen Abraham adds that one should also refrain from listening to music during the Omer period. Although the Shulhan Aruch makes no mention of this practice, Jews have accepted this custom and one should therefore not listen to music during the first thirty-three days of the Omer.