strawberrymusicplayer / strawberry

:strawberry: Strawberry Music Player
https://www.strawberrymusicplayer.org/
GNU General Public License v3.0
2.53k stars 164 forks source link

once paused playback cannot be continued #1443

Closed derVedro closed 3 weeks ago

derVedro commented 1 month ago

Describe the bug If I try to switch from pause to play, the playback fails. I have to stop the track and then I can play it again.

System Information:

Console log https://pastebin.com/KPLEG5wW (pressed play - multiple times pressed pause - pressed stop - pressed play - close app)

jonaski commented 1 month ago

What GStreamer version?

derVedro commented 1 month ago

What GStreamer version?

Streamer Core Library version 1.24.2

AllKind commented 1 month ago

I also see this happening once in a while.

Linux Mint 21.3. Strawberry 1.0.23

Package: libgstreamer1.0-0 Version: 1.20.3-0ubuntu1

Package: pipewire Version: 1.0.3-2~ubuntu22.04

Package: wireplumber Version: 0.4.17-1~ubuntu22.04

derVedro commented 1 month ago

Maybe this isn't as important information, but here are two things I've noticed:

First. After upgrading to ubuntu 24.04, my thunderbird switched to the snap version and regularly gives me apparmor problems. At the same time as such a problem appears and if strawberry is running and plays any file, playback instantly stops and afterwards I observe all the same behavior when the player went to "pause" state and couldn't change the state to "play" anymore.

Second. Sometimes playback after pausing is possible. If you look at the system log via journalctl -f it looks like this: https://pastebin.com/xck053xi

But if playback cannot be continued, the log looks like that: https://pastebin.com/ffpqcyEr

Heny67 commented 1 month ago

Not the same problem but similar. I have the external speaker set for playback. If I press any button, it immediately switches playback to the monitor speaker and the only way I can get it to play on the sound wall again is to stop playback and start it again. Turning on the screen saver is enough for this problem. UbuntuMate 24.04,strawberry 1.0.23, Qt 5.15.13

jonaski commented 1 month ago

@derVedro @AllKind Please run strawberry with GST_DEBUG and GST_DEBUG_FILE and attach the entire log after this happens.

GST_DEBUG=5 GST_DEBUG_FILE=/tmp/strawberry-gst-debug.log strawberry

jonaski commented 1 month ago

@Heny67 That seems unrelated to this issue, try setting the output and device manually in the backend settings.

derVedro commented 1 month ago

further observations

There are problems with firefox if I try to play audio in parallel with strawberry. Strawberry chopes the sound. It seems that buffer size doesn't matter at all. I have continuously tried different values. I also don't understand what Low and High watermarks are at all.

the used backend: Engine: GStreamer Output: Send audio/video to PipeWire

I found a temporary solution for that problem and for the current #1443, I just switched to VLC/Pulseaudio audio output backend. The funny part is, that now, I can play/pause/resume with play button press (the button doesn't change icon from ▶️ to ⏸️ but is still functional) but I cannot stop the track (⏹️ is grey and disabled). By now it's a semi-good solution for me. At least there is no choped sound anymore if firefox is playing something.

By the way, I found that you can switch the backend engine only if you just started strawberry. As soon as you played something back, this is impossible anymore. The engine drop down menu is disabled.

derVedro commented 1 month ago

@derVedro @AllKind Please run strawberry with GST_DEBUG and GST_DEBUG_FILE and attach the entire log after this happens.

GST_DEBUG=5 GST_DEBUG_FILE=/tmp/strawberry-gst-debug.log strawberry

Oh boy, that's a huge 371MB log for 20 sec runtime. First few times play/pause/play cycle worked, then something gone wrong.

https://www.transferxl.com/download/083Fy6fwhMHPK

Heny67 commented 1 month ago

@Heny67 That seems unrelated to this issue, try setting the output and device manually in the backend settings.

@jonaski Manual settings

kép

AllKind commented 1 month ago

As said, it only randomly happens to me. So I was experimenting a bit today. I found a "semi" reliable reproducer. Sometimes it works, sometimes not. But I'm not sure if it's exactly the same problem.

1 - Start playing a song. 2 - Pause the song. 3 - Move ahead on the timeline (seek ahead). 4 - Hit the play button. -> Does not start playing.

I tried to reproduce it with the GST debug settings, but somehow could not. This is what I see in the terminal window I started strawberry with:

9:58:04.679 DEBUG Player:739                       Playing song "Poco Hombre" QUrl("file:///storage/pub/music/beets/albums/Salsa/Victor_Manuelle/Le_preguntaba_a_la_luna/10-Victor_Manuelle-Poco_Hombre.flac") position 0
09:58:04.680 DEBUG GstEnginePipeline:494            "pulsesink" has volume, enabling volume synchronization.
09:58:04.680 DEBUG GstEnginePipeline:664            Setting buffer duration: 4000000000 low watermark: 0.33 high watermark: 0.99
09:58:04.682 DEBUG GstEnginePipeline:1564           Setting pipeline state to "Playing"
09:58:04.683 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Null" to "Ready"
09:58:04.688 DEBUG MessageReply<MessageType>:90     Releasing ID 16 (finished)
09:58:04.688 DEBUG _MessageReplyBase:33             Acquired ID 16
09:58:04.726 WARN  IconLoader:87                    Couldn't load icon "media-playback-pause" from system theme icons.
09:58:04.732 WARN  IconLoader:87                    Couldn't load icon "media-playback-pause" from system theme icons.
09:58:04.744 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Null" to "Ready"
09:58:04.744 DEBUG GstEngine:965                    Got stream info for "file:///storage/pub/music/beets/albums/Salsa/Victor_Manuelle/Le_preguntaba_a_la_luna/10-Victor_Manuelle-Poco_Hombre.flac:" "FLAC"
09:58:04.750 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Ready" to "Paused"
09:58:04.750 DEBUG GstEnginePipeline:1459           Pipeline is active
09:58:04.750 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Ready" to "Paused"
09:58:04.750 DEBUG GstEnginePipeline:817            3 event latency
09:58:04.750 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Playing"
09:58:04.750 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Playing"
09:58:07.036 DEBUG PlaylistBackend:333              Saving playlist 7
09:58:13.440 DEBUG Database:485                     Starting database integrity check
09:58:13.721 DEBUG Database:555                     Starting database backup
09:58:13.880 DEBUG GstEnginePipeline:1564           Setting pipeline state to "Paused"
09:58:13.880 DEBUG GstEnginePipeline:1564           Setting pipeline state to "Paused"
09:58:13.881 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Playing" to "Paused"
09:58:13.898 WARN  IconLoader:87                    Couldn't load icon "media-playback-start" from system theme icons.
09:58:13.917 WARN  IconLoader:87                    Couldn't load icon "media-playback-start" from system theme icons.
09:58:13.934 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Playing" to "Paused"
09:58:18.692 DEBUG GstEnginePipeline:1598           Seeking to 74000000000
09:58:18.692 DEBUG GstEnginePipeline:817            3 event seek
09:58:18.692 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Paused"
09:58:18.692 DEBUG Player:764                       Track seeked to 74000000000 ns - updating scrobble point
09:58:18.755 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Paused"
09:58:19.169 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Paused"
09:58:19.175 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Paused"
09:58:22.582 DEBUG GstEnginePipeline:1564           Setting pipeline state to "Playing"
09:58:22.582 DEBUG GstEnginePipeline:817            3 event latency
09:58:22.582 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Playing"
09:58:22.592 WARN  IconLoader:87                    Couldn't load icon "media-playback-pause" from system theme icons.
09:58:22.605 WARN  IconLoader:87                    Couldn't load icon "media-playback-pause" from system theme icons.
09:58:22.630 DEBUG GstEnginePipeline:1456           Pipeline state changed from "Paused" to "Playing"
derVedro commented 1 month ago

UPDATE: I guess where is a problem with my local user config after ubuntu upgrade from 23.10 to 24.04. I have no clue where I should start to search for it.

If I create a new user and switch into, strawberry runs fine with default GStreamer/wrapper audio sink for automatically detected audio sink setting. All is perfect, I can pause/resume playback, strawberry doesn't chocke.

On my old user (several times migrated from, I guess, 20.04 til 24.04 now) I get no audio at all if I use GStreamer/wrapper audio sink for automatically detected audio sink.

derVedro commented 1 month ago

UPDATE: I guess where is a problem with my local user config after ubuntu upgrade from 23.10 to 24.04. I have no clue where I should start to search for it.

If I create a new user and switch into, strawberry runs fine with default GStreamer/wrapper audio sink for automatically detected audio sink setting. All is perfect, I can pause/resume playback, strawberry doesn't chocke.

On my old user (several times migrated from, I guess, 20.04 til 24.04 now) I get no audio at all if I use GStreamer/wrapper audio sink for automatically detected audio sink.

okay, that part with no sound with GStreamer/wrapper audio sink for automatically detected audio sink I could solve. It was the most obvious thing I forgot to look up - pavucontrol. Something at upgrade from 23.10 to 24.04 muted all streams.

With that engine and output I am fine, there are no issues with play/resume.

jonaski commented 1 month ago

Have you tried closing all programs, deleting ~/.local/state/wireplumber, and restarting?

jonaski commented 3 weeks ago

Is this still an issue?

derVedro commented 3 weeks ago

Is this still an issue?

nope. The main issue with pause/resume with GStreamer/Send audio/video to PipeWire is still present but not relevant for me anymore. I got GStreamer/wrapper audio sink for automatically detected audio sink to work. Lack of sound was just an ubuntu migration issue. So I switched to it now.

AllKind commented 3 weeks ago

I switched to Pipewire from Pulseaudio in the Backend settings and since then I can't reproduce my above mentioned reproducer any more.

AllKind commented 3 weeks ago

Because the pipewire backend currently is no option (https://github.com/strawberrymusicplayer/strawberry/issues/1453), the above reproducer still applies when using pulseaudio as backend.

jonaski commented 3 weeks ago

That's most likely a GStreamer bug, according to your comment you are using version 1.20.3, which is quite old, the latest in the 1.20 series is 1.20.7, and the latest release currently is 1.24.4, I suggest upgrading GStreamer to a newer release.