Samsung's mirroring isn't great. I have a Galaxy S6 and a Samsung TV and can mirror it, but the audio is delayed substantially when playing games/movies.
Fairly sure if you try to mirror to a Sony you'd need hardware like an Allshare hub. Samsung mirrors best to Samsung.
Sorry I don't know more about the S4 mirroring.
Edit: the S4 had an MHL port apparently, this would probably be better for lag-free mirroring:
might work