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

Linux - flatpak version throws an exception instead of opening mpv #1735

Closed
kajdo opened this issue Sep 22, 2021 · 28 comments
Closed

Linux - flatpak version throws an exception instead of opening mpv #1735

kajdo opened this issue Sep 22, 2021 · 28 comments
Labels
bug Something isn't working

Comments

@kajdo
Copy link

kajdo commented Sep 22, 2021

Behavior of the program
Using the new version (supporting external players), "open in external player" throws an exception:

Error: spawn /usr/bin/mpv ENOENT

mpv is available using that path

which mpv
/usr/bin/mpv

Expected behavior
mpv opening up and playing the video

To Reproduce

  1. install flatpak version of FreeTube
  2. Go to any video
  3. Click on open external player
  4. See error

Environment Information (please complete the following information):

  • OS: PopOS!
  • OS Version: Linux pop-os 5.11.0-7633-generic #35163010093021.04~ae2753e-Ubuntu SMP Mon Aug 30 18:26:54 UTC x86_64 x86_64 x86_64 GNU/Linux
  • FreeTube version: 0.14.0 beta
  • Installation Method (If applicable): FlatHub
  • Primary API Used: Local API

Additional context
installed the AppImage and the issue is gone -- i guess it's related to the "sandboxing" of flatpak apps

@kajdo kajdo added the bug Something isn't working label Sep 22, 2021
@repparw
Copy link

repparw commented Nov 18, 2021

I was investigating this because I saw this exception and arrived at this open issue
Maybe it could be solved by using flatpak-spawn --host mpv (instead of spawn) on the flatpak builds? It seems to be the way to execute commands on host from a flatpak app

@lurkynerd
Copy link

I have the same issue on the Flatpak version. Throws the error no matter what player or path we use.

@greenfoo
Copy link

greenfoo commented Feb 3, 2022

@repparw was on the right track: it is possible to use mpv right now by using "flatpak-spawn". This is what you need to do:

  1. Go to "Setting" --> "External Player Setting"
  2. Set "External Player" to "mpv"
  3. Set "Custom External Player Executable" to "flatpak-spawn" (without the quotes)
  4. Set "Custom External Player Arguments" to "--host;/usr/bin/mpv" (without the quotes and without spaces... notice there is a ";" between the two words).

2022-02-03_23-33

That's it :)

PS: Maybe this should be added as an option in the "drop-down" menu (ex: "mpv inside flatpak") or, at least, somewhere in the documentation.

@dinotheextinct
Copy link

@repparw was on the right track: it is possible to use mpv right now by using "flatpak-spawn". This is what you need to do:

1. Go to "Setting" --> "External Player Setting"

2. Set "External Player" to "mpv"

3. Set "Custom External Player Executable" to "**flatpak-spawn**" (without the quotes)

4. Set "Custom External Player Arguments" to "**--host;/usr/bin/mpv**" (without the quotes and without spaces... notice there is a ";" between the two words).

2022-02-03_23-33

That's it :)

PS: Maybe this should be added as an option in the "drop-down" menu (ex: "mpv inside flatpak") or, at least, somewhere in the documentation.

This worked for me, much appreciated!

@DEFCON001
Copy link

I was having a similar issue, but with launching the mpv flatpak (rather than the binary), this is the solution that got it working: image

@dinotheextinct
Copy link

Suddenly it doesn't work for my flatpak version any longer. I also installed through appimage and it works without any problems there.
image

@DEFCON001
Copy link

DEFCON001 commented Aug 5, 2022

@dinotheextinct can you send the output of "flatpak info --show-permissions io.mpv.Mpv" I doubt this is a permissions issue but I wanna check it has dbus access first as I have no idea what could also cause the appimage to break.

@dinotheextinct
Copy link

flatpak info --show-permissions io.mpv.Mpv  ✔  22:12:05  error: io.mpv.Mpv/*unspecified*/*unspecified* not installed

@DEFCON001
Copy link

Sorry I meant "io.freetubeapp.FreeTube" instead of "io.mpv.Mpv", please run the same command but with the freetube name above, and send the output.

@dinotheextinct
Copy link

` ~  flatpak info --show-permissions io.freetubeapp.FreeTube  ✔  22:18:00 
[Context]
shared=network;ipc;
sockets=x11;pulseaudio;
devices=dri;
filesystems=xdg-download;

[Session Bus Policy]
org.gnome.SessionManager=talk
org.freedesktop.ScreenSaver=talk
org.mpris.MediaPlayer2.freetube=own
org.gnome.SettingsDaemon=talk
org.freedesktop.PowerManagement=talk
org.mpris.MediaPlayer2.chromium.*=own

[Environment]
TZ=UTC`

@DEFCON001
Copy link

Okay I see how to fix this, for some reason the flatpak freetube ppl (or it might just be a part of the update process) pushed out a change that disabled part of the dbus permission called "session-bus", you can enable it in the cli but its a bit messy and it would be better practice to get some experience with Flatseal. Flatseal is a GUI app that lets you modify the permissions a flatpak has, like camera access, files, ect. You can install it with:
flatpak install flathub com.github.tchx84.Flatseal
(https://flathub.org/apps/details/com.github.tchx84.Flatseal).
Once you have installed it, run the application, go to FreeTube on the left column, click it, then find the permission:

  • D-Bus session bus (don't be confused with D-Bus system bus which is next to it)

Toggle that on with the switch, then close Flatseal, and close FreeTube if it is still running, when you re-open FreeTube, it should work again.

Flatseal lets you manipulate the permission of apps in a bit more detail than say macOS, so feel free to change values about and experiment, you can always reset things with the "Reset" button in the bottom right to reset them back to the standard install, however if you do that you will have to re-enable the D-Bus session bus again.

For some extra info, dbus stuff usually involves letting the flatpak interact with other programs in the system, and either of the two commands is required for "flatpak-spawn" to work. Either permission works, but from my understanding the session bus one is a lower permission than system bus, so its better to just enable that one for security reasons. Also for a permission change to take effect, the program needs to be launched after the toggle has been switched, that's why we closed FreeTube and re-opened it.

@DEFCON001
Copy link

Also yep, it was them: flathub/io.freetubeapp.FreeTube@0b495c9 I'll see if I can get them to add a special permission for the mpv binary itself, but I doubt I could convince them to let it have access to all flatpaks in the system for the situation when mpv is a flatpak.

@DEFCON001
Copy link

I've made this issue to see if it can be fixed by default, if anyone knows the dbus bus name for mpv, please comment it there, as I can't find it online or on my system.
flathub/io.freetubeapp.FreeTube#74 (comment)

@PolGZ
Copy link

PolGZ commented Sep 3, 2022

Configuring the external player settings as described by @greenfoo and then adding D-Bus session permission as described by @DEFCON001 solved it for me.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@dinotheextinct
Copy link

Is this now fixed? Because appimage doesnt work with external mpv either anymore for me.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

@github-actions
Copy link
Contributor

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.

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

I'm going to close this issue because there is an open issue in the flathub repo and needs to be addressed over there. You are free to take the discussions over there or keep it here.

flathub/io.freetubeapp.FreeTube#74

@ghost
Copy link

ghost commented Jan 17, 2024

here is working solution.

(install mpv flatpak version)

launch freetube like this:
flatpak run --talk-name=io.mpv.Mpv io.freetubeapp.FreeTube

add these settings:
custom external player executable: flatpak-spawn
custom external player arguments: --host;flatpak;run;io.mpv.Mpv

@sascha-wi
Copy link

Why is this documented nowhere, have to search through issues on github to find solutions for something straightforward as this...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

9 participants