Its stated in the Manual page 6:
http://www.manualslib.com/manual/146488/Samsung-Pn50b540.html?page=6#manual
"5.1CH audio is possible when the TV is connected to an external device supporting 5.1CH.
➢ Each Digital Audio System has a different back panel configuration.
➢ When the receiver (home theater) is set to On, you can hear sound output from the TV's Optical jack. When the TV is displaying a
DTV(air) signal, the TV will send out 5.1 channel sound to the Home theater receiver. When the source is a digital component such
as a DVD and is connected to the TV via HDMI, only 2 channel sound will be heard from the Home Theater receiver.
If you want to hear 5.1 channel audio, connect the DIGITAL AUDIO OUT (OPTICAL) jack on the DVD player or Cable/Satellite Box
directly to an Amplifier or Home Theater, not the TV."
Simple answer you can get 5.1 sound but only from OTA and possibly if you have your caox cable running form the wall to the back of the TV.......For all other sources the answer is no......