albertz / music-player

Music player - endlessly plays your music
http://albertz.github.io/music-player/
BSD 2-Clause "Simplified" License
492 stars 59 forks source link

skipping songs. `dec->channels` is totally off #37

Open christophmluscher opened 11 years ago

christophmluscher commented 11 years ago

just had a song skip. started playing and 5-10 seconds in, it skipped to the next song. quite sure that i dragged the song (Jake Bugg - Seen It All) into the playlist via search window. was not able to reproduce the skipping. log file:

new song: Kaiser Chiefs - Modern Way, 04:04, mp3, 218 kbit/s, 6.48 MB
new song: Jake Bugg - Seen It All, 02:51, m4a, 276 kbit/s, 5.78 MB
warning: peeked stream (0/3) (08 Rock The Night.mp3) is not the real next stream (04 Seen It All.m4a)
new song: Various - Rock The Night, 04:07, mp3, 313 kbit/s, 9.44 MB
Cannot create sample rate converter for conversion of 44100 Hz s16 29 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 29 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 37 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 29 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 33 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 28 channels to 48000 Hz flt 2 channels!
warning: peeked stream (0/3) (04 Move To The City.mp3) is not the real next stream (04 Seen It All.m4a)
new song: Jake Bugg - Seen It All, 02:51, m4a, 276 kbit/s, 5.78 MB
new song: Guns N' Roses - Move To The City, 08:00, mp3, 125 kbit/s, 7.33 MB
new song: Simon & Garfunkel - We've Got A Groovy Thing Goin', 02:01, mp3, 320 kbit/s, 4.72 MBreadOutStream: we have 1024 too less samples available (requested 1024)

readOutStream: we have 1024 too less samples available (requested 1024)
readOutStream: we have 1024 too less samples available (requested 1024)
readOutStream: we have 1024 too less samples available (requested 1024)
warning: peeked stream (0/3) (04 Seen It All.m4a) is not the real next stream (10 We've Got A Groovy Thing Goin'.mp3)
readOutStream: we have 1024 too less samples available (requested 1024)
readOutStream: we have 1024 too less samples available (requested 1024)
new song: Jake Bugg - Seen It All, 02:51, m4a, 276 kbit/s, 5.78 MB
new song: The Cat Empire - Strong Coffee, 03:38, mp3, 156 kbit/s, 4.15 MB
readOutStream: we have 1024 too less samples available (requested 1024)
readOutStream: we have 1024 too less samples available (requested 1024)
new song: Jake Bugg - Seen It All, 02:51, m4a, 276 kbit/s, 5.78 MB
readOutStream: we have 1024 too less samples available (requested 1024)
warning: peeked stream (0/3) (02 Crucify The Dead (Feat. Ozzy Osbourne).mp3) is not the real next stream (04 Seen It All.m4a)
albertz commented 11 years ago

It looks like the channel number is totally off and also changes. This is strange. I thing the decoder channel number should not change. This indicates memory corruption, i.e. some buggy code overwrites the wrong memory. Such bugs are very hard to find.

Can you send me the song via mail?

You said that you tried to play the same song again later and it worked? Have you ever had this problem before?

christophmluscher commented 11 years ago

sure. yes it works now. had no problems again. just gives the same error. but it plays.

new song: Jake Bugg - Seen It All, 02:51, m4a, 276 kbit/s, 5.78 MB
warning: peeked stream (0/3) (07 Roll of the Dice.mp3) is not the real next stream (04 Seen It All.m4a)
readOutStream: we have 1024 too less samples available (requested 1024)
new song: Bruce Springsteen - Roll of the Dice, 04:18, mp3, 313 kbit/s, 9.85 MB
albertz commented 11 years ago

What same error? The main error indicating that there is something wrong was the sample rate converter creation error. It couldn't be created because the number of channels was way off (I thing the converter probably only handles 1, 2, 4 and maybe 5 or 6 channels, not more).

The warning that the peeked stream is not the real next stream is something else. Peeked streams are streams which were preloaded internally by the player engine (the part in C++). The player engine asks the Python part which songs probably will come next (= peeked streams) and preloads them. Once the player engine then advances to the next song, it tries to use some of the preloaded songs. If that warning occurs, it means that the player engine got a different song than what it expected and preloaded.

This might happen if you drop the song to the queue right to the top. I think the Python part should tell the player engine in that case that it should reload the peeked streams. It seems that it didn't or it had too less time (because you right away clicked on nextSong). Maybe that is a bug - but only a minor one.

The readOutStream warning about too less samples available just means that. That happened because the song was not properly preloaded and so it takes a small time to load enough samples. In the meanwhile, the soundcard, which indirectly calls readOutStream, has too less data available to play. That might result in a small hiccup in the sound output.

christophmluscher commented 11 years ago

okay. then i mixed something up. thx for the info.

the peeked stream warning:

This might happen if you drop the song to the queue right to the top.

i think you are right. i can only reproduce the warning if a song is dropped to play next.

i was not able to duplicate the sample rate converter creation error.

christophmluscher commented 11 years ago

happened again. same song. again put into first place in the playlist

new song: Alice Cooper - Bed Of Nails, 04:20, mp3, 313 kbit/s, 9.92 MB
new song: Jake Bugg - Seen It All, 02:51, m4a, 276 kbit/s, 5.78 MB
Cannot create sample rate converter for conversion of 44100 Hz s16 51 channels to 48000 Hz flt 2 channels!
Cannot create sample rate converter for conversion of 44100 Hz s16 49 channels to 48000 Hz flt 2 channels!
new song: Beethoven - Adagio, 07:18, mp3, 125 kbit/s, 6.67 MB