Flatpak Mpv broken since 20240306 snapshot

Since yesterday after updating my system ( zypper dup ) and rebooted the flatpak version of Mpv is completely broken, every time I try to open a file could be video or audio the application become stalled and I can only close it by killing the processes.
The gui work fine as long as I don’t open a file, if I open a file directly either from the terminal or the file manager the program get stuck even before the gui show up.

So far I’ve tried to run a flatpak update and reboot, did a flatpak repair, removed and reinstalled mpv, removed my config files … nothing worked …

The native version of Mpv installed with zypper work fine ( with packman codecs installed ) even with the same config files as the flatpak version, all other flatpak applications I’m using are fine too so it is just the flatpak version of Mpv that is broken.

No errors show up when running it from the terminal and looking at the process it seems that in the background the app is doing it’s job, videos are buffering, downloaded if it’s a stream … just the gui don’t show up or is broken, no sound no video, I can move the window but nothing is displayed, if I reduce the window and maximise it again the content of it become what was display last behind it and the app can only be closed by killing the process…

Looking at the systemd journal launching the app ( just the gui no files ) display :

mars 09 21:46:21 noname-opensuse kwin_x11[2093]: kwin_core: XCB error: 152 (BadDamage), sequence: 5287, resource id: 10515647, major code: 143 (DAMAGE), minor code: 3 (Subtract)
mars 09 21:46:21 noname-opensuse systemd[1740]: Started app-flatpak-io.mpv.Mpv-7907.scope.
mars 09 21:46:21 noname-opensuse systemd[1740]: Started mpv Media Player.
mars 09 21:46:21 noname-opensuse mpv[7919]: g_dbus_connection_emit_signal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed

Opening a file to produce the error don’t produce any log, closing the process through the system monitor will log :

mars 09 21:49:43 noname-opensuse plasmashell[2125]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/items/PlasmoidItem.qml:125: TypeError: Cannot read property 'compactRepresentationItem' of null
mars 09 21:49:43 noname-opensuse plasmashell[2125]: file:///usr/share/plasma/plasmoids/org.kde.plasma.private.systemtray/contents/ui/items/PlasmoidItem.qml:125: TypeError: Cannot read property 'compactRepresentationItem' of null
mars 09 21:49:44 noname-opensuse plasma-systemmonitor[6868]: qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid)
mars 09 21:49:44 noname-opensuse plasma-systemmonitor[6868]: qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid)
mars 09 21:49:44 noname-opensuse plasma-systemmonitor[6868]: qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid)
mars 09 21:49:44 noname-opensuse plasma-systemmonitor[6868]: qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid)
mars 09 21:49:44 noname-opensuse plasma-systemmonitor[6868]: qt.core.qabstractitemmodel.checkindex: Index QModelIndex(-1,-1,0x0,QObject(0x0)) is not valid (expected valid)
[ ... and so on, there's hundred lines of this ]

Also I’m running KDE on X11 with Nvidia proprietary drivers installed, thanks in advance.

A dumb question on my part, and maybe I missed something in the post

If the native version is fine, why worry about the Flatpak version ??

1 Like

The purpose of a flatpak is to remove the need to have dependencies installed in the OS, because they’re bundled in the flatpak itself.

So if an app in a flatpak isn’t running, either there’s something wrong with the flatpak packaged software itself, or there’s something wrong with flatpak itself.

You can launch a flatpak with flatpak run and the Application ID (which can be obtained using flatpak list - so, for example, I can launch OBS Studio on my system (as an app I have installed that way) using flatpak run com.obsproject.Studio - and that will give console output that tells me what’s going on in the application.

I would probably start with that.

2 Likes

On the past the native version did have some issues, video buffering was taking way more CPU than normal like 12% while vlc or the flatpak version of mpv did use 2% for the same video with the same config, also the native version of mpv cannot be launched from my web browser when opening a downloaded file from it while the flatpak version did launch fine.

Already did, it was mentioned in my initial post, but I should have be clearer and say that I run flatpak run io.mpv.Mpv video.webm which give me a normal output but no errors

flatpak run io.mpv.Mpv video.webm                                                                                                                                                                              11:14:47
 (+) Video --vid=1 (*) (vp9 1920x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)

The thing is it was working until I made a zypper dup and rebooted, in some situation it’s possible that a flatpak app will not launch after a system update, it happens to me every time I have an Nvidia update keepasXC will not launch until I perform a flatpak update that’s why the first thing I tried was to update flatpak apps with no luck.

2 Likes

Is the native mpv from repos working fine?
If so, perhaps you could reinstall the flatpak version.

sudo flatpak install --reinstall <package>

It really often helps to read at least the first post in a thread before posting stuff…

1 Like

@hui My bad :melting_face:

@Aboutduck Could you try installing it system wide, i.e., not for your user?

sudo flatpak install <pkg>
# also try reinstalling everything
sudo flatpak repair --reinstall-all
1 Like

Maybe I’m confused, I may have missed the “I installed the Flatpak only for my user acct” statement by OP.

My experience with TW, I install Flatpaks using Discover. Doing so, the default is system-wide. And to make sure I’m not imagining it, I just logged in with the my other user acct (on my laptop) and launched Brave browser (it’s a Flatpak).

Brave Flatpak was originally installed using Discover while in my main user account… of course, I was prompted for the root user password during that install.

It’s been a while, but I had MicroOS Kalpa running in VBox to check it out, and that OS is aimed at installing Flatpaks just for the user installing it.

1 Like

All of my apps are installed system wide, mpv included yes, I do not use discover only the terminal for flatpak.

sudo flatpak remove mpv                                                                                                                                                                                        
Found installed ref ‘app/io.mpv.Mpv/x86_64/stable’ (system). Is this correct? [Y/n]:

Thanks for the suggestion I’ve just tried to do a repair with --reinstall-all but same situation, mpv as flatpak is still broken nothing changed, systemd logs are still the same …

mars 10 16:19:07 noname-opensuse systemd[1740]: Started KeePassXC - Password Manager.
mars 10 16:19:07 noname-opensuse systemd[1740]: Started app-flatpak-org.keepassxc.KeePassXC-10418.scope.
mars 10 16:19:13 noname-opensuse systemd[1740]: app-flatpak-org.keepassxc.KeePassXC-10418.scope: Consumed 1.109s CPU time.
mars 10 16:19:20 noname-opensuse systemd[1740]: Started app-flatpak-io.mpv.Mpv-10454.scope.
mars 10 16:19:46 noname-opensuse plasmashell[2125]: kde.dataengine.mpris: "org.mpris.MediaPlayer2.mpv" does not implement org.freedesktop.DBus.Properties correctly Error message was "org.freedesktop.DBus.Error.NoReply" "Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked  the reply, the reply timeout expired, or the network connection was broken."
mars 10 16:19:46 noname-opensuse plasmashell[2125]: kde.dataengine.mpris: Failed to find working MPRIS2 interface for "org.mpris.MediaPlayer2.mpv"
1 Like

That is just a warning, you probably will not be able to “remotely control” the running mpv, but it should not stop it from running.

2 Likes

This is the only possible error message I have, I guess you’re right thanks for the precision.

I’ve just tried to run the app with the verbose argument ( -v ), but no luck either it only show normal logs openSUSE Paste

Ok I found something really interesting, opening images ( jpg, png … ) and videos with no audio track work so the issue only happens when playing audio …

[ao] Trying audio driver 'pipewire'
[ao/pipewire] requested format: 48000 Hz, stereo channels, floatp
[ao/pipewire] Headers version: 0.3.83
[ao/pipewire] Library version: 0.3.83
[ao/pipewire] Core user: noname
[ao/pipewire] Core host: noname-opensuse
[ao/pipewire] Core version: 1.0.3
[ao/pipewire] Core name: pipewire-0
fish: Job 1, 'flatpak run io.mpv.Mpv -v video…' terminated by signal SIGTERM (Polite quit request)

Does it work if you use different audio backend?

2 Likes

I’m sorry but I have no idea how to do that, I’m really not familiar with audio backend at all …
Also tested on another flatpak app to play a video with sound and it worked fine.

mpv --ao=pulse
2 Likes

Oh I’m stupid I should have though about it … thank you.

And … It worked ! The video play with sound and no issues at all, so now I can fix the issue by adding this in my mpv config … thank you that was a good suggestion.

For the reference I’ve tried running the same video with the native version of mpv

mpv video.webm 

 (+) Video --vid=1 (*) (vp9 1920x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
Using hardware decoding (nvdec).
AO: [pulse] 48000Hz stereo 2ch float
VO: [gpu] 1920x1080 cuda[nv12]
(Paused) AV: 00:00:02 / 00:26:38 (0%) A-V:  0.000

And it seems to use pulseaudio by default for the audio output …

1 Like

Does native version work with --ao=pipewire assuming it supports it?

1 Like

The player start and the video play but with no audio track selected, trying to click on the OSC ( mpv gui ) to select the audio track do nothing and log errors

mpv --ao=pipewire video.webm

Resuming playback. This behavior can be disabled with --no-resume-playback.
 (+) Video --vid=1 (*) (vp9 1920x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
Using hardware decoding (nvdec).
[ao] Failed to initialize audio driver 'pipewire'
Could not open/initialize audio device -> no sound.
Audio: no audio
VO: [gpu] 1920x1080 cuda[nv12]
Track switched:
 (+) Video --vid=1 (*) (vp9 1920x1080 25.000fps)
 (+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[ao] Failed to initialize audio driver 'pipewire'
Could not open/initialize audio device -> no sound.
Audio: no audio
(Paused) V: 00:00:50 / 00:26:38 (3%)

So no the native version using pipewire backend cannot play audio, but it does not stall like the flatpak version.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.