I broke my headphone 3.5mm cable into my laptop, and after using glue and a cue tip, I was able to pull out the broken piece of headphone jack out. After that, I was no longer getting sound, so I did a system restore (Windows) to factory. Then, something strange started happening. I now am getting sound out of my speakers and my headphones, it shows that they are only 1 device. I have tried everything to fix it, but there seems to be no solution. It doesn't even seem to recognize my headphones, even though sound is coming out. Thanks!
There's two option you can go for:
The first would be to try and re-solder the jack by re-applying heat and letting the solder melt and form a new connection again. This option is more sketchy as you are using your own tools, and you are risking ruining your audio board altogether for a solution that might not even work.
LUCKY for you, the Lenovo y510p's audio board is a separate component - meaning that you can replace the thing altogether. I did some research and found in this manual on page 86 that the component number for the board is 90002737. I found ONE(!) person on eBay selling it that you can buy new from here. I would highly recommend spending the extra $$ and going with this solution as I'm sure this will fix your problem - and there's a plethora of tear-down guides on the internet to give you access to the board.
Hope this helps! Tell us how you end up doing.