This also applies with headphones. The quality goes bad when I turn it on and try to unlock it (A good example is when your headphones are broken and you have to hold it into a certain position.) but when I turn it off, it's fine.
EDIT: I restarted my phone and it works fine now but how can I...