(Solved): "Error with background music" was actually bad screensaver video.
-
This ain't really a "RetroPie" problem since it's from my own addition, but I was hoping someone could help me troubleshoot.
https://github.com/s1eve-mcdichae1/RetroPie-Extra/blob/bgm123/scriptmodules/supplementary/bgm123.sh
I'm using
mpg123
to play MP3 music in the background while browsing EmulationStation. After running for several hours or overnight, then upon quit ES I see this error repeated many times in the console:Note: Illegal Audio-MPEG-Header 0x00000000 at offset 132860. [src/libmpg123/parse.c:1287] error: not attempting to resync...
Those two lines repeat for at least a full screen of it before the
retropie_welcome
comes up, the "offset" value counting up by fours and always topping out at the same valueoffset 132860
every time.The music is started in
autostart.sh
with:(sleep 6; pgrep emulationstatio >/dev/null && bash "/opt/retropie/supplementary/bgm123/bgm_start.sh") & #bgm123
The start script then uses this command to play the music:
mpg123 -Z -@- >/dev/null 2>&1 < <(find "$music_dir" -type f -iname "*.mp3")
The error only shows upon exiting from ES. If I run the music start script manually from console, then I don't see the errors at all.
Upon exiting ES, the music is stopped with a
pkill
via~/.bashrc
(via secondary stop script). By # commenting out that line in.bashrc
, I can have it keep playing after quit ES. However, this makes absolutely no difference, in that if I let it ES run for hours and then quit, I still see the errors, but if I quit ES early and let music keep play in the console, they errors are still not shown (just like when I start the music script from console, manually).
Is this a problem with my files, or with how I'm playing them? Or with mpg123 itself, and in that case if I can't fix it, can I at least suppress the error message from showing (it doesn't seem to affect the playback)?
Observations:
It happens every time as long as I wait long enough (~5 hours). If I run ES for only a short while (~1.5 hour), then it doesn't happen.
I modified the script for troubleshooting, to play a single song on repeat, and log to a file like:
mpg123 --test --loop -1 -@- >/home/pi/bgm.log 2>&1 < <(find "$music_dir" -type f -name "a-ha - Take on Me.mp3")
None of it seemed to make any difference, I'm still seeing the error even after these changes.
The error only shows on the console. Switching
>/dev/null
in the script for>/home/pi/bgm.log
, the error never shows up in the log neither when started manually or from ES background. Nor is it shown ines_log.txt
.Replacing
-Z
(random play) for--loop -1
(infinite repeat), the error is still present.Adding
--test
(only decode, no output; each song takes only a few seconds to process), it still shows the errors, still only after long time.It doesn't appear to be triggered by any particular song/file. I ran through them all, once, in about ten minutes (about 200 songs, with
--test
but without-Z
or--loop -1
) and nothing happened, yet when running a single song on repeat (by refining thefind
command), it does error eventually (tested with two different song files).It doesn't interrupt the music, the song is still playing immediately before I quit ES and see the errors. I didn't listen closely for the whole ~5 hours to make sure there were no blips or glitches, but it sounded fine whenever I did listen, intermittently.
-
UPDATE/SOLVED: it was not related to the music player, after all.
I had presumed that
libmpg123
error meant it was related to mympg123
background music player, but it seems that's may be not the case.It only happen on "random video" screensaver mode, I am unable to reproduce on either "dim" or "slideshow" screensaver modes.
...and, it happens now even with the music disabled. Now
mpg123
is still installed on my RPi4 but when disabled it is never brought up duringautostart.sh
so now is just ES(-dev), and my video files (mostly which come from ScreenScraper).Looks
libmpg123
is also used by thevlc
(which I do use on ES, as I have "use OMX player for screensaver" set to "off.")https://code.videolan.org/videolan/vlc/-/issues/1554
Seems it is caused by (one or more) particular video files. I (backed up and) deleted half my gamelists (so their videos won't be played), and the error still occurred. Then I restored my backups, and deleted the other half the gamelists -- this time no error! I have narrowed it down further to a single game in my SNES playlist -- confirmed by removing all other entries so only that one plays when triggering screensaver, and then the error happens right away.
I tracked it down to a single bad video from screenscraper. Whenever the Pop'n TwinBee (SNES) video is played, the
Illegal Audio-MPEG-Header
error is displayed in console, in multiple, when exit EmulationStation.This is accompanied by a visual glitch in the video playback (or freeze, depending on player) at about 0:16 seconds in, just past the halfway-mark. This also was visible on the video served from the screenscraper website.
I tagged the video in a comment on
screenscraper.fr
asking to re- generate their standardized video. A short time later, that request was granted and, after re-scraping that one game, the error is now resolved!For curiosity: if you have this game, and have a video scraped prior to a few hours ago (about 2024-03-22 19:00 GMT), do you experience the same console error after playing its video on screensaver and, after re-scraping, is it also now resolved?
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.