squentin / gmusicbrowser

jukebox for large collections of music
http://gmusicbrowser.org
GNU General Public License v3.0
194 stars 42 forks source link

Problems with playback in pipewire and/or wayland #226

Closed yennor closed 2 years ago

yennor commented 2 years ago

I've just changed to wayland and pipewire, and have got problems with playback in gmusicbrowser. before under x-server with pulseaudio everything worked perfect. Since I've changed both at once, I can't tell you which of the two is the problem (But I guess it's pipewire). The seconds counter never moves, even when the playback is working. Usually it manages to play 1-3 Songs, and then the playback stops. Gmusicbrowser shows that it is still in playback mode, but you can't hear anything. When I stop the playback and press play again, everything works again (But it plays the same song again, it never jumped to the next one). It doesn't always stop after the same song. I'm using gmusicbrowser from git and just tried it out again with the newest master, still the same problem. As backend is beeing used gstreamer 1.18.5 in auto sink mode. On Debian Testing. Pipewire version: 0.3.42-1 Attached a debug log how it typically looks when it stops, there are also some gstreamer logs at the beginning, where you can see when it stops playing. gmsuicbrowser.log

yennor commented 2 years ago

I've changed the backend to mplayer, and it has the same behaviour. Here are the complete logs, of when he managed to play 3 songs, and stopped at the end of the 3th one. gmusic.log

squentin commented 2 years ago

I haven't tired pipewire or wayland yet. You could try other backends like mpv or mpg123/..., or change the gstreamer sink from auto to alsa, pulseaudio, or any other, it might give us a clue to what's wrong.

It could actually be due to wayland making gtk behave differently. Could you try switching to the "minimal" layout (either from the settings or with the "-l minimal" command line option) and play a few songs with just that minimal window.

yennor commented 2 years ago

As written above (probably not explicitly enough) I've also changed to backend to mplayer. It was the same behaviour. I can't try out mpg123 since it doesn't seem to support the file formats I use. Changing the gstreamer sink to alsa or jack, ends in the same behaviour. I've went back from wayland to xserver. and still the same bejaviour. So it seems to be a general problem with pipewire. If there's anything else I could try out, just tell me so...

yennor commented 2 years ago

I've tried out gmusicbrowser -minimal (using xserver). It's a bit dificult to use like that, since there are basically no elements I can use (see screenshot). Eventhough => still the same problem. image

yennor commented 2 years ago

Since I can't live without gmusicbrowser, I've changed back to pulseaudio, and the playback is working as it always did...

squentin commented 2 years ago

So I finally tried pipewire on ubuntu 20.04 with the ppa:pipewire-debian/pipewire-upstream. I had a few problems launching it, but after that everything worked perfectly including gmb and all its backends.

So I don't know from where your problem is coming from, it was a bit weird that it would affect mplayer/mpv as they connect to pipewire on their own terms. Both logs point to a "Can't call method "set_markup" on an undefined value at /usr/bin/../share/gmusicbrowser/gmusicbrowser_layout.pm line 3191" but it's hard to guess what caused this. It's when updating one of the playing labels, such as title or time, that's why I asked you to test with minimal layout that doesn't have the time label which I suspected. A gmb label is really a gtkeventbox widget with a gtklabel widget inside, somehow the gtklabel disappeared.

If you want to continue debugging that you could try again with an even more minimal layout that only has the stop and play buttons and post the log. Also you could try with the gtk2 version (from the v1.1.x git branch). Or probably better if you're comfortable editing code, you could try inserting warn "$_[0] $_[0]{name} $_[1]"; at the 3191 line between the "get_child" and the "set_markup" instructions, that could tell us more about that error.

yennor commented 2 years ago

I've tried it again, with the new pipewire 0.3.43 version. Now it seems to work. The only thing I did was updating pipewire, no config changes or other packages. Maybe following Pipewire changes solved the problem:

Many fixes to pulse-server. Memory usage should be improved. Some
crashes are fixed. Underrun handling should work better. Better
compatibility with GStreamer based applications after seeking.

I didn't try out the other backends, but with gstreamer backends it's now working :-) Thanks a lot for your time.