crsmoro / scplayer

Open source client of Spotify Connect closed library developed in Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

buffer underrun without aparent reason..

crsmoro opened this issue · comments

sometimes when you open and get buffer underrun you have to close and open again to go back to normal..
it happens when you are going to play the first song, if the first played ok never happens after..

is there a stack-trace?

that is the thing.. there is not..
happens on the spotify lib..
on debug callback only shows buffer underrun underrun.txt

i think is related to a heavy cpu usage..
I did reproduce three times once when another process was running on a raspberry 1 (which has a slower cpu)
on raspberry 2 i never got to reproduce..

maybe we can implement a critical error callback, so it can automatically restart

do you get the buffer underrun on startup? or while playing?
I think we can just log it and restart it internally.

it's when you play the first song..
the 'problem' also happens time to time after the first, but it's the first one that causes the problem.. the audio is not played, keeps showing the message and after a minute or so crashes the vm..
about the automatically restart, to a workaround ok but since i have no idea how to fix it, well it's better than nothing..

hmm I'm unsure how to code this. I implemented a similar function to not accept somebodies playback by just resetting spotify connect. Its really fast, but we have the problem with the login data. We then have to store them as a private variable, or provide a callback function which is really ugly.

i dont know if you noticed, but in each callback method from the lib has a pointer named userdata.. i think the name speak for it self..
today it's blank but it can store anything you want you just have to set on init..
i dont know if that helps or if that is what you needed..

removing the playing thread seems to have fixed the problem..