Works great, but causes a "critical" error to be output
StopIteration opened this issue · comments
This seems to be more of a mild annoyance than anything, but when mpv starts up I now get this error message:
GLib-GIO-CRITICAL **: 21:03:15.407: g_dbus_connection_emit_signal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
It still works fine, and I'm kinda used to random glib spam now and then, but if possible it would still be nice to get rid of, if only to de-clutter the mpv cli.
What version of mpv are you using? I'm using the latest mpv (0.28.2) and can't reproduce the issue.
Does it only happen on startup, or whenever g_dbus_connection_emit_signal
is called, namely when the file changes or the track is seeked.
I'm using 0.28.2 as well.
It happens only at startup (after the "Playing:" message appears), and in re-reproducing it myself, I've realized that it is also a very intermittent issue. It seemed yesterday that it happened every time, but now that I'm trying to reproduce it, I've only gotten it to happen like twice (out of maybe 30+ attempts). I'll let you know if I figure out how to consistently reproduce it, although it might just be that I notice it when it happens and it is actually quite rare.
I had a few glib messages at one point, when I realized I had the mpris.so file in ~/.config/mpv/scripts AND ~/.mpv/scripts, causing it to be loaded twice. Maybe that's your issue too?
I've been getting these warnings for at least a week or something (they went away for a bit, I think, after I started building this repo from its newest commit, but they've since returned. Its kind of annoying for cluttering up my terminal windows, but outside of that there is no noticeable effect I think. Here is the output I'm getting (its not entirely consistent, but it's there in some form 95% of the time):
$ mpv --no-audio --no-video --no-resume-playback vid.mkv
(process:425681): GLib-CRITICAL **: 22:14:20.472: g_variant_new_object_path: assertion 'g_variant_is_object_path(object_path)' failed
(process:425681): GLib-CRITICAL **: 22:14:20.474: g_variant_dict_insert_value: assertion 'value != NULL' failed
Video --vid=1 (*) (h264 1920x1040 23.976fps)
...
No video or audio streams selected.
Exiting... (Errors when loading file)
(process:425681): GLib-CRITICAL **: 22:14:20.492: g_variant_new_object_path: assertion 'g_variant_is_object_path(object_path)' failed
(process:425681): GLib-CRITICAL **: 22:14:20.492: g_variant_dict_insert_value: assertion 'value != NULL' failed
Version info
# build from source today
$ mpv --version
mpv 0.32.0-352-g530a0863b8 Copyright © 2000-2020 mpv/MPlayer/mplayer2 projects
built on Sat Apr 11 20:27:18 CEST 2020
FFmpeg library versions:
libavutil 56.42.102
libavcodec 58.77.101
libavformat 58.42.100
libswscale 5.6.101
libavfilter 7.77.101
libswresample 3.6.100
FFmpeg version: N-97186-gda44bbefaa
$ uname -mor
5.6.3-arch1-1 x86_64 GNU/Linux
Hmm that g_variant_new_object_path
error is very strange. I've pushed up a new branch https://github.com/hoyon/mpv-mpris/tree/issue-11 which adds a debug log. Can you show what it outputs when you get that error?
This is a typical output:
$ mpv --no-audio --no-video vid.mkv
An object is already exported for the interface org.mpris.MediaPlayer2 at /org/mpris/MediaPlayer2
(process:8173): GLib-GIO-CRITICAL **: 18:37:52.666: g_dbus_connection_register_object: assertion 'error == NULL || *error == NULL' failed
An object is already exported for the interface org.mpris.MediaPlayer2 at /org/mpris/MediaPlayer2
(process:8173): GLib-CRITICAL **: 18:37:52.675: g_variant_new_object_path: assertion 'g_variant_is_object_path (object_path)' failed
(process:8173): GLib-CRITICAL **: 18:37:52.675: g_variant_dict_insert_value: assertion 'value != NULL' failed
Resuming playback. This behavior can be disabled with --no-resume-playback.
/0
/0
Video --vid=1 (*) (h264 1920x1040 23.976fps)
...
No video or audio streams selected.
Exiting... (Errors when loading file)
(process:8173): GLib-CRITICAL **: 18:37:52.688: g_variant_new_object_path: assertion 'g_variant_is_object_path (object_path)' failed
(process:8173): GLib-CRITICAL **: 18:37:52.688: g_variant_dict_insert_value: assertion 'value != NULL' failed
/-1
(process:8173): GLib-CRITICAL **: 18:37:52.689: g_variant_new_object_path: assertion 'g_variant_is_object_path (object_path)' failed
(process:8173): GLib-CRITICAL **: 18:37:52.689: g_variant_dict_insert_value: assertion 'value != NULL' failed
$
Thanks! So there are two errors you've got in that output:
An object is already exported ...
: You probably have mpv-mpris installed twice, which is what is causing the second attempt to load to fail. Can you check your ~/.config/mpv/scripts
and /etc/mpv/scripts
directories to ensure you only have one copy.
g_variant_new_object_path ...
: This was due to a special case where mpv returned -1 for playlist-pos
which I wasn't aware of. I've handled this now in 81e3de9 which should fix that.
Perfect, works great! Thank you so much for the fix.
Great! I'll close this for now then. If there is any more extraneous error logging feel free to create a new issue.
An object is already exported ...: You probably have mpv-mpris installed twice, which is what is causing the second attempt to load to fail. Can you check your ~/.config/mpv/scripts and /etc/mpv/scripts directories to ensure you only have one copy.
FYI, such a script could also be located in ~/.mpv. In fact, this was the only place in one's HOME directory to put scripts and configs for a while, IIRC. (I just though I'd mention it in case someone finds this on a search engine - such as Google - and still can't figure out why they're getting such errors.)
Another FYI:
I use the mpv-mpris AUR package and didn't realise it had changed from having the file in the user config to loading it by default from /etc: https://aur.archlinux.org/cgit/aur.git/commit/?h=mpv-mpris&id=da5d1f8f6e725bbd7f0bca897310bc1d5e93f8a4
Removed the script from my user config file and now the errors are gone.
I have this issue and this script doesn't seem to be working.
mpv --config=no Videos/IMG_1456.mp4 --script=/etc/mpv/scripts/mpris.so
(+) Video --vid=1 (*) (h264 640x360 30.000fps)
(+) Audio --aid=1 (*) (aac 1ch 44100Hz)
(process:48): GLib-GIO-CRITICAL **: 02:51:23.989: g_dbus_connection_emit_signal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
AO: [pulse] 44100Hz mono 1ch float
VO: [gpu] 640x360 yuv420p
AV: 00:00:02 / 00:00:02 (95%) A-V: 0.000
Exiting... (End of file)
(process:48): GLib-GIO-CRITICAL **: 02:51:26.576: g_dbus_connection_emit_signal: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(process:48): GLib-GIO-CRITICAL **: 02:51:26.576: g_dbus_connection_unregister_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
(process:48): GLib-GIO-CRITICAL **: 02:51:26.576: g_dbus_connection_unregister_object: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
Removed the script from my user config file and now the errors are gone.
@ammgws What do you mean?
I do not have ~/.config/mpv/scripts folder
ls /usr/lib/mpv/mpris.so
"/usr/lib/mpv/mpris.so": No such file or directory (os error 2)
ls /etc/mpv/scripts/mpris.so
/etc/mpv/scripts/mpris.so