I now attach the log file, as requested.
The log corresponds to the following sequence of events
1) Play sound (no headphones plugged)
2) Plug headphones (not working)
3) Go to Soundpreferences->Output->Analog Speakers (now headphones working)
4) Unplug Headphones (speakers now normally working)
5) Plug Headphones again (nothing changed in sound preferences, so not working)
6) Unplug Headphones (again speakers working fine)
7) Stop logging.
I now attach the log file, as requested.
The log corresponds to the following sequence of events
1) Play sound (no headphones plugged)
2) Plug headphones (not working)
3) Go to Soundpreference s->Output- >Analog Speakers (now headphones working)
4) Unplug Headphones (speakers now normally working)
5) Plug Headphones again (nothing changed in sound preferences, so not working)
6) Unplug Headphones (again speakers working fine)
7) Stop logging.