FreeTube icon indicating copy to clipboard operation
FreeTube copied to clipboard

[Bug]: App stops playing (pauses) when it goes to background

Open calvaris opened this issue 1 year ago • 50 comments

Guidelines

  • [X] I have encountered this bug in the latest release of FreeTube.
  • [X] I have encountered this bug in the official downloads of FreeTube.
  • [X] I have searched the issue tracker for open and closed issues that are similar to the bug report I want to file, without success.
  • [X] I have searched the documentation for information that matches the description of the bug I want to file, without success.
  • [X] This issue contains only one bug.

Describe the bug

  1. Paste a Youtube URL
  2. play
  3. move out of focus of the app, to have it on background

Expected Behavior

app should not stop playing but it does

Issue Labels

feature stopped working

FreeTube Version

v0.20.0 Beta

Operating System Version

Debian testing

Installation Method

Flathub

Primary API used

Local API

Last Known Working FreeTube Version (If Any)

No response

Additional Information

No response

Nightly Build

calvaris avatar Apr 08 '24 07:04 calvaris

Same here on Ubuntu 22.04 and with Freetube v0.20.0 Beta installed from official download (https://github.com/FreeTubeApp/FreeTube/releases/download/v0.20.0-beta/freetube_0.20.0_amd64.deb).

The pausing does not occur instantly, it takes sometimes a few dozens of seconds, but it always stops.

The pausing does not occur if there is a Freetube window not in background, even if it is not the window which is playing.

raphraph avatar Apr 09 '24 13:04 raphraph

Can confirm the same in the snap package with the latest version.

Terminal logs,maybe relevant ?

[19376:0410/141917.655994:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[19376:0410/141917.655994:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[19376:0410/142106.622690:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[19376:0410/142109.298473:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

sameersharma2006 avatar Apr 10 '24 08:04 sameersharma2006

Can confirm the same in the snap package with the latest version.

Terminal logs,maybe relevant ?

[19376:0410/141917.655994:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[19376:0410/141917.655994:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[19376:0410/142106.622690:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[19376:0410/142109.298473:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

I also do not know if those errors are relevant or not. But I'm seeing a similar error messages as well:

[2:0411/104322.988551:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[2:0411/104322.988627:ERROR:bus.cc(407)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[45:0411/104325.809057:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[45:0411/104338.036726:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[45:0411/104338.047335:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

(in my case: Flatpak version of Freetube 0.20 Beta installed, on Linux (Fedora 40 Beta and Gnome 46)

A little searching gave me the impression these messages relate to an upstream issue in Electron and/or Chromium.

xe-3 avatar Apr 11 '24 17:04 xe-3

Same bug here. Ubuntu 23.04, installed from the download page (AppImage version)

[201778:0411/182422.985639:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[201778:0411/183514.618333:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[201778:0411/183533.852878:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!

These are still showing up when the window is visible but unfocused (on a second monitor) but playback is NOT interrupted

These also show up on a single-monitor setup when the app loses focus. In that case, it does stop playback

MurderAxolotl avatar Apr 12 '24 01:04 MurderAxolotl

@JoshuaMacklin could you maybe look into this? There have been allot of bug reports opened since release that are all linux (some also exclusive to flatpak) related. To see all the issue use label filter OS: linux

I can take a look into this next week when I am free, I also only noticed this after the 0.20 update, can’t believe it’s anything related to the flathub version changes we’ve recently made as I’ve had them back ported to 0.19 for months

JoshuaMacklin avatar Apr 13 '24 11:04 JoshuaMacklin

I'm on latest release from flatpak and am having same issue on fedora 39, app stops playing until it is focused.

nooraibk avatar Apr 14 '24 03:04 nooraibk

Hello, I have the same problem on arch linux with the AUR package.

fadri14 avatar Apr 15 '24 08:04 fadri14

Just wanted to confirm that I'm experiencing the same issue. Currently, running Fedora Kinoite (Atomic KDE) 40 and using the Flathub version 0.20.0 beta.

This can be easily reproduced on KDE by switching to another virtual desktop, which would cause the video to stop playing after a while (and sporadically play-stop-play), despite it being on the foreground in the other virtual desktop.

muelsyse-az avatar Apr 19 '24 06:04 muelsyse-az

Very well could be originating from upstream electron as more people on linux specifically are commenting on it recently. https://github.com/electron/electron/issues/32760

However I did notice on Bazzite Gnome (Gaming oriented Fedora Silverblue w/ extra packages) is not affected even in background and another workspace for an hour. However they do add extra VRR / Video Syncing packages that may be fixing the vsync / sync issues that are arising for others on more stock linux operating systems.

My ask to the others that are running into this problem, are you all getting the same GetVSyncParametersIfAvailable() failed terminal logs? Do you use Variable / High Refresh Rate screens? And even possibly trying out the latest dev build appimage to see if the issue may be solved with a slightly more updated electron version.

https://github.com/FreeTubeApp/FreeTube/actions/runs/8753729711

JoshuaMacklin avatar Apr 19 '24 16:04 JoshuaMacklin

@fadri14

Hello, I have the same problem on arch linux with the AUR package.

Could you give more details? Because I am using the latest master on ArchLinux, with KDE, Electron 29 and I don't have this issue.

toby63 avatar Apr 20 '24 00:04 toby63

Well, actually. Now I have another problem. When I launch the application, it quits directly. There's this error in the terminal: /usr/bin/freetube : ligne 3 : 4263 Erreur de segmentation (core dumped)electron /usr/lib/freetube/app.asar "$@"

fadri14 avatar Apr 20 '24 07:04 fadri14

@fadri14 See: https://aur.archlinux.org/cgit/aur.git/commit/?h=freetube&id=035f14135bd1eb6277a00767f4f1fd57eba760c5 You probably have to update, to use Electron29.

But this is offtopic, could you provide more details on your setup for the main problem discussed here? Do you use Gnome or something else etc.?

toby63 avatar Apr 20 '24 12:04 toby63

@toby63 Ok thanks, for the info. Indeed, it solved this problem and I can now say that the error message is as follows

[37788:0420/154330.343621:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!

Besides, I don’t use desktop environment. I use sway window manager

fadri14 avatar Apr 20 '24 13:04 fadri14

Do you use Variable / High Refresh Rate screens?

In my case no. I'm on a Dell XPS laptop with a 60 hz FHD display.

xe-3 avatar Apr 24 '24 06:04 xe-3

experiencing the same issue on Flatpak version on Fedora 40 with Plasma 6.

zestygrass avatar Apr 26 '24 21:04 zestygrass

experiencing the same issue on Flatpak verision on Manjaro latest with Gnome 46

0Raik avatar May 14 '24 08:05 0Raik

Same here. Been having these issues for weeks, even with the latest FreeTube v0.20.0 Beta (Flatpak).

System Details Report


Report details

  • Date generated: 2024-05-14 13:12:16

Hardware Information:

  • Hardware Model: Dell Inc. XPS 15 9575
  • Memory: 16,0 GiB
  • Processor: Intel® Core™ i7-8705G × 8
  • Graphics: Intel® HD Graphics 630 (KBL GT2)
  • Disk Capacity: 4,0 TB

Software Information:

  • Firmware Version: 1.15.1
  • OS Name: Manjaro Linux
  • OS Build: rolling
  • OS Type: 64-bit
  • GNOME Version: 46
  • Windowing System: Wayland
  • Kernel Version: Linux 6.1.90-1-MANJARO

System logs

No related logs in journalctl.


Frontend logs

The only line popping out is:

VIDEOJS: WARN: using Vhs.BANDWIDTH_VARIANCE is UNSAFE be sure you know what you are doing

Not sure if it is related.


Frontend events

Logging events like onvisibilitychange shows that the frontend is not able to use these to distinguish between the window getting minimized or losing focus:

document.onvisibilitychange = () => console.log(document.hidden ? 'Minimized or Unfocused' : 'Restored or Focused');
window.onblur = () => console.log('Window Blurred');
window.onfocus = () => console.log('Window Focused');
window.onresize = () => console.log('Window Resized');
window.onbeforeunload = () => console.log('Window About to Unload');
window.onunload = () => console.log('Window Unloaded');
document.addEventListener('focusin', () => console.log('Element Focused In'));
document.addEventListener('focusout', () => console.log('Element Focused Out'));

T-vK avatar May 14 '24 11:05 T-vK

My ask to the others that are running into this problem, are you all getting the same GetVSyncParametersIfAvailable() failed terminal logs? Do you use Variable / High Refresh Rate screens? And even possibly trying out the latest dev build appimage to see if the issue may be solved with a slightly more updated electron version.

Yes to the log question, and yes to owning an HRR screen. However, this issue still occurs when my 165hz monitor is not connected. My laptop's built-in display runs at 60hz

Using the build you linked, I am still experiencing the same issues. When the application is in the background, I get long periods of buffering, then a few seconds of audio... then more buffering.

In addition, I tried on the most recent build and still get the issue here

MurderAxolotl avatar May 17 '24 01:05 MurderAxolotl

Very well could be originating from upstream electron as more people on linux specifically are commenting on it recently. https://github.com/electron/electron/issues/32760

However I did notice on Bazzite Gnome (Gaming oriented Fedora Silverblue w/ extra packages) is not affected even in background and another workspace for an hour. However they do add extra VRR / Video Syncing packages that may be fixing the vsync / sync issues that are arising for others on more stock linux operating systems.

My ask to the others that are running into this problem, are you all getting the same GetVSyncParametersIfAvailable() failed terminal logs? Do you use Variable / High Refresh Rate screens? And even possibly trying out the latest dev build appimage to see if the issue may be solved with a slightly more updated electron version.

https://github.com/FreeTubeApp/FreeTube/actions/runs/8753729711

I can confirm that the terminal log shows up. I have tested on 60Hz monitor (laptop) and 75Hz monitor, no VRR and High RR. I'll try out the dev build when I'm done with my next paper. Finals season rn.

Edit: Just wanted to say, Freetube is a critical software due to my heavy usage for studying. I thank all the contributors and maintainers for developing such a GOATed project :)

muelsyse-az avatar May 17 '24 01:05 muelsyse-az

I also think it is most likely the electron version causing this issue. Installing FreeTube from AUR instead of the Flatpak, it works just fine.

T-vK avatar May 17 '24 09:05 T-vK

Any updates on this? It is so freaking annoying.

stpnwf avatar May 23 '24 19:05 stpnwf

Maybe someone just needs to update the electron version of the Flatpak to 29. Seems to be at 23.08 right now: https://github.com/flathub/io.freetubeapp.FreeTube/blob/26d154dacc2bfd4e81abe598f4c4053f56f76b62/io.freetubeapp.FreeTube.yml#L7

T-vK avatar May 23 '24 21:05 T-vK

That base version is unrelated to the actual Electron version

See documentation:

  • https://docs.flatpak.org/en/latest/electron.html

And repo that base version is linked to:

  • https://github.com/flathub/org.electronjs.Electron2.BaseApp

For other people with this issue who absolutely need freetube, a workaround i am using for now is disabling hardware acceleration. There doesn't seem to be a setting to change this (or at least i haven't found it) so I added app.disableHardwareAcceleration() to runApp in src/main/index.js

It's probably not ideal for less powerful cpus, but at least it works (fedora kde wayland)

MininuxDev avatar Jun 05 '24 11:06 MininuxDev

Temporary Fix:

For those on Wayland using the Flatpak version, make sure to use flatseal to turn off the X11 Socket, and Turn on the Wayland socket. As FreeTube's flatpak currently defaults to X11 even if you use a wayland system.

I did this on a second system that was having this issue and this resolved it.

JoshuaMacklin avatar Jun 06 '24 04:06 JoshuaMacklin

Oh that's even better

Weirdly on kde, /app/bin/run.sh doesn't detect that i'm on wayland, the [ -e "${XDG_RUNTIME_DIR}/${WAYLAND_DISPLAY:-wayland-0}" ] condition is false. So i had to manually add the flag --ozone-platform-hint=auto when running freetube. Still an easier workaround that recompiling

MininuxDev avatar Jun 06 '24 12:06 MininuxDev

Does this issue still persist for you on v0.21.0?

I am facing this same issue here, I am running:

  • Fedora OS 43.9 (Wayland)
  • FreeTube v0.21.0 Beta (Flatpak Version)

Is stops playing the music If I minimize the FreeTube window or place another window over it.

fernandobom92 avatar Jun 21 '24 19:06 fernandobom92

I am facing this same issue here, I am running:

  • Fedora OS 43.9 (Wayland)
  • FreeTube v0.21.0 Beta (Flatpak Version)

Is stops playing the music If I minimize the FreeTube window or place another window over it.

What Fedora OS 43.9? Fedora 40 is the current release. Do you mean the GNOME version? Even then the current release is GNOME 46 iirc.

muelsyse-az avatar Jun 22 '24 03:06 muelsyse-az