If so, you've got a fouled proximity sensor.
What's a promixity sensor and where is it?
This is the doohickey that tells if your phone is pressed up next to your face. If it is, this thingamajig turns the screen off so your cheek doesn't press buttons and so your screen doesn't use up lots of battery while you're not looking at it.
It's located right next to the front speaker grill. Those 2 little circles to the right of the speaker? That's the sensor. Make sure the glass in front of it is clear and clean as well. If you have any dirt or grime there, like sweat residue or make up from your cheek built up there, it will foul the sensor as well. You might get away with just wiping the front glass clean to fix this. If you can't see dirt on the front though, it's inside. You will have to open it up.
On TouchWiz roms you can disable the proximity sensor during calls in the phone app settings. It works, but then your screen stays on during calls. (And if you use an AOSP ROM you know there isn't an option in the phone app to disable the proximity sensor during calls. So then you feel like you're really screwed.)
But good news! It's easily repairable. I just did this myself the other day and wanted to let everyone know this is not difficult. But it does help to have someone walk you through it.
What went wrong....
The problem is a bad seal surrounding the top speaker (earpeice). There is supposed to be a seal around the border of the speaker internally to prevent dust and debris that sneaks into the speaker grill from moving into other areas of the phone. That little seal stinks. So dust gets into the speaker grill and finds it's way into the proximity sensor which is right next to the speaker, and is in fact built into the same housing as the speaker.
This is what the whole unit looks like up close.
The speaker is on the left, the proximity sensor is on the right. This is how it is oriented when you are facing toward the front of the phone.
The first thing to try is the compressed air thing if you haven’t already. It's the quick and easy solution that might solve your problem. Just spray compressed air into the earpeice speaker grill and it might clear out the dust. It works most of the time, but eventually there will be too much dust built up inside the phone to simply blow it out anymore. So you'll have to take it apart and repair it. The good news is that it's a really simple 15 minute process.
Disasembly of the phone
I suggest using this guide to dissemble the S4.
It's the best video disassembly guide I found online. It shows you how to COMPLETELY dissemble the device. You won't need to do that. You will jus tneed to take a few peices off to get to the sensor we need to clean. But it's still a great guide, and it'll come in handy later if you need to replace the screen or something more major like that.
That guide shows you all the tools you will need. But just so you have them ready, you will need a tiny (and I mean tiny) Phillips head screwdriver, a tiny flat head screw driver to use a a VERY GENTLE pry bar, and a plastic peice to use as a separator for the plastic housing of the phone. Do not use metal for separating the plastic parts on the phone. You will damage them. (All of this will make sense when you watch the video)
Do everything in the video up to the 3:30 mark. That will get the phone housing removed. You can then skip to the 7:35 mark and then watch until 8:35. (In between shows a lot more disassembly than you will need. Things like removing the SD Card housing and stuff)
The actual cleaning of the sensor
You now have removed the front facing camera, the proximity sensor, and the ear speaker. Almost certainly you will find a lot of dust built up in those three units. Clean them with a dry q-tip. Then spray them and the holes they came out of in the phone THOROUGHLY with compressed air. For me, I found the bulk of the dust was stuck to the phone housing itself, not the sensors that I took out. So clean the phone thoroughly too.
Get it all nice and clean in there again. DO NOT USE ANY CHEMICALS! It's just dust in there, not engine grit or something that needs to be dissolved. Less is more.
Your problem should now be fixed. It's just a matter of putting everything back together. Just reverse the steps. Everything pops back into place really easily. Or you can go to the end of the video and watch the film maker put the entire device back together. But really, just reverse the steps. It's super easy.
Now the bad news is that you didn't fix the underlying problem. That means dust is still going to creep it's way back in there over the next 6 months or so. That means you might have to do this again in 6 months. But as you now know, it's a 10-15 minute process so it's not a big deal to do this every few months.
How to test the repair without making numerous phone calls where you keep pulling the phone away from your face...
I use this app from Google Play. It's free. It works. There are a bunch of others that do something similar. They should all work. This will show you when you proximity sensor is active, which will happen when you put your finger over the sensor.
When you start that app it should show your sensor reading as 8.0 (Big number in the middle of the screen. You can't miss it.). When you put your finger over the sensor it will go to 0.0. If your sensor is dirty or broken it will stay on 0.0. If it's working properly it will go back to 8.0 instantly when you move your finger.
Using this app I run my finger over the sensor pretty quick and it shows me that the sensor was only active for about 50-60 miliseconds. When it does that, I know its working properly.
Suggestion for a long term cure....
You could try to put a piece of very thin foam in behind the speaker grill to trap more dust. I haven't tried it yet, but I did consider that. If you give it a shot, let the world know how it worked out. Remember though I'm just giving an idea here. If you break your phone somehow when trying to physicly modify it, it's not my fault.
Don't try to put a peice of plastic or something behind the speaker grill to toally block out the dust. That WILL work, but it will also greatly muffle the earpeice sound and seriously lower the max volume.
And bookmark that video in case you need to take something else out of the phone later! It's EXTREMELY well done!
Hope this helps someone else!