I've had the same issue. Here's what worked for me:
- Open Settings
- Search for "Optimise battery usage"
- Click on "Apps not optimised" and select "All"
- Search for Spotify and disable battery optimization
Hope this helps
Thanks this worked for me!
Well, I did all these steps but music controls still do not work on the lock screen. I recently update to Android P on a Note 8 and that is when all started to happen. I did a factory reset and it started to work; however, at some point it stopped. The funny part is that the issue is only with Spotify, not with any other Music Player.