strawberry icon indicating copy to clipboard operation
strawberry copied to clipboard

When a song is missing, playback stops and shows an error.

Open Poikilos opened this issue 2 years ago • 8 comments

Describe the bug When a song is missing, playback stops and shows an error that doesn't indicate what is really wrong: ""

To Reproduce

  • Add a two songs to a playlist.
  • Rename, move, or delete the second file using a file manager.
  • Double-click the first song, and skip to somewhere near the end.
  • When the transition to the next song occurs, instead the error occurs.

Expected behavior The song should simply be skipped.

  • The fact that the song's name is gray already indicates to the user that the file is missing or renamed, so no further action other than skipping it is necessary. The user has enough information.
  • If the user is playing a playlist, their intent is already clear: To have uninterrupted background music.

Screenshots: image

  • Ignore the "superuser" part. That is merely due to installing the Flatpak as root. The program doesn't run as root.

System Information:

  • Operating system: Devuan 4 Chimera (based on Debian 11 Bullseye)
  • Strawberry Version: 1.0.4 (Flatpak)

Additional context

  • Options:
    • Cross-fade when changing tracks automatically: No

Poikilos avatar May 16 '22 20:05 Poikilos

I have never seen this error shown in strawberry before. For me, when a file doesn't exist, "Resource not found" is shown. So I suspect the error has something to do with the flatpak gstreamer installation. I already added more info to the error dialog on GStreamer errors after 1.0.4: https://github.com/strawberrymusicplayer/strawberry/commit/c246b8f1641c48d5fc1f267a21100d7c4970efc6 Strawberry continues playback depending on the Playlist setting "continue to the next item in the playlist if a song is unavailable" if it's a non-fatal error, it correctly continues to the next track. It always shows the error, I'm not going to change that, and I've answered this before. Just because I shared a project on GitHub doesn't mean I have time to adjust Strawberry to fit every user's preference. I personally don't think it's a good idea to just ignore errors.

jonaski avatar May 16 '22 21:05 jonaski

I get "Resource not found" but not consistently. I thought flatpak would be new enough since my issue wasn't here but I'll switch to a development build as the issue instructions say.

Poikilos avatar May 16 '22 22:05 Poikilos

Is it possible to turn off the error popups? I have absolutely no problem with error messages showing as integrated in the UI, but Strawberry error messages frequently interrupt my work in other programs, because they just pop up in the middle of the screen. When there is a larger network issue and I'm streaming my audio files it's also possible that error messages just continuously pop up and can only be stopped by killing strawberry with htop

insunaa avatar May 18 '22 06:05 insunaa

Here it is with the development build which shows the deeper error: 1.

GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.

../libs/gst/base/gstbasesrc.c(3556): gst_base_src_start (): /GstPlayBin:pipeline-5-pipeline/GstURIDecodeBin:uridecodebin6/GstFileSrc:source: Failed to start

The missing song is from an imported playlist that was imported in an earlier (release version) of Strawberry and when the song was already missing.

  1. If I Try a second time (same playlist, continuing from same song that is before same missing song), the error differs:

Resource not found.

../plugins/elements/gstfilesrc.c(536): gst_file_src_start (): /GstPlayBin:pipeline-11-pipeline/GstURIDecodeBin:uridecodebin14/GstFileSrc:source: No such file "/home/owner/Music/Video Game Music/Japanese Cover Bands/tinabattle.mp3"

It continues playing in the second case though the error appears (actually more than one song is listed), so that's good (In the first case, it does not).

Poikilos avatar May 24 '22 18:05 Poikilos

Perhaps a GStreamer bug.

jonaski avatar Jun 05 '22 02:06 jonaski

@jonaski I narrowed it down to when it goes to the song on its own but not when I start playing at the song. Maybe the fade feature isn't checking whether the song exists before asking gstreamer to blend two together. Can you take a look at that?

Start at song before missing song (playback stops):

GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.

../libs/gst/base/gstbasesrc.c(3556): gst_base_src_start (): /GstPlayBin:pipeline-327-pipeline/GstURIDecodeBin:uridecodebin392/GstFileSrc:source: Failed to start

Start at missing song (playback skips the song, :edit: which is the expected behavior):

Resource not found.

../plugins/elements/gstfilesrc.c(536): gst_file_src_start (): /GstPlayBin:pipeline-328-pipeline/GstURIDecodeBin:uridecodebin393/GstFileSrc:source: No such file "/home/owner/Music/Video Game Music/Compilations/ocremix.org/Mega_Man_4_Standing_on_Top_OC_ReMix.mp3"

Poikilos avatar Jul 24 '22 11:07 Poikilos

Fading is handled entirely by strawberry itself, not gstreamer. Fading is basically just starting a new pipeline instance with the next url while the old is still playing, turning volume down on the old and up for the next. So cross-fading is basically does the same as changing song manually, except keeping the old song playing. This is probably what happens in your case:

  1. You start playing the first song.
  2. The first song is reaching the end and Starwberry tells gstreamer to pre-load the second song.
  3. The URL for the second song is unavailable and gstreamer throws an error, it is ignored by strawberry because the current song needs to finish so it does not throw an error to stop playback.
  4. After the first song ends, Strawberry sets the state to play, but gstreamer already told us that the file was unavailable so we get a set-state error.

jonaski avatar Jul 24 '22 22:07 jonaski

Hi, I'm just chiming in to confirm that this is happening to me too. I'm using strawberry 1.0.7 from the debian package in debian unstable (1.0.7-1)

In my case though it's related to a permission issue -- I'm playing my music files with a different user on the computer but I forgot to set all files as readable to that other user.

I do have the cross-fader enabled as well.

The error that I get is very similar:

../libs/gst/base/gstbasesrc.c(3556): gst_base_src_start (): /GstPlayBin:pipeline-37-pipeline/GstURIDecodeBin:uridecodebin51/GstFileSrc:source: Failed to start

And when the error is shown, generally towards the end of a song, playback stops right there before ending the currently playing song.

As an aside that might not be directly relevant to the playback stopping issue: when the playback stops, if I hit "play" or "next" again strawberry always starts with the same song in the playlist (then the shuffle goes elsewhere new)

p.s.: I really love strawberry so far, I've migrated from clementine to it recently when the debian package was made available. thanks for maintaining this :)

lelutin avatar Jul 27 '22 22:07 lelutin