I sometimes connect my Ubuntu laptop to my LCD TV via the HDMI port to watch movies. When I plug in the cable the display works right away but the new sound device (the TV’s speakers) is usually not detected unless I log off and re-login.
An easier way to do this is to restart the pulseaudio service to detect the TV’s speakers via command line. To do this just type:
The pulseaudio service should automatically restart within 2-3 seconds after killing it and the new sound devices will be detected. If it doesn’t just press ALT + F2 and type in pulseaudio.