Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
5 of 6 tasks
calvaris opened this issue Apr 8, 2024 · 54 comments
Open
5 of 6 tasks

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

calvaris opened this issue Apr 8, 2024 · 54 comments
Labels
B: feature stopped working bug Something isn't working OS: linux issue that occurs on linux but not on other platforms

Comments

@calvaris
Copy link

calvaris commented Apr 8, 2024

Guidelines

  • I have encountered this bug in the latest release of FreeTube.
  • I have encountered this bug in the official downloads of FreeTube.
  • I have searched the issue tracker for open and closed issues that are similar to the bug report I want to file, without success.
  • I have searched the documentation for information that matches the description of the bug I want to file, without success.
  • 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 calvaris added the bug Something isn't working label Apr 8, 2024
@absidue absidue added the OS: linux issue that occurs on linux but not on other platforms label Apr 8, 2024
@raphraph
Copy link

raphraph commented Apr 9, 2024

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.

@sameersharma2006
Copy link

sameersharma2006 commented Apr 10, 2024

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!

@xe-3
Copy link

xe-3 commented Apr 11, 2024

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.

@psychon-night
Copy link

psychon-night commented Apr 12, 2024

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

@efb4f5ff-1298-471a-8973-3d47447115dc

@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

@JoshuaMacklin
Copy link

JoshuaMacklin commented Apr 13, 2024 via email

@nooraibk
Copy link

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

@fadri14
Copy link

fadri14 commented Apr 15, 2024

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

@muelsyse-az
Copy link

muelsyse-az commented Apr 19, 2024

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.

@JoshuaMacklin
Copy link

JoshuaMacklin commented Apr 19, 2024

Very well could be originating from upstream electron as more people on linux specifically are commenting on it recently.
electron/electron#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

@toby63
Copy link

toby63 commented Apr 20, 2024

@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.

@fadri14
Copy link

fadri14 commented Apr 20, 2024

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 "$@"

@toby63
Copy link

toby63 commented Apr 20, 2024

@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.?

@fadri14
Copy link

fadri14 commented Apr 20, 2024

@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

@xe-3
Copy link

xe-3 commented Apr 24, 2024

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.

@zestygrass
Copy link

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

@0Raik
Copy link

0Raik commented May 14, 2024

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

@T-vK
Copy link
Contributor

T-vK commented May 14, 2024

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'));

@psychon-night
Copy link

psychon-night commented May 17, 2024

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

@muelsyse-az
Copy link

muelsyse-az commented May 17, 2024

Very well could be originating from upstream electron as more people on linux specifically are commenting on it recently.
electron/electron#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 :)

@T-vK
Copy link
Contributor

T-vK commented May 17, 2024

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.

@stpnwf
Copy link

stpnwf commented May 23, 2024

Any updates on this? It is so freaking annoying.

@T-vK
Copy link
Contributor

T-vK commented May 23, 2024

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

@efb4f5ff-1298-471a-8973-3d47447115dc
Copy link
Member

efb4f5ff-1298-471a-8973-3d47447115dc commented May 23, 2024

That base version is unrelated to the actual Electron version

See documentation:

And repo that base version is linked to:

@MininuxDev
Copy link

MininuxDev commented Jun 5, 2024

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)

@fadri14
Copy link

fadri14 commented Jun 22, 2024

Hello, I’m on arch linux with wayland, I just updated to v0.21.0 Beta. I confirm that the problem persists, namely, the music stops when the application is no longer displayed on the screen. I downloaded the application from the AUR.

@fernandobom92
Copy link

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.

Hi, I am sorry.
My Fedora version is 40 and the Gnome version is 43.9 Wayland.

@fernandobom92
Copy link

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.

Could you please explain this process a little more?

@fadri14
Copy link

fadri14 commented Jun 23, 2024

@fernandobom92
You must install flatseal with this command: flatpak install flathub com.github.tchx84.Flatseal
It is a graphical application that allows you to manage permissions and other flatpaks applications. So once installed, just launch it and go to the freetube settings. Then just uncheck x11 and check wayland

@ghost
Copy link

ghost commented Jun 24, 2024

The same thing happens here on Ubuntu 24.04, it stops after a while, over and over again. Downloaded from the Ubuntu App Center.

@fernandobom92
Copy link

@fernandobom92 You must install flatseal with this command: flatpak install flathub com.github.tchx84.Flatseal It is a graphical application that allows you to manage permissions and other flatpaks applications. So once installed, just launch it and go to the freetube settings. Then just uncheck x11 and check wayland

Thank you my friend, I will do that!

@gianmarcogg03
Copy link

@fernandobom92 You must install flatseal with this command: flatpak install flathub com.github.tchx84.Flatseal It is a graphical application that allows you to manage permissions and other flatpaks applications. So once installed, just launch it and go to the freetube settings. Then just uncheck x11 and check wayland

I'm on Fedora KDE 40, if I do this the application won't start, running it from the terminal says Missing X server or $DISPLAY.

@fadri14
Copy link

fadri14 commented Jun 27, 2024

@gianmarcogg03
Do you start your session well with wayland. Maybe activate both at the same time, personally it works.

@gianmarcogg03
Copy link

gianmarcogg03 commented Jun 27, 2024

Do you start your session well with wayland.

You mean my desktop? It's Plasma 6.1 so it is Wayland.

Maybe activate both at the same time, personally it works.

The application starts but the player pause problem isn't solved, likely because it's still using X11 since it has access to it.

@fadri14
Copy link

fadri14 commented Jun 27, 2024

Sorry I don’t know how to help you.

@gianmarcogg03
Copy link

I just found a solution myself: leave only the Wayland socket on and add an environment variable called ELECTRON_OZONE_PLATFORM_HINT and set it to auto. The player keeps going just fine now.

@gianmarcogg03
Copy link

I just found a solution myself: leave only the Wayland socket on and add an environment variable called ELECTRON_OZONE_PLATFORM_HINT and set it to auto. The player keeps going just fine now.

Found a new problem: now when I want to fullscreen a video, FreeTube crashes.

@efb4f5ff-1298-471a-8973-3d47447115dc

I just found a solution myself: leave only the Wayland socket on and add an environment variable called ELECTRON_OZONE_PLATFORM_HINT and set it to auto. The player keeps going just fine now.

Found a new problem: now when I want to fullscreen a video, FreeTube crashes.

Same underlying issue as #5304

@mohuddle
Copy link

mohuddle commented Jul 2, 2024

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.

This fixed it for me. Installed flatseal with--
flatpak install flathub com.github.tchx84.Flatseal

It's not perfect, though. Mouse is incredibly small when in the window. And in full-screen mode, it doesn't quite get the window right. Neither are show stoppers and much prefer having FT being able to play in the background.

@sameersharma2006
Copy link

Snap maintainer here,
I have released the fix for the snap package.
The fix involves setting a default env. variable of ELECTRON_OZONE_PLATFORM_HINT to auto, by default it sets that to x11.

The fix will be pushed to stable channel soon.
See: https://bugs.launchpad.net/freetube/+bug/2074286 & https://git.launchpad.net/freetube/commit/?h=main&id=dcf47ae9fd19976df6273fe8e5a826a66b059dbd

Tested, it does solve the problem in my use-case, any queries & issues regarding snap version are welcome at: https://bugs.launchpad.net/freetube

@galure
Copy link

galure commented Aug 8, 2024

Fedora 40 running Gnome on my laptop (Wayland) and Fedora 38 running Plasma on my desktop (X11).
Freetube Flatpak version 0.21.3 on both.

On F40 Gnome/Wayland
Freetube still plays the video if the app is in the background AND in the same workspace. The "main bug" seems fixed, although I never encountered that problem myself.
However, if Freetube is in another workspace, it stops every 5 or 6 seconds, plays for a second and continues (as described in this thread). It's an old bug for me (since Wayland basically) but it was never about Freetube being in the background or out of focus.
[For me, it does not affect multi-monitor. If I put up a second screen on my laptop, Freetube runs even in the background AND on another monitor. But when I change workspace in this config, it bugs again. So workspace related]

On F38 KDE/X11.
I always have multiple monitors on my desktop so I don't use workspaces but I created multiple ones for testing. On KDE/X11, Freetube runs normally in the background AND on another workspace.

This looks like it confirms that the bug is Wayland related. But again, even on Wayland, Freetube works in the background, with multiple windows over it, as long as it is in the same workspace.

Hope it helps, thank you for the terrific work, this app is the best thing since the invention of the holes in the Emmental cheese.

Copy link
Contributor

github-actions bot commented Sep 6, 2024

This issue is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@gael-api
Copy link

gael-api commented Sep 6, 2024

Appears too in Fedora 40/wayland/gnome with the Flatpak version v0.21.3 Bêta
Edit: the flatseal trick solved the issue.

Copy link
Contributor

github-actions bot commented Oct 9, 2024

This issue is stale because it has been open 28 days with no activity. Remove stale label or comment or this will be closed in 7 days.

@christnt
Copy link

christnt commented Oct 9, 2024

The problem persists while running on X11/Xwayland. By forcing the app to run on Wayland, it does the trick but all Freetube windows (including in full screen) get offset. Using PIP mode also works on both X11and Wayland.

@uncharted-user
Copy link

By forcing the app to run on Wayland, it does the trick but all Freetube windows (including in full screen) get offset.

I have been experiencing this issue too. The workaround is not working anymore. Is there any plan for Wayland support?

@Atrate
Copy link
Contributor

Atrate commented Oct 27, 2024

I can confirm that this still happens on Wayland on freetube v0.22

@christnt
Copy link

christnt commented Oct 27, 2024

Working like a charm on Wayland (not X11 on Wayland) since the update (0.22.0 beta). And the window is now correctly framed. No more margin on the desktop. Fullscreen is now filling all the screen on Wayland. Nice work!
Yet, I noticed that I cannot resize the window anymore by clicking on its edges. As a workaround, I need to get to the window's contextual menu to be able to resize. The same goes with Xwayland (X11 on Wayland).

  • Window's contextual menu:
    Screenshot From 2024-10-27 13-46-38
    As for X11 on Wayland, videos still freeze while playing in the background.
    To activate the Wayland mode, not to confuse with Xwayland (X11 on Wayland), the easiest way is to use Flatseal and configure Freetube (as a flatpak, not a snap).

  • Wayland, with a fallback to Xwayland (note That you still can use it on X11):
    Screenshot From 2024-10-27 13-38-26

  • Only Wayland (note that Freetube won't even start on X11):
    Screenshot From 2024-10-27 13-39-01

@uncharted-user
Copy link

* Only Wayland (note that Freetube won't even start on X11):
  ![Screenshot From 2024-10-27 13-39-01](https://private-user-images.githubusercontent.com/74925731/380502070-1e227028-a5ea-4a80-b893-3608b6f73ca7.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzA3Njg0NDksIm5iZiI6MTczMDc2ODE0OSwicGF0aCI6Ii83NDkyNTczMS8zODA1MDIwNzAtMWUyMjcwMjgtYTVlYS00YTgwLWI4OTMtMzYwOGI2ZjczY2E3LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDExMDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQxMTA1VDAwNTU0OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTFlMDdhMTY5ZmM1MWU1ZWZhNTI5MTg0M2Y1OTE4NTU5YzUwZjViYWNiNTU4MmE0MmJjNDA4Y2MwZjMxNjhhNTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.9oihOSP6JYWKrlDAdJRwqLFdMGjm8yDiAbGyZB86Dx0)

It starts after several minutes and shows only white screen, although audio runs with Wayland only socket enabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B: feature stopped working bug Something isn't working OS: linux issue that occurs on linux but not on other platforms
Projects
Status: To assign
Development

No branches or pull requests