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

--loop-file (and possibily other) config parameters show no effect in flatpak mpv #23

Closed
Mershl opened this issue Oct 24, 2021 · 8 comments

Comments

@Mershl
Copy link

Mershl commented Oct 24, 2021

Tested on

Flatpak 1.12.2
app/io.mpv.Mpv/x86_64/stable - 2021-10-23 06:59:31

Description

Setting loop-file=inf in mpv.conf or providing it as a command line argument does not show the expected effect on the flatpak version of mpv.

To reproduce:

  • Create an mpv.conf containing loop-file=inf OR
  • call flatpak run io.mpv.Mpv --loop-file=inf <some_file_path>

Diffing the logs of an rpm mpv and flatpak mpv using -v shows that the flatpak mpv is doing some parameter resets in the end (which is not shown for the rpm version of mpv).

Both rpm and flatpak mpv show:

[cplayer] Setting option 'loop-file' = 'inf' (flags = 8)

Only flatpak mpv afterwards shows (which I presume results in a reset of the parameters):

[cplayer] Set property: loop-file=false -> 1
[cplayer] Set property: loop-playlist=true -> 1
[cplayer] Set property: loop-file=false -> 1
[cplayer] Set property: loop-playlist=false -> 1

Noticed that on startup flatpak mpv is also loading one additional config file which I was not able to locate:

[cplayer] Reading config file /app/etc/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'screenshot-directory' = '~/Pictures/mpv-screenshots' (flags = 4)
[cplayer] Reading config file /var/home/mershl/.var/app/io.mpv.Mpv/config/mpv/mpv.conf
@Erick555
Copy link
Contributor

Erick555 commented Oct 24, 2021

Can't reproduce, flatpak run io.mpv.Mpv --loop-file=inf <some_file_path> results in playing file in a loop. and there are no:

[cplayer] Set property: loop-file=false -> 1
[cplayer] Set property: loop-playlist=true -> 1
[cplayer] Set property: loop-file=false -> 1
[cplayer] Set property: loop-playlist=false -> 1

showing in the verbose log.

Can you try with clean /var/home/mershl/.var/app/io.mpv.Mpv?

@Mershl
Copy link
Author

Mershl commented Oct 24, 2021

Weird. Just tested with a completly fresh environment (also deleted .config/mpv, just to be sure). Can still reproduce it.

Search for: loop-file. Exiting... (End of file) confirms loop-file not working as expected.

~ ❯❯❯ flatpak remove io.mpv.Mpv --delete-data


        ID                      Branch       Op
 1. [-] io.mpv.Mpv              stable       r
 2. [-] io.mpv.Mpv.Locale       stable       r

Uninstall complete.
Delete data for io.mpv.Mpv? [y/n]: y   
~ ❯❯❯ flatpak install io.mpv.Mpv
Looking for matches…

io.mpv.Mpv permissions:
    ipc       network       pulseaudio            wayland
    x11       devices       file access [1]       bus ownership [2]

    [1] /tmp, host:ro, xdg-pictures/mpv-screenshots:create, xdg-run/pipewire-0:ro
    [2] org.mpris.MediaPlayer2.mpv.*


        ID                         Branch         Op         Remote          Download
 1. [✓] io.mpv.Mpv.Locale          stable         i          flathub          1,6 kB / 47,0 kB
 2. [✓] io.mpv.Mpv                 stable         i          flathub         15,8 MB / 17,1 MB

Installation complete.
~ ❯❯❯ flatpak run io.mpv.Mpv --loop-file=inf -v '/var/home/mershl/Videos/Clips/b54286bc38827711.mp4'
[cplayer] Command line options: '--loop-file=inf' '-v' '/var/home/mershl/Videos/Clips/b54286bc38827711.mp4'
[cplayer] mpv 0.33.1 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
[cplayer]  built on UNKNOWN
[cplayer] FFmpeg library versions:
[cplayer]    libavutil       56.70.100
[cplayer]    libavcodec      58.134.100
[cplayer]    libavformat     58.76.100
[cplayer]    libswscale      5.9.100
[cplayer]    libavfilter     7.110.100
[cplayer]    libswresample   3.9.100
[cplayer] FFmpeg version: 4.4
[cplayer] 
[cplayer] Configuration: waf configure --prefix=/app --enable-libmpv-shared --disable-build-date --disable-manpage-build --disable-alsa --enable-sdl2 --enable-libarchive --enable-dvbin --enable-cdda --enable-dvdnav
[cplayer] List of enabled features: asm cdda cplayer cplugins cuda-hwaccel cuda-interop debug-build drm dvbin dvdnav egl egl-drm egl-helpers egl-x11 ffmpeg ffnvcodec gbm gbm.h gl gl-wayland glibc-thread-name glob glob-posix gpl iconv jack jpeg lcms2 libarchive libass libavdevice libbluray libdl libm libmpv-shared librt linux-fstatfs linux-input-event-codes lua luajit memfd_create optimize plain-gl posix posix-or-mingw pthreads pulse rubberband sdl2 sdl2-audio sdl2-gamepad sdl2-video sixel stdatomic uchardet vaapi vaapi-drm vaapi-egl vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vt.h wayland wayland-protocols x11 xv zimg zlib
[cplayer] Reading config file /app/etc/mpv/encoding-profiles.conf
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /app/etc/mpv/mpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'screenshot-directory' = '~/Pictures/mpv-screenshots' (flags = 4)
[cplayer] Setting option 'loop-file' = 'inf' (flags = 8)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Waiting for scripts...
[osd/libass] Shaper: FriBidi 1.0.9 (SIMPLE) HarfBuzz-ng 3.0.0 (COMPLEX)
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] Set property: shared-script-properties -> 1
[cplayer] Done loading scripts.
[cplayer] Running hook: ytdl_hook/on_load
[ytdl_hook] ytdl:// hook 
[ytdl_hook] not a ytdl:// url 
[ifo_dvdnav] Opening /var/home/mershl/Videos/Clips/b54286bc38827711.mp4
[bdmv/bluray] Opening /var/home/mershl/Videos/Clips/b54286bc38827711.mp4
[file] Opening /var/home/mershl/Videos/Clips/b54286bc38827711.mp4
[demux] Trying demuxers for level=normal.
[cplayer] Set property: shared-script-properties -> 1
[osd/libass] Shaper: FriBidi 1.0.9 (SIMPLE) HarfBuzz-ng 3.0.0 (COMPLEX)
[osd/libass] Setting up fonts...
[lavf] Found 'mov,mp4,m4a,3gp,3g2,mj2' at score=100 size=2048.
[demux] Detected file format: mov,mp4,m4a,3gp,3g2,mj2 (libavformat)
[cplayer] Opening done: /var/home/mershl/Videos/Clips/b54286bc38827711.mp4
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[find_files] Loading external files in /var/home/mershl/Videos/Clips/
[cplayer] Running hook: ytdl_hook/on_preloaded
[lavf] select track 0
[lavf] select track 1
[cplayer]  (+) Video --vid=1 (*) (h264 640x640 30.000fps)
[cplayer]  (+) Audio --aid=1 (*) (aac 2ch 44100Hz)
[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :99.0
[vo/gpu/x11] Display 0 (DisplayPort-0): [0, 0, 3440, 1440] @ 99.981604 FPS
[vo/gpu/x11] Current display FPS: 99.981604
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0x11, visual ID 0x21
[vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 21.2.2 (git-15c8aeef1d)'
[vo/gpu/opengl] Detected desktop OpenGL 4.6.
[vo/gpu/opengl] GL_VENDOR='AMD'
[vo/gpu/opengl] GL_RENDERER='AMD Radeon RX 6800 (SIENNA_CICHLID, DRM 3.42.0, 5.14.14-300.fc35.x86_64, LLVM 12.0.1)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.60'
[vo/gpu/opengl] Loaded extension GL_NV_vdpau_interop.
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 99.981604 FPS for display sync.
[vd] Container reported FPS: 30.000000
[vd] Codec list:
[vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd]     h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd]     h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening decoder h264
[vd] No hardware decoding requested.
[vd] Using software decoding.
[vd] Detected 16 logical cores.
[vd] Requesting 16 threads for decoding.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[vf] User filter list:
[vf]   (empty)
[ad] Codec list:
[ad]     aac - AAC (Advanced Audio Coding)
[ad]     aac_fixed (aac) - AAC (Advanced Audio Coding)
[ad] Opening decoder aac
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: aac (AAC (Advanced Audio Coding))
[af] User filter list:
[af]   (empty)
[cplayer] Starting playback...
[cplayer] Set property: playlist-shuffle=false -> -3
[af] [in] 44100Hz stereo 2ch floatp
[af] [userspeed] 44100Hz stereo 2ch floatp
[af] [userspeed] (disabled)
[af] [convert] 44100Hz stereo 2ch floatp
[vd] Using software decoding.
[vd] Decoder format: 640x640 [0:1] yuv420p bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264
[vf] [in] 640x640 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] 640x640 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autorotate] 640x640 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 640x640 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [convert] (disabled)
[vf] [out] 640x640 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[ao] Trying audio driver 'pulse'
[ao/pulse] requested format: 44100 Hz, stereo channels, floatp
[ao/pulse] Library version: 15.0.0
[ao/pulse] Proto: 35
[ao/pulse] Server proto: 4294967295
[ao/pulse] Channel layouts:
[ao/pulse]  - #fl
[ao/pulse]  - #fr
[ao/pulse]  - #fc
[ao/pulse]  - #lfe
[ao/pulse]  - #bl
[ao/pulse]  - #br
[ao/pulse]  - #flc
[ao/pulse]  - #frc
[ao/pulse]  - #bc
[ao/pulse]  - #sl
[ao/pulse]  - #sr
[ao/pulse]  - #tc
[ao/pulse]  - #tfl
[ao/pulse]  - #tfc
[ao/pulse]  - #tfr
[ao/pulse]  - #tbl
[ao/pulse]  - #tbc
[ao/pulse]  - #tbr
[ao/pulse] result: stereo
[ao/pulse] device buffer: 4410 samples.
[ao/pulse] using soft-buffer of 8820 samples.
[cplayer] AO: [pulse] 44100Hz stereo 2ch float
[cplayer] AO: Description: PulseAudio audio output
[autoconvert] inserting resampler
[swresample] format change, reinitializing resampler
[swresample] 44100Hz stereo floatp -> 44100Hz stereo float
[af] [out] 44100Hz stereo 2ch float
[cplayer] VO: [gpu] 640x640 yuv420p
[cplayer] VO: Description: Shader-based GPU Renderer
[vo/gpu] reconfig to 640x640 yuv420p bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/gpu/x11] not waiting for MapNotify
[vo/gpu] Resize: 640x640
[vo/gpu] Window size: 640x640 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 640x640 (1:1)
[vo/gpu] Video display: (0, 0) 640x640 -> (0, 0) 640x640
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Texture for plane 0: 640x640
[vo/gpu] Texture for plane 1: 320x320
[vo/gpu] Texture for plane 2: 320x320
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] DR enabled: yes
[cplayer] first video frame after restart shown
[cplayer] Set property: playlist-shuffle=true -> -3
[cplayer] audio ready
[cplayer] starting audio playback
[cplayer] playback restart complete @ 0.046029, audio=playing, video=playing
[ao/pulse] starting AO
[cplayer] Set property: loop-file=false -> 1
[cplayer] Set property: loop-playlist=true -> 1
[statusline] AV: 00:00:00 / 00:00:07 (1%) A-V: -0.000
[cplayer] Set property: loop-file=false -> 1
[cplayer] Set property: loop-playlist=false -> 1
[cplayer] Set property: volume=90.000000 -> 1
[cplayer] Set property: volume=100.000000 -> 1
[vo/gpu/x11] Disabling screensaver.
[statusline] AV: 00:00:00 / 00:00:07 (1%) A-V: -0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:00 / 00:00:07 (12%) A-V:  0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:00 / 00:00:07 (12%) A-V:  0.000
[osd/libass] fontselect: (sans-serif, 400, 0) -> /usr/share/fonts/dejavu/DejaVuSans.ttf, 0, DejaVuSans
[osd/libass] fontselect: (mpv-osd-symbols, 400, 0) -> mpv-osd-symbols-Regular, 0, mpv-osd-symbols-Regular
[vo/gpu] Reallocating OSD texture to 1024x128.
[statusline] AV: 00:00:03 / 00:00:07 (42%) A-V:  0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:04 / 00:00:07 (54%) A-V:  0.000
[cplayer] Set property: shared-script-properties -> 1
[statusline] AV: 00:00:05 / 00:00:07 (77%) A-V:  0.000
[lavf] EOF reached.
[statusline] AV: 00:00:07 / 00:00:07 (95%) A-V:  0.000
[af] filter input EOF
[af] filter output EOF
[cplayer] audio filter EOF
[cplayer] audio draining
[cplayer] audio EOF reached
[statusline] AV: 00:00:07 / 00:00:07 (98%) A-V:  0.000
[ao/pulse] audio end or underrun
[statusline] AV: 00:00:07 / 00:00:07 (98%) A-V:  0.000
[vf] filter input EOF
[vf] filter output EOF
[statusline] AV: 00:00:07 / 00:00:07 (99%) A-V:  0.000
[cplayer] EOF code: 1  
[vo/gpu/x11] Enabling screensaver.
[cplayer] finished playback, success (reason 0)
[cplayer] 
[cplayer] Exiting... (End of file)
[cplayer] Set property: shared-script-properties -> 1
[cplayer] draining left over audio
[ao/pulse] audio end or underrun

@Mershl
Copy link
Author

Mershl commented Oct 24, 2021

Interesting. Found the culprit. The issue is reproduciable while the permission org.mpris.MediaPlayer2.mpv.* is set (default for io.mpv.Mpv), and the extension https://extensions.gnome.org/extension/1379/mpris-indicator-button/ is installed.

Unsetting the permission org.mpris.MediaPlayer2.mpv.* or disabling mpris-indicator-button immediatly fixes the issue.

@Erick555
Copy link
Contributor

Is it bug in this extension then?

@Mershl
Copy link
Author

Mershl commented Oct 25, 2021

As rpm mpv is not showing the same issue it's difficult to say whether it's an issue of the extension or flatpak mpv without a deep dive into the code.

Just noticed: the rpm mpv does not provide a mpris connection by default, right? Maybe it's an issue between https://github.com/hoyon/mpv-mpris and https://extensions.gnome.org/extension/1379/mpris-indicator-button/ ?

@Mershl
Copy link
Author

Mershl commented Nov 2, 2021

Created hoyon/mpv-mpris#55

@Mershl Mershl closed this as completed Nov 2, 2021
@Mershl
Copy link
Author

Mershl commented Nov 2, 2021

Feedback by mpv-mpris dev @hoyon:
"It looks like the flathub package is still using version 0.5 of mpv-mpris. Can you try upgrading it to 0.6 and seeing if the problem persists? A few issues with looping were fixed in that version."

@Mershl
Copy link
Author

Mershl commented Nov 6, 2021

Can confirm. mpv-mpris 0.6 fixed this issue. Thanks @fastrizwaan and @hoyon.

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

No branches or pull requests

2 participants