It is a lawful occasion, and therefore conduct of this sort is not to be censured in it, just as it is not censured at wedding celebrations.
2 – As for the ḥadith of Ibn ʿUmar that Ibn Ḥazm cited to argue for permissibility, it is transmitted by Nāfiʿ, the freedman of Ibn ʿUmar:
“ʿAbd Allāh ibn ʿUmar once heard the sound of a shepherd’s flute. He placed his two fingers in his ears, guided his mount off the road, and kept asking, ‘O Nāfiʿ, do you still hear it?’ I would reply, ‘Yes,’ so he would continue on until I said, ‘No.’ Only then did he remove his fingers, return his mount to the road, and say, ‘I saw the Messenger of Allah ﷺ hear a shepherd’s flute and do exactly the same.’ ”
It was recorded by Aḥmad (2/8, 38); Ibn Saʿd (4/163); Abū Dāwūd (4924–4926); al-Bayhaqī in al-Sunan by way of Abū Dāwūd (10/222); likewise by Ibn al-Jawzī, p. 247; Ibn Ḥibbān in his Ṣaḥīḥ (2013 – Mawārid); Ibn Abī al-Dunyā, fol. 9/1; al-Ājurī, no. 64; al-Ṭabarānī in al-Muʿjam al-Ṣaghīr, p. 5 (Indian ed.); and al-Bayhaqī again in Shuʿab al-Īmān (4/283/5120) through several chains from Nāfiʿ. Some of those chains are sound; I have traced and discussed them in detail, together with a corroborating report from Mujāhid of similar wording, in al-Rawḍ al-Naḍīr, 568, and—abridged—in al-Mishkāt, 4811 (second verification). Ḥāfiẓ Abū al-Faḍl Muḥammad ibn Nāṣir deemed the report authentic, as cited in al-Ālūsī’s Tafsīr (11/77) and in Kafʿ al-Rāʿ, p. 109 (margin to al-Kabāʾir).
Ibn Ḥazm, after quoting the ḥadith, said: