Sometimes when I connect headphones, it is recognized, but there is no sound. After restart phone, it backs to normal.
When the sound was not coming.
Go to settings
Sound and vibration
And lower or higher the volume of ringtone once the ring tone gets sound you're are able to listen to music this is a bug. Already most of them as experience this till now no permanent fix for it