"Assertion `chunk->CheckFormat(format)' failed." crashes mpd randomly after running for some time
Hello, if I let mpd run for a day or two, I come back to this error and a crashed mpd:
mpd: ../src/player/Thread.cxx:785: void PlayerControl::PlayChunk(DetachedSong&, MusicChunkPtr, const AudioFormat&): Assertion `chunk->CheckFormat(format)' failed.
I'm running mpd 0.21.5 on an up-to-date Debian stable.
It doesn't output anything to any physical audio device, but instead sends a MP3 and an OGG stream to an Icecast2 server. I think the crashes stopped happening (or happened less often) when I was only streaming a 128kbps MP3 stream, whereas now I'm streaming a 192kbps stream and a q=7 OGG, but given the timescales needed for the crash to happen, I can't say this for sure.
I have updated my mpd and will try to produce a backtrace, but it might take a day or two unfortunately.
Let's reopen this when you have the required information.
I'm also facing this problem... any clues?
Raspberry Pi 2 No LSB modules are available. Distributor ID: Raspbian Description: Raspbian GNU/Linux 10 (buster) Release: 10 Codename: buster
mpd 0.21.5 (0.21.5)
@thiagolamosa no clues because you didn't give any, just like the original submitter. Note that meanwhile, 0.21.5 is heavily outdated; the current MPD version is 0.21.16, so you're 11 bug-fix releases behind.
@MaxKellermann , how can I help?
The last syslog entry is
rngd[220]: stats: Time spent starving for entropy: (min=0; avg=0.000; max=0)us

In the mpd.log, the last entry is mpd: ../src/player/Thread.cxx:785: void PlayerControl::PlayChunk(DetachedSong&, MusicChunkPtr, const AudioFormat&): Assertion `chunk->CheckFormat(format)' failed. The previous line is the last played song.
I changed the mpd log settings to verbose level... I'll post the log after the next crash.
UPDATE... This is the final part of mpd.log, now in "verbose" mode...
Nov 02 05:45 : playlist: queue song 33:"Pai Nosso.mp3" Nov 02 05:45 : state_file: Saving state file /var/lib/mpd/state Nov 02 05:51 : decoder_thread: probing plugin mad Nov 02 05:51 : decoder: audio_format=11025:24:1, seekable=true Nov 02 05:51 : player: played "Tua presenca me satisfaz.mp3" Nov 02 05:51 : playlist: queue song 34:"Fernandinho - Pra sempre reinara.mp3" Nov 02 05:51 : decoder_thread: probing plugin mad Nov 02 05:51 : decoder: audio_format=32000:24:2, seekable=true Nov 02 05:51 : alsa_output: opened default type=PLUG Nov 02 05:51 : alsa_output: buffer: size=320..32768 time=10000..1024000 Nov 02 05:51 : alsa_output: period: size=320..32768 time=10000..1024000 Nov 02 05:51 : alsa_output: default period_time = buffer_time/4 = 500000/4 = 125000 Nov 02 05:51 : alsa_output: format=S24_LE (Signed 24 bit Little Endian) Nov 02 05:51 : alsa_output: buffer_size=16000 period_size=4000 Nov 02 05:51 : output: opened "My ALSA Device" (alsa) audio_format=32000:24:2 mpd: ../src/player/Thread.cxx:785: void PlayerControl::PlayChunk(DetachedSong&, MusicChunkPtr, const AudioFormat&): Assertion `chunk->CheckFormat(format)' failed.
I think the problem is the audio file...
The "Pai nosso.mp3" codec is different from the others:

On Windows, it doesn't show the bit-rate

I'm restarting the playlist after removing the file. Let's see how it ends...
I think the problem is the audio file... The "Pai nosso.mp3" codec is different from the others:
On Windows, it doesn't show the bit-rate
I'm restarting the playlist after removing the file. Let's see how it ends...
Guys, the mp3 file was actually causing the problem.
MPD stopped crashing after I re-encoded the mp3 file. Thanks for your help.

@thiagolamosa your posts are not helpful, unfortunately. None of them contain a backtrace. If you want this problem solved, post a backtrace.
I would just like to add, since I originally reported the bug; it seems to have disappeared after I upgraded to the latest version and I would recommend the same. (Though I had to compile it myself, but the process is well documented)
it seems to have disappeared after I upgraded to the latest version
That's why I usually refuse to even look at bug reports or help requests for outdated versions. This happens all the time. And yet people hate me for that attitude. Sigh.
I just got this error at version 0.21.20
mpd: ../src/player/Thread.cxx:799: void PlayerControl::PlayChunk(DetachedSong&, MusicChunkPtr, const AudioFormat&): Assertion chunk->CheckFormat(format)' failed.`
version 0.21.20
How annoying of you to complain about bugs in old versions, 3 years after I have already clarified that only the latest version is supported!