Let us see a very interesting narration

4535 – حَدَّثَنَا الْوَلِيدُ، حَدَّثَنَا سَعِيدُ بْنُ عَبْدِ الْعَزِيزِ، عَنْ سُلَيْمَانَ بْنِ مُوسَى، عَنْ نَافِعٍ، مَوْلَى ابْنِ عُمَرَ، أَنَّ ابْنَ عُمَرَ: ” سَمِعَ صَوْتَ، زَمَّارَةِ رَاعٍ (1) فَوَضَعَ أُصْبُعَيْهِ فِي أُذُنَيْهِ، وَعَدَلَ رَاحِلَتَهُ عَنِ الطَّرِيقِ “، وَهُوَ يَقُولُ: يَا نَافِعُ أَتَسْمَعُ؟، فَأَقُولُ: نَعَمْ، فَيَمْضِي حَتَّى، قُلْتُ: لَا فَوَضَعَ يَدَيْهِ، وَأَعَادَ رَاحِلَتَهُ إِلَى الطَّرِيقِ، وَقَالَ: ” رَأَيْتُ رَسُولَ اللهِ صَلَّى اللهُ عَلَيْهِ وَسَلَّمَ وَسَمِعَ (2) صَوْتَ زَمَّارَةِ رَاعٍ (1) فَصَنَعَ مِثْلَ هَذَا ” 

Nafi’i, slave of ibn Umar, says that once ibn Umar was going somewhere, and he heard songs and music of a Shepherd; So he put his fingers in his ears; and left that path; and asked me after small intervals: Nafi’i! is the voice still there? If I would say yes, He would walk on, and when i said no; he took the fingers out of his ears; and came back on the path; and He said that I had seen Holy Prophet asws doing it like this

[Musnad Ahmad, urdu, vol 3, page 27]

{Molvi Zafar, Translator of the book, says that it is Sahih as per Albany}

Sheikh Shoaib says Hadeeth is hasan in His research upon Musnad Ahmad[8/132/4535]

This narration is also present in urdu version, vol 11, page 128

very interesting in deed. If he was aware that This is Sunnah, why was He not telling it to Nafi’i. If listening was that bad, why He made Nafi’i do that?

Even more interesting is the fact that He was able to hear voice of Nafi’i, but not that of Songs…..