I've replicated these same issues with xorg-server from Git master (e89edec4), the merges do not seem to have impacted the issue.
I've arrived at this ticket after a long time spent debugging with mpv, matching the pattern here.
I had enjoyed absolutely flawless video playback using Xorg+intel+mpv for many years, on a dedicated machine.
Then I modernised the software (Slackware 14.0 -> Alpine Linux 3.19 on the same hardware), and gained a problem with mpv of "Delayed" frames and visible dropped frames, and a 10x increase in reported "VSync Jitter".
Obviously with overwriting the whole distro it's taken a while to isolate but I think I have the issue described here. The distro changes brings me to newer software, but also switched glibc->musl and prompted a move from Xorg "intel" to "modesetting" driver.
The possible workaround of using the older "intel" driver is no longer applicable, as support for this has been stripped from Mesa.
mpv has enough profiling tools to show that I am well within CPU budget 100% of the time. The "Delayed" frames seem to be more likely when the on-screen image is larger or full screen (even for low resolution source media)
The hardware has years of proven HD video playback, so I really don't want to change it.
$ xrandr --output HDMI-1 --mode 1920x1080 --rate 24
$ mpv --no-config --no-audio --loop -fs --video-sync=display-resample --gpu-dumb-mode=yes http://www.oc-burner.de/ftp/Videos/juddertest/juddertest_24.mp4
[...]
V: 00:00:57 / 00:01:04 (90%) DS: 1/15 Cache: 6.2s/130KB
^^
these are the frame drops
## Also tried combinations options in mpv.conf
#opengl-pbo=yes
#opengl-glfinish=yes
#opengl-waitvsync=yes
#opengl-swapinterval=1
#swapchain-depth=8
#gpu-dumb-mode=yes
#opengl-early-flush=no
## Tried these options in Xorg.conf
#Option "ShadowFB" "Off"
#Option "PageFlip" "Off"
#Option "Composite" "Disable"
$ cat /proc/cpuinfo
[...]
model name : Intel(R) Celeron(R) CPU 1037U @ 1.80GHz
$ apk list -I | grep -E '(xorg|xf86|mesa|mpv)'
libxxf86vm-1.1.5-r5 x86_64 {libxxf86vm} (MIT) [installed]
mesa-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-demos-9.0.0-r4 x86_64 {mesa-demos} (custom) [installed]
mesa-dri-gallium-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-egl-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-gbm-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-gl-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-glapi-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-gles-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-osmesa-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mesa-utils-9.0.0-r4 x86_64 {mesa-demos} (custom) [installed]
mesa-va-gallium-23.3.6-r0 x86_64 {mesa} (MIT AND SGI-B-2.0 AND BSL-1.0) [installed]
mpv-0.37.0-r0 x86_64 {mpv} (GPL-2.0-or-later) [installed]
xf86-input-libinput-1.4.0-r0 x86_64 {xf86-input-libinput} (MIT) [installed]
xf86-video-intel-2.99.917_git20221028-r6 x86_64 {xf86-video-intel} (MIT) [installed]
xf86-video-intel-doc-2.99.917_git20221028-r6 x86_64 {xf86-video-intel} (MIT) [installed]
xorg-server-21.1.11-r0 x86_64 {xorg-server} (MIT) [installed]
xorg-server-common-21.1.11-r0 x86_64 {xorg-server} (MIT) [installed]
xorgproto-2023.2-r0 x86_64 {xorgproto} (BSD-2-Clause AND MIT AND X11) [installed]
From Xorg.0.log:
(II) modeset(0): glamor X acceleration enabled on Mesa Intel(R) HD Graphics 2500 (IVB GT1)
(II) modeset(0): glamor initialized
(==) modeset(0): VariableRefresh: disabled
(==) modeset(0): AsyncFlipSecondaries: disabled
[...]
(II) modeset(0): [DRI2] Setup complete
(II) modeset(0): [DRI2] DRI driver: crocus
(II) modeset(0): [DRI2] VDPAU driver: va_gl
Also tried:
"Honestly impossible" to debug is not something that should be accepted as given. Parsing config files it has no intention of applying is a contributing factor.
strace'ing a program to see which files it accesses is a very common and rational strategy. As is isolating a minimum config and testing small segments.
I'm still unaware why it's useful to parse files specifically to not apply their content, so I can only repeat myself now. Or why the .so has relationship with conf.avail
instead of just XML config.
You are saying there's no problem here, so I can't give any other useful input or propose a patch. But I thank you for your offer to debug my font problem.
Because for some reason I have begun getting the wrong fonts in my application, so I need to debug.
So it's confusing that fontconfig is loading these files when they are not referenced from FONTCONFIG_FILE
. I must trust that they are not being applied, but I will need to verify that.
It's not limited to fc-conflist
, any fontconfig application can be strace'd to see it loading these config files.
You're seem to be emphasising the source code does this specifically so it can not apply the content of them?
It seems to add complexity but I'm not understanding the benefit. And I can suggest some problems:
You emphasised in another ticket that the config directory originates from an XML directive in fonts.conf
.
And that was my expectation as a user, so it's then confusing that fontconfig has a compiled-in first-class relationship with conf.avail
. Especially risky that the content must be parsed and valid.
FONTCONFIG_FILE
is most useful when it can be used to completely switch configuration, safely and independently.
I'm having some trouble understanding your response. It would help if you can explain, what is the functionality (to the user) from scanning these config files?
I set FONTCONFIG_FILE to override the config, but the entire contents of the system /usr/share/fontconfig/conf.avail
are processed.
I've used this for many years to have my own font config without root access or modifying installed packages, and sometimes per-application settings.
Recently I noticed the system config affecting the font settings, but I don't know when this began.
There seems to be some kind of 'modal' behaviour here depending on whether FONTCONFIG_FILE is unset, set, or does not exist -- note the flipping between /usr/share/fontconfig
and /etc/fonts
in the logs below. I haven't traced the source code to see why. The two distros I tested both seem to have duplicates of the files.
This negates much of the conf.d
-> conf.avail
symlinking, if all the files are being read?
If FONTCONFIG_FILE
still reads the system config then I imagine this may interfere with the test cases in the source code?
The logs below are from Alpine Linux, but I tested fc-conflist
on:
$ FONTCONFIG_FILE=$HOME/.fonts.conf fc-conflist
+ /home/mark/.fonts.conf: No description
- /usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf: Re-define fonts dirs sample
- /usr/share/fontconfig/conf.avail/09-autohint-if-no-hinting.conf: Enable autohinter if font doesn't have any hinting
- /usr/share/fontconfig/conf.avail/10-autohint.conf: Enable autohinter
- /usr/share/fontconfig/conf.avail/10-hinting-full.conf: Set hintfull to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-medium.conf: Set hintmedium to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-none.conf: Set hintnone to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-slight.conf: Set hintslight to hintstyle
- /usr/share/fontconfig/conf.avail/10-no-antialias.conf: Disable antialiasing
- /usr/share/fontconfig/conf.avail/10-scale-bitmap-fonts.conf: Bitmap scaling
[...]
- /usr/share/fontconfig/conf.avail/90-synthetic.conf: No description
$ FONTCONFIG_FILE=$HOME/does-not-exist fc-conflist
Fontconfig error: Cannot load default config file: No such file: (null)
+ /etc/fonts/conf.d/10-hinting-slight.conf: Set hintslight to hintstyle
+ /etc/fonts/conf.d/10-scale-bitmap-fonts.conf: Bitmap scaling
+ /etc/fonts/conf.d/10-sub-pixel-none.conf: Disable sub-pixel rendering
+ /etc/fonts/conf.d/10-yes-antialias.conf: Enable antialiasing
+ /etc/fonts/conf.d/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
+ /etc/fonts/conf.d/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
+ /etc/fonts/conf.d/30-liberation-mono.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans.conf: No description
+ /etc/fonts/conf.d/30-liberation-serif.conf: No description
[...]
+ /etc/fonts/conf.d/90-tt-dejavu.conf: No description
+ memory: No description
$ export -n FONTCONFIG_FILE
$ fc-conflist
+ /etc/fonts/conf.d/10-hinting-slight.conf: Set hintslight to hintstyle
+ /etc/fonts/conf.d/10-scale-bitmap-fonts.conf: Bitmap scaling
+ /etc/fonts/conf.d/10-sub-pixel-none.conf: Disable sub-pixel rendering
+ /etc/fonts/conf.d/10-yes-antialias.conf: Enable antialiasing
+ /etc/fonts/conf.d/11-lcdfilter-default.conf: Use lcddefault as default for LCD filter
+ /etc/fonts/conf.d/20-unhint-small-vera.conf: Disable hinting for Bitstream Vera fonts when the size is less than 8ppem
+ /etc/fonts/conf.d/30-liberation-mono.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/30-liberation-sans.conf: No description
+ /etc/fonts/conf.d/30-liberation-serif.conf: No description
+ /etc/fonts/conf.d/30-metric-aliases.conf: Set substitutions for similar/metric-compatible families
+ /etc/fonts/conf.d/40-nonlatin.conf: Set substitutions for non-Latin fonts
+ /etc/fonts/conf.d/42-luxi-mono.conf: No description
+ /etc/fonts/conf.d/45-dejavu.conf: No description
+ /etc/fonts/conf.d/45-generic.conf: Set substitutions for emoji/math fonts
+ /etc/fonts/conf.d/45-latin.conf: Set substitutions for Latin fonts
+ /etc/fonts/conf.d/45-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/45-liberation.conf: No description
+ /etc/fonts/conf.d/48-spacing.conf: Add mono to the family when spacing is 100
+ /etc/fonts/conf.d/49-sansserif.conf: Add sans-serif to the family when no generic name
+ /home/mark/.fonts.conf: No description
+ /etc/fonts/conf.d/50-user.conf: Load per-user customization files
+ /etc/fonts/conf.d/51-local.conf: Load local customization file
+ /etc/fonts/conf.d/60-generic.conf: Set preferable fonts for emoji/math fonts
+ /etc/fonts/conf.d/60-latin.conf: Set preferable fonts for Latin
+ /etc/fonts/conf.d/65-fonts-persian.conf: No description
+ /etc/fonts/conf.d/65-nonlatin.conf: Set preferable fonts for non-Latin
+ /etc/fonts/conf.d/69-unifont.conf: No description
+ /etc/fonts/conf.d/80-delicious.conf: No description
+ /etc/fonts/conf.d/90-liberation-sans-narrow.conf: No description
+ /etc/fonts/conf.d/90-liberation.conf: No description
+ /etc/fonts/conf.d/90-synthetic.conf: No description
+ /etc/fonts/conf.d/90-tt-dejavu.conf: No description
+ /etc/fonts/fonts.conf: Default configuration file
- /usr/share/fontconfig/conf.avail/05-reset-dirs-sample.conf: Re-define fonts dirs sample
- /usr/share/fontconfig/conf.avail/09-autohint-if-no-hinting.conf: Enable autohinter if font doesn't have any hinting
- /usr/share/fontconfig/conf.avail/10-autohint.conf: Enable autohinter
- /usr/share/fontconfig/conf.avail/10-hinting-full.conf: Set hintfull to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-medium.conf: Set hintmedium to hintstyle
- /usr/share/fontconfig/conf.avail/10-hinting-none.conf: Set hintnone to hintstyle
- /usr/share/fontconfig/conf.avail/10-no-antialias.conf: Disable antialiasing
- /usr/share/fontconfig/conf.avail/10-sub-pixel-bgr.conf: Enable sub-pixel rendering with the BGR stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-rgb.conf: Enable sub-pixel rendering with the RGB stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-vbgr.conf: Enable sub-pixel rendering with the vertical BGR stripes layout
- /usr/share/fontconfig/conf.avail/10-sub-pixel-vrgb.conf: Enable sub-pixel rendering with the vertical RGB stripes layout
- /usr/share/fontconfig/conf.avail/10-unhinted.conf: Disable hinting
- /usr/share/fontconfig/conf.avail/11-lcdfilter-legacy.conf: Use lcdlegacy as default for LCD filter
- /usr/share/fontconfig/conf.avail/11-lcdfilter-light.conf: Use lcdlight as default for LCD filter
- /usr/share/fontconfig/conf.avail/25-unhint-nonlatin.conf: Disable hinting for CJK fonts
- /usr/share/fontconfig/conf.avail/35-lang-normalize.conf: No description
- /usr/share/fontconfig/conf.avail/65-khmer.conf: No description
- /usr/share/fontconfig/conf.avail/70-no-bitmaps.conf: Reject bitmap fonts
- /usr/share/fontconfig/conf.avail/70-yes-bitmaps.conf: Accept bitmap fonts
If some earlier step in proxy setup fails, it crashes later when trying to print some log message; you're saying this is the intended design?
Some environmental factor causes a crash within libgstsoup.so
My test case is the first tutorial: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/blob/3809b9dca445490764b571c98a0a1f558f172f47/subprojects/gst-docs/examples/tutorials/basic-tutorial-1.c
If there is an error with some environment or setup, it should probably be reported and exit cleanly, not crash.
The tutorial should probably work without a dependency on 'org.gnome.system.proxy' as no proxy is in use.
SIGTRAP: Trace/breakpoint trap
$ printenv | grep -i proxy
[nothing]
cc -pthread -I/usr/include/gstreamer-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -Wall -g -c -o hellow.o hellow.c
cc hellow.o -lgstreamer-1.0 -lgobject-2.0 -lglib-2.0 -o hellow
env GST_DEBUG='*:WARN' ./hellow
Always
$ gdb --args env GST_DEBUG='*:WARN' ./hellow
[...]
(hellow:12913): GLib-GIO-ERROR **: 15:23:48.517: Settings schema 'org.gnome.system.proxy' is not installed
Thread 2 "source:src" received signal SIGTRAP, Trace/breakpoint trap.
[Switching to Thread 0x7ffff4179640 (LWP 12914)]
0x00007ffff7d2540f in g_log_structured_array () from /usr/lib64/libglib-2.0.so.0
(gdb) bt
#0 0x00007ffff7d2540f in g_log_structured_array () at /usr/lib64/libglib-2.0.so.0
#1 0x00007ffff7d25805 in g_log_default_handler () at /usr/lib64/libglib-2.0.so.0
#2 0x00007ffff7d259f5 in g_logv () at /usr/lib64/libglib-2.0.so.0
#3 0x00007ffff7d25cc2 in g_log () at /usr/lib64/libglib-2.0.so.0
#4 0x00007ffff68e115e in () at /usr/lib64/libgio-2.0.so.0
#5 0x00007ffff7e181a6 in () at /usr/lib64/libgobject-2.0.so.0
#6 0x00007ffff7e18594 in () at /usr/lib64/libgobject-2.0.so.0
#7 0x00007ffff7e19c60 in g_object_new_valist () at /usr/lib64/libgobject-2.0.so.0
#8 0x00007ffff7e1a17c in g_object_new () at /usr/lib64/libgobject-2.0.so.0
#9 0x00007ffff6a90da7 in () at /usr/lib64/gio/modules/libgiognomeproxy.so
#10 0x00007ffff7e30d0a in g_type_create_instance () at /usr/lib64/libgobject-2.0.so.0
#11 0x00007ffff7e184cd in () at /usr/lib64/libgobject-2.0.so.0
#12 0x00007ffff7e1986d in g_object_new_with_properties () at /usr/lib64/libgobject-2.0.so.0
#13 0x00007ffff7e1a191 in g_object_new () at /usr/lib64/libgobject-2.0.so.0
#14 0x00007ffff686f66c in () at /usr/lib64/libgio-2.0.so.0
#15 0x00007ffff686fc66 in () at /usr/lib64/libgio-2.0.so.0
#16 0x00007ffff68868d2 in g_proxy_resolver_get_default () at /usr/lib64/libgio-2.0.so.0
#17 0x00007ffff6a1bb35 in ensure_socket_props () at /usr/lib64/libsoup-2.4.so.1
#18 0x00007ffff6a1f46d in soup_session_process_queue_item.part () at /usr/lib64/libsoup-2.4.so.1
#19 0x00007ffff6a20622 in soup_session_send () at /usr/lib64/libsoup-2.4.so.1
#20 0x00007ffff7fbc668 in () at /usr/lib64/gstreamer-1.0/libgstsoup.so
#21 0x00007ffff7fbd9df in () at /usr/lib64/gstreamer-1.0/libgstsoup.so
#22 0x00007ffff6b5b60d in () at /usr/lib64/libgstbase-1.0.so.0
#23 0x00007ffff6b5d8a5 in () at /usr/lib64/libgstbase-1.0.so.0
#24 0x00007ffff7f1506f in () at /usr/lib64/libgstreamer-1.0.so.0
#25 0x00007ffff7d47cb4 in () at /usr/lib64/libglib-2.0.so.0
#26 0x00007ffff7d473fd in () at /usr/lib64/libglib-2.0.so.0
#27 0x00007ffff78c5e45 in start_thread () at /lib64/libpthread.so.0
#28 0x00007ffff7bf444f in clone () at /lib64/libc.so.6
I'm the person who raised this originally on IRC. The patch catches some error cases but not all.
It looks to me like gst_parse_launch() may also fail and errors are reported differently.
My test case is a Slackware system which (presumably) doesn't have playbin installed.
$ gdb --args env GST_DEBUG='*:WARN' ./hellow
[...]
0:00:00.002031586 3264 0x45af00 WARN GST_ELEMENT_FACTORY gstelementfactory.c:467:gst_element_factory_make: no such element factory "playbin"!
0:00:00.002049492 3264 0x45af00 ERROR GST_PIPELINE gst/parse/grammar.y:857:priv_gst_parse_yyparse: no element "playbin"
(hellow:3264): GStreamer-CRITICAL **: 15:05:51.655: gst_element_set_state: assertion 'GST_IS_ELEMENT (element)' failed
(hellow:3264): GStreamer-CRITICAL **: 15:05:51.656: gst_element_get_bus: assertion 'GST_IS_ELEMENT (element)' failed
(hellow:3264): GStreamer-CRITICAL **: 15:05:51.656: gst_bus_timed_pop_filtered: assertion 'GST_IS_BUS (bus)' failed
Program received signal SIGSEGV, Segmentation fault.
0x0000000000401276 in main (argc=1, argv=0x7fffffffe898) at hellow.c:33
33 if (GST_MESSAGE_TYPE (msg) == GST_MESSAGE_ERROR) {
(gdb) bt
#0 0x0000000000401276 in main (argc=1, argv=0x7fffffffe898) at hellow.c:33
(gdb) print msg
$1 = 0x0