I have a first generation MacPro on my office where I work. It is running Mac OS X 10.7.4. It is an absolutely amazing Mac in all ways except one. The sound preference setting reverts to the line out setting instead of to the internal speakers setting. This has been going on the past year or two, well before Lion, so I cannot blame this problem on Lion. It happened on Snow Leopard too.
I go into the sound preference panel and click on the internal speakers setting and it stays that way, but at some point later, it reverts back to the line out setting. I rarely reboot this Mac, but the problem is the same regardless of whether or not I restart it. The next day, the sound setting is back to line out. It is an annoying problem, but I get so busy during the day working that it isn't until now that I figured I would pose this question on this forum and see if anyone else had this problem and if you suggest a fix for it. The only thing I really use the sound capability on my MacPro is for the beep that Mail.app makes when incoming mail arrives and the ocassional web presentation, so I have no need for external speakers, although I used to have a pair connected, but I never connected them again when I had to move to a new office.
As it happens, two days ago, I rebuilt my MacPro's boot drive because I suspected it was either heavily fragmented or corrupt. I used Carbon Copy Cloner too clone my MacPro's boot drive to another internal drive. I then booted from the cloned copy and erased the initial boot drive, including selecting the option in Disk Utility to erase the unused space. I then cloned the clone back to the original drive and rebooted in safe mode and let it fix up the files on the boot disk. That worked fine, but it had no effect on this speaker selection problem. On the up side, my MacPro is working bettter than ever now!