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

dnd does not work when using flatpak #300

Open
hubslave opened this issue Aug 26, 2017 · 17 comments
Open

dnd does not work when using flatpak #300

hubslave opened this issue Aug 26, 2017 · 17 comments

Comments

@hubslave
Copy link

Overview Description:
Hello, I installed GnomeMpv as flatpak from flathub repository on Enterprise Linux 7.4 minimal install with only few packages installed - Gnome Session, flatpak and ostree. Everytime I try to play any video from local disk I get this error: Playback was terminated abnormally. Reason: Loading failed.

Please could you tell me what can be the problem? Does GnomeMpv requies for proper functionallity some other packages? Should I also install packages like ostree-fuse, gvfs-fuse, ffmpeg, gstreamer...?

Steps to Reproduce:

  1. Install Enterprise Linux 7.4 Minimal
  2. Install Gnome Session, flatpak, ostree
  3. Install GnomeMpv from flathub repository

Actual Results:
Playback was terminated abnormally. Reason: Loading failed.

Expected Results:
Video playing :)

Version:
Latest

Additional Information:
No

Thank you very much and have a nice day :)

@gnome-mpv
Copy link
Collaborator

Run flatpak run --env=G_MESSAGES_DEBUG=all io.github.GnomeMpv, open a file, and post the output here.

@hubslave
Copy link
Author

hubslave commented Aug 26, 2017

Hello, thank you very much for quick response :) this is the output:

(gnome-mpv:3): Gtk-DEBUG: Connecting to session manager
(gnome-mpv:3): Gtk-DEBUG: Failed to get the GNOME session proxy: The name org.gnome.SessionManager is not owned
(gnome-mpv:3): Gtk-DEBUG: Failed to get the Xfce session proxy: The name org.xfce.SessionManager is not owned
** INFO: Starting GNOME MPV 0.12
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "CanQuit"
** (gnome-mpv:3): DEBUG: Adding property "CanSetFullscreen"
** (gnome-mpv:3): DEBUG: Adding property "CanRaise"
** (gnome-mpv:3): DEBUG: Adding property "Fullscreen"
** (gnome-mpv:3): DEBUG: Adding property "HasTrackList"
** (gnome-mpv:3): DEBUG: Adding property "Identity"
** (gnome-mpv:3): DEBUG: Adding property "DesktopEntry"
** (gnome-mpv:3): DEBUG: Adding property "SupportedUriSchemes"
** (gnome-mpv:3): DEBUG: Adding property "SupportedMimeTypes"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "PlaybackStatus"
** (gnome-mpv:3): DEBUG: Adding property "Rate"
** (gnome-mpv:3): DEBUG: Adding property "Metadata"
** (gnome-mpv:3): DEBUG: Adding property "Volume"
** (gnome-mpv:3): DEBUG: Adding property "MinimumRate"
** (gnome-mpv:3): DEBUG: Adding property "MaximumRate"
** (gnome-mpv:3): DEBUG: Adding property "CanGoNext"
** (gnome-mpv:3): DEBUG: Adding property "CanGoPrevious"
** (gnome-mpv:3): DEBUG: Adding property "CanPlay"
** (gnome-mpv:3): DEBUG: Adding property "CanPause"
** (gnome-mpv:3): DEBUG: Adding property "CanSeek"
** (gnome-mpv:3): DEBUG: Adding property "CanControl"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "PlaybackStatus"
** (gnome-mpv:3): DEBUG: Adding property "CanSeek"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "CanGoPrevious"
** (gnome-mpv:3): DEBUG: Adding property "CanGoNext"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Rate"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** INFO: Failed to retrieve property "path" as string.
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Metadata"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Volume"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Tracks"
** (gnome-mpv:3): DEBUG: Adding property "CanEditTracks"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.TrackList
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Tracks"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.TrackList
** (gnome-mpv:3): DEBUG: Applying default option --vo=opengl,vdpau,vaapi,xv,x11,opengl-cb,
** (gnome-mpv:3): DEBUG: Applying default option --osd-level=1
** (gnome-mpv:3): DEBUG: Applying default option --softvol=yes
** (gnome-mpv:3): DEBUG: Applying default option --force-window=immediate
** (gnome-mpv:3): DEBUG: Applying default option --input-default-bindings=yes
** (gnome-mpv:3): DEBUG: Applying default option --audio-client-name=gnome-mpv
** (gnome-mpv:3): DEBUG: Applying default option --title=${media-title}
** (gnome-mpv:3): DEBUG: Applying default option --autofit-larger=75%
** (gnome-mpv:3): DEBUG: Applying default option --window-scale=1
** (gnome-mpv:3): DEBUG: Applying default option --pause=yes
** (gnome-mpv:3): DEBUG: Applying default option --ytdl=yes
** (gnome-mpv:3): DEBUG: Applying default option --load-scripts=no
** (gnome-mpv:3): DEBUG: Applying default option --osd-bar=no
** (gnome-mpv:3): DEBUG: Applying default option --input-cursor=no
** (gnome-mpv:3): DEBUG: Applying default option --cursor-autohide=no
** (gnome-mpv:3): DEBUG: Applying default option --softvol-max=100
** (gnome-mpv:3): DEBUG: Applying default option --config=yes
** (gnome-mpv:3): DEBUG: Applying default option --config-dir=/home/user/.var/app/io.github.GnomeMpv/config/gnome-mpv
** (gnome-mpv:3): DEBUG: Applying default option --screenshot-template=gnome-mpv-shot%n
** (gnome-mpv:3): DEBUG: Using temporary input config file: /tmp/.5TAJ5Y
** (gnome-mpv:3): DEBUG: Applying extra mpv options:
** (gnome-mpv:3): DEBUG: Attaching mpv window to wid 0xe00048
** INFO: Using mpv 0.25.0
** (gnome-mpv:3): DEBUG: Setting volume to 100.000000
** INFO: Failed to retrieve property "time-pos" using mpv format 5. Reason: property unavailable.
** INFO: Failed to retrieve property "time-pos" using mpv format 5. Reason: property unavailable.
** INFO: Failed to retrieve property "time-pos" using mpv format 5. Reason: property unavailable.
** INFO: Failed to retrieve property "time-pos" using mpv format 5. Reason: property unavailable.
** (gnome-mpv:3): DEBUG: Retrieved option --window-scale=1.000000
** (gnome-mpv:3): DEBUG: Retrieved option --autofit-larger=75%x0
** (gnome-mpv:3): DEBUG: Retrieved option --window-scale=1.000000
** (gnome-mpv:3): DEBUG: Retrieved option --autofit-larger=75%x0
** (gnome-mpv:3): DEBUG: Received mpv property change event for "aid"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "vid"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "sid"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "core-idle"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "PlaybackStatus"
** (gnome-mpv:3): DEBUG: Adding property "CanSeek"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "idle-active"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "PlaybackStatus"
** (gnome-mpv:3): DEBUG: Adding property "CanSeek"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "fullscreen"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "pause"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "loop"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "playlist"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Tracks"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.TrackList
** (gnome-mpv:3): DEBUG: Received mpv property change event for "playlist-count"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "CanGoPrevious"
** (gnome-mpv:3): DEBUG: Adding property "CanGoNext"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "speed"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Rate"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "track-list"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "vo-configured"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "volume"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Volume"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "pause"
** INFO: Loading file (append=FALSE): file:///data/Downloads/Curl%20Noise%20Flow.mp4
** (gnome-mpv:3): DEBUG: Received mpv property change event for "idle-active"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "PlaybackStatus"
** (gnome-mpv:3): DEBUG: Adding property "CanSeek"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "media-title"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "playlist"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Tracks"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.TrackList
** (gnome-mpv:3): DEBUG: Sent global key up to mpv
** (gnome-mpv:3): DEBUG: Retrieved option --window-scale=1.000000
** (gnome-mpv:3): DEBUG: Retrieved option --autofit-larger=75%x0
** Message: [file] Cannot open file '/data/Downloads/Curl Noise Flow.mp4': No such file or directory
** Message: [stream] Failed to open /data/Downloads/Curl Noise Flow.mp4.
** (gnome-mpv:3): DEBUG: Received mpv property change event for "idle-active"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "PlaybackStatus"
** (gnome-mpv:3): DEBUG: Adding property "CanSeek"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** (gnome-mpv:3): DEBUG: Received mpv property change event for "pause"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "media-title"
** (gnome-mpv:3): DEBUG: Received mpv property change event for "playlist"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "Tracks"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.TrackList
** (gnome-mpv:3): DEBUG: Received mpv property change event for "playlist-count"
** (gnome-mpv:3): DEBUG: Preparing property change event
** (gnome-mpv:3): DEBUG: Adding property "CanGoPrevious"
** (gnome-mpv:3): DEBUG: Adding property "CanGoNext"
** (gnome-mpv:3): DEBUG: Emitting property change event on interface org.mpris.MediaPlayer2.Player
** INFO: Terminating mpv

@hubslave
Copy link
Author

I tried to install flatpak-libs, xdg-desktop-portal, xdg-desktop-portal-gtk- xdg-utils, gvfs-fuse, fuse, ostree-fuse, I tried to start gnome-mpv flatpak as sudo but nothing helps, I am still getting the same error :/

@gnome-mpv
Copy link
Collaborator

Looks like flatpak can't handle opening files via drag-and-drop yet. See: flatpak/xdg-desktop-portal#99

It should work fine if you open the file with the file chooser (press ctrl+o).

@hubslave
Copy link
Author

I already tried this but it does not work too, even opening file from command line does not work:

flatpak run io.github.GnomeMpv '/data/Downloads/Curl Noise Flow.mp4'
** Message: [file] Cannot open file '/data/Downloads/Curl Noise Flow.mp4': No such file or directory
** Message: [stream] Failed to open /data/Downloads/Curl Noise Flow.mp4.

I tried to install some other flatpak applications like eog, darktble or libreoffice and they all seem working fine. They can open all files I feed to them.

@hubslave
Copy link
Author

If other apps work and can open files it cant be bug of flatpak or could it?

@hubslave
Copy link
Author

Enterprise Linux 7.4 is using flatpak version 0.8.7, could it be possible that opposed to newer versions it does not support some function which GnomeMpv needs for opening files?

@gnome-mpv
Copy link
Collaborator

gnome-mpv commented Aug 26, 2017

I think gnome-mpv's flatpak is set up such that it cannot access the host machine's filesystem directly. Instead, it relies on xdg-desktop-portal to be able to open files. Many (most?) flatpak applications, including eog, are not set up this way. Seeing that xdg-desktop-portal doesn't support opening files via dnd yet, maybe it should be given filesystem access until it is ready?

/cc @TingPing

@gnome-mpv
Copy link
Collaborator

Enterprise Linux 7.4 is using flatpak version 0.8.7, could it be possible that opposed to newer versions it does not support some function which GnomeMpv needs for opening files?

That's possible. I tested with flatpak 0.9.6, and opening files using the file chooser works fine, but command line and dnd do not.

@hubslave
Copy link
Author

hubslave commented Aug 26, 2017

Ok new findings...

Before I had only installed flatpak and ostree packages
when running GnomeMpv I was not able to open video with plus sign icon and "open" (when clicking on open nothing happened, even no "File Chooser Box" appeared) (I was also not able to play anything via command line, drag and drop or double click)

So when I was testing the app with additional packages (xdg-desktop-portal, fuse...) I was not testing various methods of opening file... if it it not work via command line I percieved it as non functional. I thought that it is some core bug, I had no idea that various methods of opening could work.

But after you mentioned that I should try various methods of opening. I tried to install all the additional packages (xdg-desktop-portal, fuse...) and again tried to open file with plus sign icon, clicking on "open" and now it opened a "File Chooser Box"! And great thing happened, when choosing some file it started playing flawlessly!

But no other type of opening a file works, double click is not working, drag and drop is not working, command line is not working.

I also tested various package and for GnomeMpv only opens "File Chooser Box" only when I install xdg-desktop-portal-gtk (which pulls xdg-desktop-portal and flatpak-libs as dependencies). If I dont have it installed, clicking on "open" under plus sign icon does nothing.

  1. Is there some way to configure GnomeMpv now that it will also play files when double clicking on them?

  2. Why does not flatpak package pulls xdg-desktop-portal-gtk as dependency if some applications need it to work properly?

  3. Would not it be better to use direct filesystem access as you mentioned? Would not it allow GnomeMpv to play files with drag and drop, command line and double click? Does accesing files with xdg-desktop-portal brings some advantages?

(Even though Open dialog works now for me, command line, double click and drag and drop still does not work)

If you need some additional information or testing please let me know

Thank you for your time and have a nice day :)

@TingPing
Copy link
Contributor

TingPing commented Aug 26, 2017

flatpak run io.github.GnomeMpv '/data/Downloads/Curl Noise Flow.mp4'

You can't just give a path to it, ideally just use gio open '/data/Downloads/Curl Noise Flow.mp4'
You do need a recent flatpak for that also.

maybe it should be given filesystem access until it is ready?

DnD is the only missing feature. I personally believe a media player is a very security sensitive application and it makes sense to limit its access. You do need a relatively new version to open paths via command line/file manager though.

@hubslave You are really overthinking the whole package situation, you only need two, flatpak and xdg-desktop-portal-gtk, afaik every distro has the latter as some form of dependency of the former.

@TingPing
Copy link
Contributor

TingPing commented Aug 26, 2017

Oh and users do have an escape hatch if they don't care about security: flatpak override io.github.GnomeMpv --filesystem=host:ro

@hubslave
Copy link
Author

TingPing thank you very much for clarification, I read more about how desktop-portal works and it makes perfect sense. But in my case xdg-desktop-portal-gtk was not installed automatically with flatpak. Maybe could it be possible for gnome-mpv to warn new users that xdg-desktop-portal-gtk is not installed (in case it is not installed?) and it is needed for proper function?

"Oh and users do have an escape hatch if they don't care about security: flatpak override io.github.GnomeMpv --filesystem=host:ro"

Thank you also for this tip. My question is, is it possible for media player to do any harm if it has read only access to filesystem? (I am not sure what flag --filesystem=host:ro means but I suppose it grants read only filesystem access).

@TingPing
Copy link
Contributor

TingPing commented Aug 28, 2017

Maybe could it be possible for gnome-mpv to warn new users that xdg-desktop-portal-gtk is not installed (in case it is not installed?) and it is needed for proper function?

We probably could, it should be an uncommon case though.

My question is, is it possible for media player to do any harm if it has read only access to filesystem?

Well if you theoretically opened malware it could upload private files. In practice you are fine, only better than traditionally unsandboxed applications.

I suppose it grants read only filesystem access

Correct. drop the ro for write access but I don't think gnome-mpv needs that.

But in my case xdg-desktop-portal-gtk was not installed automatically with flatpak.

You are on RHEL? Honestly we should just ask the package maintainer to add a dependency for that.

EDIT: I poked the maintainer about it, awaiting his response.

@hubslave
Copy link
Author

On Centos 7.4 but it should be the same.

@gnome-mpv gnome-mpv changed the title Playback was terminated abnormally. Reason: Loading failed. dnd does not work when using flatpak Jan 29, 2018
@TingPing
Copy link
Contributor

TingPing commented Dec 12, 2019

xdg-desktop-portal just gained a file-transfer portal and GTK4 will be using this for DnD support; No-eta on GTK3 support.

@gigglylo
Copy link

i added xdg-videos in flatseal, dnd works on video. but not subtitles tho

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants