The largest record labels are closing in on a deal for a stake in buzzy digital-music service SoundCloud, in exchange for an agreement not to sue the startup for copyright violations, according to people with knowledge of the plans. SoundCloud, a Berlin-based company with more than 250 million listeners a month, is negotiating with Universal Music Group, Sony Music Entertainment and Warner Music Group for licenses to continue playing songs from the biggest labels and avoid potential legal disputes, said people familiar with the talks. In return, SoundCloud is discussing giving each record label a roughly 3 percent to 5 percent stake, along with a percentage of future revenue, said the people, who asked not to be identified because the talks are private. An agreement would value SoundCloud at $500 million to $600 million, two people familiar with the talks said.