sakithb / media-controls

A media indicator for the Gnome shell.
MIT License
221 stars 33 forks source link

Gnome shell freezes when video cannot be played back #118

Closed p-fruck closed 5 months ago

p-fruck commented 6 months ago

I noticed this extension causes gnome to freeze if the video player is in an unsupported state.

I have the totem video player (gnome videos) left on my system and accidentally opened a video that could not be played back by totem (e.g. totem entered some kind of dead state). The following error has been logged:

JS ERROR: TypeError: this._metadata is undefined
_playerPropsChanged@file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/player.js:340:21
@resource:///org/gnome/shell/ui/init.js:21:20

I solved this problem by using another video player (don't know why totem was there in the first place) but even if it is due to the video players state, this should not cause the whole desktop to freeze.

p-fruck commented 6 months ago

Not sure how it happened but I provoked another error where a running video started playing from the beginning again and gnome shell froze again. I can only find the following errors in the log but they happened an hour before the system froze, so I don't know if they are any relevant:

#1   55b998695898 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:576 (1a9bf3caf970 @ 84)
                                           #2   55b998695808 i   resource:///org/gnome/shell/ui/init.js:21 (263b07c70ba0 @ 48)
Dez 26 22:29:07 spectre gnome-shell[2290]: Object .Gjs_ui_popupMenu_PopupBaseMenuItem (0x55b99ca80480), has been already disposed — impossible to access it. This might be caused by the object having been destroyed from C code using somet>
                                           == Stack trace for context 0x55b9985ca6e0 ==
                                           #0   55b998695928 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:457 (1a9bf3caf7e0 @ 60)
                                           #1   55b998695898 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:576 (1a9bf3caf970 @ 84)
                                           #2   55b998695808 i   resource:///org/gnome/shell/ui/init.js:21 (263b07c70ba0 @ 48)
Dez 26 22:29:07 spectre gnome-shell[2290]: clutter_actor_remove_child: assertion 'child->priv->parent != NULL' failed
Dez 26 22:29:07 spectre gnome-shell[2290]: Object .Gjs_mediacontrols_cliffniff_github_com_player_Player (0x55b9992724c0), has been already disposed — impossible to access it. This might be caused by the object having been destroyed from >
                                           == Stack trace for context 0x55b9985ca6e0 ==
                                           #0   55b9986959c0 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/player.js:994 (1a9bf3cb2d80 @ 269)
                                           #1   55b998695928 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:461 (1a9bf3caf7e0 @ 115)
                                           #2   55b998695898 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:576 (1a9bf3caf970 @ 84)
                                           #3   55b998695808 i   resource:///org/gnome/shell/ui/init.js:21 (263b07c70ba0 @ 48)
Dez 26 22:29:07 spectre gnome-shell[2290]: Object .Gjs_mediacontrols_cliffniff_github_com_widget_MediaControls (0x55b99cd818d0), has been already disposed — impossible to access it. This might be caused by the object having been destroye>
                                           == Stack trace for context 0x55b9985ca6e0 ==
                                           #0   7ffc07b4ed60 b   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:381 (1a9bf3caf560 @ 1081)
                                           #1   55b998695940 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:523 (1a9bf3caf830 @ 885)
                                           #2   55b998695898 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:580 (1a9bf3caf970 @ 110)
                                           #3   55b998695808 i   resource:///org/gnome/shell/ui/init.js:21 (263b07c70ba0 @ 48)
Dez 26 22:29:07 spectre gnome-shell[2290]: Window manager warning: Trying to remove non-existent keybinding "mediacontrols-toggle-trackinfomenu".
Dez 26 22:29:07 spectre gnome-shell[2290]: Object St.Bin (0x55b998ee7a10), has been already disposed — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispo>
                                           == Stack trace for context 0x55b9985ca6e0 ==
                                           #0   7ffc07b4ed60 b   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:384 (1a9bf3caf560 @ 1106)
                                           #1   55b998695940 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:523 (1a9bf3caf830 @ 885)
                                           #2   55b998695898 i   file:///var/home/philipp/.local/share/gnome-shell/extensions/mediacontrols@cliffniff.github.com/widget.js:580 (1a9bf3caf970 @ 110)
                                           #3   55b998695808 i   resource:///org/gnome/shell/ui/init.js:21 (263b07c70ba0 @ 48)

Would it be possible to add some kind of global try-catch such that a crash of the extension does not cause the whole desktop environment to freeze?

EKolyshkin commented 6 months ago

Seconded; I've narrowed it down to this extension as well. When playing local media files (audio or video) with any program, GNOME shell (45.2) freezes until playback is finished. Disabling the extension fixes the issue.

sakithb commented 6 months ago

A new version is being worked on where the extension is being rewritten. You can check out the latest prerelease to see if the issue still exists.