libplacebo icon indicating copy to clipboard operation
libplacebo copied to clipboard

Valgrind reports uninitialized bytes originating in src/cache.h

Open dancingmirrors opened this issue 1 month ago • 7 comments

==1275795== Syscall param write(buf) points to uninitialised byte(s) ==1275795== at 0x89549EE: __syscall_cancel_arch (syscall_cancel.S:56) ==1275795== by 0x8949667: __internal_syscall_cancel (cancellation.c:49) ==1275795== by 0x89496AC: __syscall_cancel (cancellation.c:75) ==1275795== by 0x89BE935: write (write.c:26) ==1275795== by 0x89455F4: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1182) ==1275795== by 0x89438D1: new_do_write (fileops.c:450) ==1275795== by 0x89457F8: _IO_new_file_xsputn (fileops.c:1256) ==1275795== by 0x89457F8: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1198) ==1275795== by 0x893937B: fwrite (iofwrite.c:39) ==1275795== by 0xB066F9: cache_save_obj (video/out/vo_default.c:1649) ==1275795== by 0x83C4A9D: pl_cache_try_set (cache.c:189) ==1275795== by 0x83C4A9D: pl_cache_try_set (cache.c:173) ==1275795== by 0x83C4AF8: pl_cache_set (cache.c:195) ==1275795== by 0x83AF6B0: sh_lut (lut.c:600) ==1275795== Address 0x3e01a066 is 38 bytes inside a block of size 2,097,184 alloc'd

This is how I fixed it but I dunno if it's correct:

--- a/src/cache.h
+++ b/src/cache.h
@@ -48,11 +48,14 @@ static inline void pl_cache_obj_resize(void *alloc, pl_cache_obj *obj, size_t si
     if (obj->free != pl_free) {
         if (obj->free)
             obj->free(obj->data);
-        obj->data = pl_alloc(alloc, size);
+        obj->data = pl_zalloc(alloc, size);
         obj->free = pl_free;
     } else if (pl_get_size(obj->data) < size) {
+        size_t old_size = pl_get_size(obj->data);
         obj->data = pl_steal(alloc, obj->data);
         obj->data = pl_realloc(alloc, obj->data, size);
+        // Zero-initialize the newly allocated portion
+        memset((char *)obj->data + old_size, 0, size - old_size);
     }
     obj->size = size;
 }

dancingmirrors avatar Dec 08 '25 10:12 dancingmirrors

Can you extend the backtrace somehow? I need to know what's below the sh_lut() call.

haasn avatar Dec 08 '25 10:12 haasn

Does this help? It's all I can get.

[vo/default/libplacebo] Spent 3721.699 ms generating ICC 3DLUT (slow!)
[vo/default/libplacebo] Spent 3760.703 ms generating shader LUT (slow!)
==1281658== Thread 7 vo:
==1281658== Syscall param write(buf) points to uninitialised byte(s)
==1281658==    at 0x89549EE: __syscall_cancel_arch (syscall_cancel.S:56)
==1281658==    by 0x8949667: __internal_syscall_cancel (cancellation.c:49)
==1281658==    by 0x89496AC: __syscall_cancel (cancellation.c:75)
==1281658==    by 0x89BE935: write (write.c:26)
==1281658==    by 0x89455F4: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1182)
==1281658==    by 0x89438D1: new_do_write (fileops.c:450)
==1281658==    by 0x89457F8: _IO_new_file_xsputn (fileops.c:1256)
==1281658==    by 0x89457F8: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1198)
==1281658==    by 0x893937B: fwrite (iofwrite.c:39)
==1281658==    by 0xB16759: cache_save_obj (video/out/vo_default.c:1649)
==1281658==    by 0x83C4A9D: pl_cache_try_set (cache.c:189)
==1281658==    by 0x83C4A9D: pl_cache_try_set (cache.c:173)
==1281658==    by 0x83C4AF8: pl_cache_set (cache.c:195)
==1281658==    by 0x83AF6B0: sh_lut (lut.c:600)
==1281658==  Address 0x3e01a066 is 38 bytes inside a block of size 2,097,184 alloc'd
==1281658==    at 0x4844818: malloc (vg_replace_malloc.c:446)
==1281658==    by 0x83E4872: pl_alloc (pl_alloc.c:123)
==1281658==    by 0x83AF3DB: pl_cache_obj_resize (cache.h:51)
==1281658==    by 0x83AF3DB: sh_lut (lut.c:483)
==1281658==    by 0x83ADB65: pl_icc_encode (icc.c:766)
==1281658==    by 0x838BF10: pass_convert_colors (renderer.c:2252)
==1281658==    by 0x8394123: pl_render_image (renderer.c:3497)
==1281658==    by 0x839540F: pl_render_image_mix (renderer.c:4034)
==1281658==    by 0xB0C938: draw_frame (video/out/vo_default.c:1112)
==1281658==    by 0xAFC66E: render_frame (video/out/vo.c:918)
==1281658==    by 0xAF846E: vo_thread (video/out/vo.c:1050)
==1281658==    by 0x894CB7A: start_thread (pthread_create.c:448)
==1281658==    by 0x89CA5EF: clone (clone.S:100)

My vo_gpu_next.c is a little different: https://raw.githubusercontent.com/dancingmirrors/dmpv/refs/heads/master/video/out/vo_default.c

dancingmirrors avatar Dec 08 '25 11:12 dancingmirrors

Yes, that helps. Seems like the issue is that it thinks the bytes written by cmsDoTransform are uninitialized. To make sure; does this help?

diff --git a/src/shaders/icc.c b/src/shaders/icc.c
index d2a31c95..fcce37ce 100644
--- a/src/shaders/icc.c
+++ b/src/shaders/icc.c
@@ -653,6 +653,7 @@ static void fill_lut(void *datap, const struct sh_lut_params *params, bool decod
 
             size_t offset = (b * s_g + g) * s_r * 4;
             uint16_t *data = ((uint16_t *) datap) + offset;
+            memset(data, 0, s_r * 4 * sizeof(data[0]));
             cmsDoTransform(tf, tmp, data, s_r);
 
             if (!icc->params.force_bpc)

haasn avatar Dec 08 '25 12:12 haasn

Perfect, that also fixes it.

dancingmirrors avatar Dec 08 '25 13:12 dancingmirrors

What LUT size is being used for the ICC LUT here? It's strange that it complains about byte offset 38; which would correspond to the fifth A value in RGBA RGBA RGBA RGBA RGB(A)... where each component is 2 bytes.

haasn avatar Dec 09 '25 13:12 haasn

diff --git a/src/shaders/icc.c b/src/shaders/icc.c
index d2a31c95..27d2752c 100644
--- a/src/shaders/icc.c
+++ b/src/shaders/icc.c
@@ -630,7 +630,7 @@ static void fill_lut(void *datap, const struct sh_lut_params *params, bool decod
     int s_r = params->width, s_g = params->height, s_b = params->depth;
 
     pl_clock_t start = pl_clock_now();
-    cmsHTRANSFORM tf = cmsCreateTransformTHR(p->cms, srcp, TYPE_RGB_16,
+    cmsHTRANSFORM tf = cmsCreateTransformTHR(p->cms, srcp, TYPE_RGBA_16,
                                              dstp, TYPE_RGBA_16,
                                              icc->params.intent,
                                              cmsFLAGS_BLACKPOINTCOMPENSATION |
@@ -641,14 +641,17 @@ static void fill_lut(void *datap, const struct sh_lut_params *params, bool decod
     pl_clock_t after_transform = pl_clock_now();
     pl_log_cpu_time(p->log, start, after_transform, "creating ICC transform");
 
-    uint16_t *tmp = pl_alloc(NULL, s_r * 3 * sizeof(tmp[0]));
+    const size_t tmp_size = s_r * 4 * sizeof(uint16_t);
+    uint16_t *tmp = pl_alloc(NULL, tmp_size);
+    memset(tmp, 0xFF, tmp_size);
+
     for (int b = 0; b < s_b; b++) {
         for (int g = 0; g < s_g; g++) {
             // Transform a single line of the output buffer
             for (int r = 0; r < s_r; r++) {
-                tmp[r * 3 + 0] = r * 65535 / (s_r - 1);
-                tmp[r * 3 + 1] = g * 65535 / (s_g - 1);
-                tmp[r * 3 + 2] = b * 65535 / (s_b - 1);
+                tmp[r * 4 + 0] = r * 65535 / (s_r - 1);
+                tmp[r * 4 + 1] = g * 65535 / (s_g - 1);
+                tmp[r * 4 + 2] = b * 65535 / (s_b - 1);
             }
 
             size_t offset = (b * s_g + g) * s_r * 4;

Does this also help?

haasn avatar Dec 09 '25 13:12 haasn

With only your latest patch the uninitialized bytes still appear:

==1608506== Memcheck, a memory error detector
==1608506== Copyright (C) 2002-2024, and GNU GPL'd, by Julian Seward et al.
==1608506== Using Valgrind-3.24.0 and LibVEX; rerun with -h for copyright info
==1608506== Command: dmpv -v --ao=null --wayland-libdecor=no /home/xxx/Videos/
==1608506== 
[cplayer] Command line options: '-v' '--ao=null' '--wayland-libdecor=no' '/home/xxx/Videos/'
[cplayer] dmpv 0.1.0 Copyright © 2000-2025 dmpv/mpv/MPlayer/mplayer2 projects
[cplayer] libplacebo version: v7.358.0 (v7.351.0-100-gecf59348-dirty)
[cplayer] FFmpeg version: N-122063-g0d2bff84d4
[cplayer] FFmpeg library versions:
[cplayer] libavcodec      62.22.101
[cplayer] libavdevice     62.2.100
[cplayer] libavfilter     11.10.101
[cplayer] libavformat     62.6.103
[cplayer] libavutil       60.19.101
[cplayer] libswresample   6.2.100
[cplayer] libswscale      9.3.100
[cplayer] Configuration: ./configure
[cplayer] List of enabled features: alsa clang drm drmprime egl egl-drm egl-drm-backend egl-helpers egl-x11 egl-x11-backend gbm git gl gl-wayland gl-wayland-backend gl-x11 gl-x11-backend glibc-thread-name gnuc gpl hwdec-vulkan iconv jpeg lcms2 libarchive libass libavdevice libdecor libdl libgl libiconv-plug libm libplacebo linux-fstatfs lua memfd-create ninja optimize pipewire sndio stdatomic uchardet usan vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-vulkan vaapi-wayland vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vt_h vulkan wayland x11
[cplayer] Loading config (preferred) '/home/xxx/.config/dmpv/dmpv.conf'
[cplayer] Reading config file /home/xxx/.config/dmpv/dmpv.conf
[file] Opening /home/xxx/.config/dmpv/dmpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'keep-open' = 'yes' (flags = 4)
[cplayer] Setting option 'mute' = 'yes' (flags = 4)
[global] config path: 'dmpv.conf' -> '/home/xxx/.config/dmpv/dmpv.conf'
[global] config path: 'config' -/-> '/home/xxx/.config/dmpv/config'
[global] config path: 'dmpv.conf' -/-> '/home/xxx/.dmpv/dmpv.conf'
[global] config path: 'config' -/-> '/home/xxx/.dmpv/config'
[global] config path: 'dmpv.conf' -> '/usr/local/etc/dmpv.conf'
[global] config path: 'config' -/-> '/usr/local/etc/config'
[cplayer] Reading config file /usr/local/etc/dmpv.conf
[file] Opening /usr/local/etc/dmpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Reading config file /home/xxx/.config/dmpv/dmpv.conf
[file] Opening /home/xxx/.config/dmpv/dmpv.conf
[cplayer] Applying profile 'default'...
[cplayer] Setting option 'keep-open' = 'yes' (flags = 4)
[cplayer] Setting option 'mute' = 'yes' (flags = 4)
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Setting option 'ao' = 'null' (flags = 8)
[cplayer] Setting option 'wayland-libdecor' = 'no' (flags = 8)
[global] config path: 'input.conf' -/-> '/home/xxx/.config/dmpv/input.conf'
[global] config path: 'input.conf' -/-> '/home/xxx/.dmpv/input.conf'
[global] config path: 'input.conf' -/-> '/usr/local/etc/input.conf'
[global] config path: 'scripts' -/-> '/home/xxx/.config/dmpv/scripts'
[global] config path: 'scripts' -/-> '/home/xxx/.dmpv/scripts'
[global] config path: 'scripts' -/-> '/usr/local/etc/scripts'
[cplayer] Waiting for scripts...
[global] config path: 'script-opts/stats.conf' -/-> '/home/xxx/.config/dmpv/script-opts/stats.conf'
[global] config path: 'script-opts/stats.conf' -/-> '/home/xxx/.dmpv/script-opts/stats.conf'
[global] config path: 'script-opts/stats.conf' -/-> '/usr/local/etc/script-opts/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/home/xxx/.config/dmpv/lua-settings/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/home/xxx/.dmpv/lua-settings/stats.conf'
[global] config path: 'lua-settings/stats.conf' -/-> '/usr/local/etc/lua-settings/stats.conf'
[global] config path: 'script-opts/positioning.conf' -/-> '/home/xxx/.config/dmpv/script-opts/positioning.conf'
[global] config path: 'script-opts/positioning.conf' -/-> '/home/xxx/.dmpv/script-opts/positioning.conf'
[global] config path: 'script-opts/positioning.conf' -/-> '/usr/local/etc/script-opts/positioning.conf'
[global] config path: 'lua-settings/positioning.conf' -/-> '/home/xxx/.config/dmpv/lua-settings/positioning.conf'
[global] config path: 'lua-settings/positioning.conf' -/-> '/home/xxx/.dmpv/lua-settings/positioning.conf'
[global] config path: 'lua-settings/positioning.conf' -/-> '/usr/local/etc/lua-settings/positioning.conf'
[cplayer] Done loading scripts.
[file] Opening /home/xxx/Videos/
[demux] Trying demuxers for level=normal.
[lavf] No format found, try lowering probescore or forcing the format.
[playlist] demuxer read all data; closing stream
[demux] Detected file format: directory (Playlist file)
[cplayer] Opening done: /home/xxx/Videos/
[cplayer] finished playback, success (reason 5)
[cplayer] INFO: /home/xxx/Videos/test.mp4
[file] Opening /home/xxx/Videos/test.mp4
[demux] Trying demuxers for level=normal.
[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: /home/xxx/Videos/test.mp4
[find_files] Loading external files in /home/xxx/Videos/
[global] config path: 'sub' -/-> '/home/xxx/.config/dmpv/sub'
[global] config path: 'sub' -/-> '/home/xxx/.dmpv/sub'
[global] config path: 'sub' -/-> '/usr/local/etc/sub'
[lavf] select track 0
[lavf] select track 1
[cplayer] INFO: h264 640x480 30.0fps
[cplayer] INFO: aac 2ch 44100Hz
[vo/default] Probing for best GPU context.
[global] INFO: Attempting to initialize GPU context waylandvk.
[vo/default/libplacebo] Initialized libplacebo v7.358.0 (v7.351.0-100-gecf59348-dirty) (API v358)
[vo/default/libplacebo] Spent 139.278 ms enumerating instance layers (slow!)
[vo/default/libplacebo] Spent 357.767 ms enumerating instance extensions (slow!)
[vo/default/libplacebo] Creating vulkan instance with extensions:
[vo/default/libplacebo]     VK_KHR_surface
[vo/default/libplacebo]     VK_KHR_get_surface_capabilities2
[vo/default/libplacebo]     VK_KHR_portability_enumeration
[vo/default/libplacebo]     VK_KHR_surface
[vo/default/libplacebo]     VK_KHR_wayland_surface
[vo/default/libplacebo] Spent 1301.188 ms creating vulkan instance (slow!)
[vo/default/wayland] Registered for protocol wl_compositor
[vo/default/wayland] Registered for protocol wl_shm
[vo/default/wayland] Registered for protocol wl_output
[vo/default/wayland] Registered for protocol wl_data_device_manager
[vo/default/wayland] Registered for protocol wl_subcompositor
[vo/default/wayland] Registered for protocol xdg_wm_base
[vo/default/wayland] Registered for protocol wp_viewporter
[vo/default/wayland] Registered for protocol wp_fractional_scale_manager_v1
[vo/default/wayland] Registered for protocol wl_seat
[vo/default/wayland] Registered for protocol zwp_linux_dmabuf_v1
[vo/default/wayland] Registered for protocol wp_presentation
[vo/default/wayland] Registered for protocol xdg_activation_v1
[vo/default/wayland] Registered for protocol zwp_idle_inhibit_manager_v1
[vo/default/wayland] Registered for protocol wp_color_manager_v1
[vo/default/wayland] Registered for protocol wp_fifo_manager_v1
[vo/default/wayland] Registered for protocol wp_cursor_shape_manager_v1
[vo/default/wayland] Activating window with token: '5e6fb608-7f73-4b9b-9c91-581f68369d85'
[vo/default/wayland] Compositor doesn't support the zxdg_decoration_manager_v1 protocol!
[vo/default/wayland] Compositor supports the wp_color_manager_v1 protocol
[vo/default/wayland] Setting up color management feedback for surface
[vo/default/wayland] Registered output AUO 0x45ec (0x3):
[vo/default/wayland] 	x: 0px, y: 0px
[vo/default/wayland] 	w: 1366px (340mm), h: 768px (190mm)
[vo/default/wayland] 	scale: 1
[vo/default/wayland] 	Hz: 60.001000
[vo/default/wayland] Obtained preferred scale, 1.000000, from the compositor.
[vo/default/libplacebo] Probing for vulkan devices:
[vo/default/libplacebo] Spent 319.061 ms enumerating physical devices (slow!)
[vo/default/libplacebo]     GPU 0: Intel(R) HD Graphics 4000 (IVB GT2) v1.2.335 (integrated)
[vo/default/libplacebo]            uuid: 86:80:66:01:09:00:00:00:00:02:00:00:00:00:00:00
[vo/default/libplacebo] Vulkan device properties:
[vo/default/libplacebo]     Device Name: Intel(R) HD Graphics 4000 (IVB GT2)
[vo/default/libplacebo]     Device ID: 8086:166
[vo/default/libplacebo]     Device UUID: 86:80:66:01:09:00:00:00:00:02:00:00:00:00:00:00
[vo/default/libplacebo]     Driver version: 6463063
[vo/default/libplacebo]     API version: 1.2.335
[vo/default/libplacebo]     Driver ID: VK_DRIVER_ID_INTEL_OPEN_SOURCE_MESA
[vo/default/libplacebo]     Driver name: Intel open-source Mesa driver
[vo/default/libplacebo]     Driver info: Mesa 26.0.0-devel (git-fd96ea45dc)
[vo/default/libplacebo]     Conformance version: 1.2.0.0
[vo/default/libplacebo]     Driver UUID: 25:ED:21:C8:59:42:4C:D5:5A:DB:45:F7:5D:73:4D:88
[vo/default/libplacebo] Creating vulkan device with extensions:
[vo/default/libplacebo]     VK_KHR_swapchain
[vo/default/libplacebo]     VK_KHR_swapchain
[vo/default/libplacebo]     VK_KHR_push_descriptor
[vo/default/libplacebo]     VK_KHR_external_memory_fd
[vo/default/libplacebo]     VK_EXT_external_memory_dma_buf
[vo/default/libplacebo]     VK_EXT_external_memory_host
[vo/default/libplacebo]     VK_KHR_external_semaphore_fd
[vo/default/libplacebo]     VK_EXT_pci_bus_info
[vo/default/libplacebo]     VK_EXT_image_drm_format_modifier
[vo/default/libplacebo]     VK_KHR_synchronization2
[vo/default/libplacebo]     VK_KHR_format_feature_flags2
[vo/default/libplacebo]     VK_EXT_shader_atomic_float
[vo/default/libplacebo]     VK_KHR_synchronization2
[vo/default/libplacebo]     VK_KHR_video_queue
[vo/default/libplacebo]     VK_KHR_video_decode_queue
[vo/default/libplacebo]     VK_KHR_video_decode_h264
[vo/default/libplacebo] Spent 267.056 ms creating vulkan device (slow!)
[vo/default/libplacebo] Memory heaps supported by device:
[vo/default/libplacebo]     0: flags 0x1 size 1536M
[vo/default/libplacebo] Memory summary:     0 used     0 res     0 alloc, efficiency 100.00%, utilization 100.00%, max page:   96M
[vo/default/libplacebo] shaderc SPIR-V version 1.6 rev 1
[vo/default/libplacebo] Initialized SPIR-V compiler 'shaderc'
[vo/default/libplacebo] GPU information:
[vo/default/libplacebo]     GLSL version: 450 (vulkan)
[vo/default/libplacebo]       max_shmem_size:            65536
[vo/default/libplacebo]       max_group_threads:         1024
[vo/default/libplacebo]       max_group_size[0]:         1024
[vo/default/libplacebo]       max_group_size[1]:         1024
[vo/default/libplacebo]       max_group_size[2]:         1024
[vo/default/libplacebo]       subgroup_size:             0
[vo/default/libplacebo]       min_gather_offset:         -32
[vo/default/libplacebo]       max_gather_offset:         31
[vo/default/libplacebo]     Limits:
[vo/default/libplacebo]       thread_safe:               1
[vo/default/libplacebo]       callbacks:                 1
[vo/default/libplacebo]       max_buf_size:              1610612736
[vo/default/libplacebo]       max_ubo_size:              134217728
[vo/default/libplacebo]       max_ssbo_size:             1073741824
[vo/default/libplacebo]       max_vbo_size:              1610612736
[vo/default/libplacebo]       max_mapped_size:           1610612736
[vo/default/libplacebo]       max_buffer_texels:         134217728
[vo/default/libplacebo]       align_host_ptr:            4096
[vo/default/libplacebo]       host_cached:               1
[vo/default/libplacebo]       max_tex_1d_dim:            16384
[vo/default/libplacebo]       max_tex_2d_dim:            8192
[vo/default/libplacebo]       max_tex_3d_dim:            2048
[vo/default/libplacebo]       blittable_1d_3d:           1
[vo/default/libplacebo]       buf_transfer:              1
[vo/default/libplacebo]       align_tex_xfer_pitch:      128
[vo/default/libplacebo]       align_tex_xfer_offset:     128
[vo/default/libplacebo]       max_variable_comps:        0
[vo/default/libplacebo]       max_constants:             18446744073709551615
[vo/default/libplacebo]       max_pushc_size:            128
[vo/default/libplacebo]       align_vertex_stride:       1
[vo/default/libplacebo]       max_dispatch[0]:           65535
[vo/default/libplacebo]       max_dispatch[1]:           65535
[vo/default/libplacebo]       max_dispatch[2]:           65535
[vo/default/libplacebo]       fragment_queues:           1
[vo/default/libplacebo]       compute_queues:            1
[vo/default/libplacebo]     External API interop:
[vo/default/libplacebo]       UUID: 86:80:66:01:09:00:00:00:00:02:00:00:00:00:00:00
[vo/default/libplacebo]       PCI: 0000:00:02:0
[vo/default/libplacebo]       buf export caps: 0x9
[vo/default/libplacebo]       buf import caps: 0x19
[vo/default/libplacebo]       tex export caps: 0x9
[vo/default/libplacebo]       tex import caps: 0x9
[vo/default/libplacebo]       sync export caps: 0x1
[vo/default/libplacebo]       sync import caps: 0x0
[vo/default/vulkan] libplacebo: Creating RA wrapper for pl_gpu
[vo/default/vulkan] libplacebo: GLSL version=450 vulkan=1 es=0
[vo/default/vulkan] libplacebo: GPU supports compute shaders
[vo/default/vulkan] libplacebo: 1D textures supported (max=16384)
[vo/default/vulkan] libplacebo: 3D textures supported (max=2048)
[vo/default/vulkan] libplacebo: UBO supported (max=134217728 bytes)
[vo/default/vulkan] libplacebo: SSBO supported (max=1073741824 bytes)
[vo/default/vulkan] libplacebo: Texture gather supported
[vo/default/vulkan] libplacebo: Blit operations supported
[vo/default/vulkan] libplacebo: Limits: max_tex_2d=8192 pushc=128 compute_threads=1024 shmem=65536
[vo/default/vulkan] libplacebo: Enumerating 98 GPU formats
[vo/default/vulkan] libplacebo: Registered 35 usable formats
[vo/default/libplacebo] Available surface configurations:
[vo/default/libplacebo]     0: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     1: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     2: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     3: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     4: VK_FORMAT_R8G8B8A8_SRGB                  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     5: VK_FORMAT_R8G8B8A8_UNORM                 VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     6: VK_FORMAT_R5G6B5_UNORM_PACK16            VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default/libplacebo]     7: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     8: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     9: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     10: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     11: VK_FORMAT_R8G8B8A8_SRGB                  VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     12: VK_FORMAT_R8G8B8A8_UNORM                 VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     13: VK_FORMAT_R5G6B5_UNORM_PACK16            VK_COLOR_SPACE_PASS_THROUGH_EXT
[vo/default/libplacebo]     14: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     15: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     16: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     17: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     18: VK_FORMAT_R8G8B8A8_SRGB                  VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     19: VK_FORMAT_R8G8B8A8_UNORM                 VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     20: VK_FORMAT_R5G6B5_UNORM_PACK16            VK_COLOR_SPACE_BT709_LINEAR_EXT
[vo/default/libplacebo]     21: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     22: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     23: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     24: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     25: VK_FORMAT_R8G8B8A8_SRGB                  VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     26: VK_FORMAT_R8G8B8A8_UNORM                 VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     27: VK_FORMAT_R5G6B5_UNORM_PACK16            VK_COLOR_SPACE_BT709_NONLINEAR_EXT
[vo/default/libplacebo]     28: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     29: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     30: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     31: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     32: VK_FORMAT_R8G8B8A8_SRGB                  VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     33: VK_FORMAT_R8G8B8A8_UNORM                 VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     34: VK_FORMAT_R5G6B5_UNORM_PACK16            VK_COLOR_SPACE_BT2020_LINEAR_EXT
[vo/default/libplacebo]     35: VK_FORMAT_R16G16B16A16_SFLOAT            VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo]     36: VK_FORMAT_A2R10G10B10_UNORM_PACK32       VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo]     37: VK_FORMAT_B8G8R8A8_SRGB                  VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo]     38: VK_FORMAT_B8G8R8A8_UNORM                 VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo]     39: VK_FORMAT_R8G8B8A8_SRGB                  VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo]     40: VK_FORMAT_R8G8B8A8_UNORM                 VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo]     41: VK_FORMAT_R5G6B5_UNORM_PACK16            VK_COLOR_SPACE_HDR10_ST2084_EXT
[vo/default/libplacebo] Picked surface configuration 1: VK_FORMAT_A2R10G10B10_UNORM_PACK32 + VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
[vo/default] libplacebo: applied typed pl_tone_map_params (param=0)
[vo/default] Querying ICC profile...
[vo/default/wayland] gl_lcms_generate_profile_from_csp: generated ICC profile from parametric data (568 bytes, primaries=1, gamma=9)
[vo/default/libplacebo] Opened ICC profile:
[vo/default/libplacebo]     Contrast = 203 cd/m^2 : 0.001 mcd/m^2 ≈ 203000000 : 1
[vo/default/libplacebo]     Detected primaries: ITU-R Rec. BT.601 (525-line = NTSC, SMPTE-C)
[vo/default/libplacebo]     Transfer function: Pure power gamma 2.8
[vd] Container reported FPS: 30.000000
[vd] Codec list:
[vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd] Opening decoder h264
[vd] Looking at hwdec h264-vaapi...
[vo/default] Loading hwdec drivers for format: 'vaapi'
[vo/default] Loading hwdec driver 'vaapi'
[vo/default/vaapi] using libplacebo dmabuf interop
[vo/default/vaapi] VA-API: Creating native display
[vo/default/vaapi] Trying to open a x11 VA display...
[vo/default/vaapi] Trying to open a wayland VA display...
[vo/default/vaapi] VA-API: Display created successfully
[vo/default/vaapi] VA-API: Initializing VA context
[vo/default/vaapi/vaapi] libva: VA-API version 1.23.0
[vo/default/vaapi/vaapi] libva: Trying to open /usr/local/lib/dri/i965_drv_video.so
[vo/default/vaapi/vaapi] libva: Found init function __vaDriverInit_1_23
[vo/default/vaapi/vaapi] libva: va_openDriver() returns 0
[vo/default/vaapi/vaapi] Initialized VA-API: version 1.23
[vo/default/vaapi] VA-API: Context initialized successfully
[vo/default/vaapi] Reticulating splines...
[vo/default/vaapi] VA-API: Probing supported formats
[vo/default/vaapi] VA-API: Found 10 profiles
[vo/default/vaapi] VA-API: Profile 0 has 2 entrypoints
[vo/default/vaapi] VA-API: Testing profile 0 with VLD entrypoint
[vo/default/vaapi] VA-API: Found working formats, stopping probe
[vo/default/vaapi] Done probing surface formats.
[vd] Trying hardware decoding via h264-vaapi.
[vd] FFmpeg: Using hwdec codec 'h264' for h264
[vd] FFmpeg: Codec 'h264' (ID=27) is not intra-only
[vd] FFmpeg: Codec context allocated, timebase=1/15360
[vd] FFmpeg: Configuring hardware decoding
[vd] FFmpeg: Using unsafe output flag for hwdec
[vd] FFmpeg: Using hardware frames
[vd] FFmpeg: Using hwdec pixel format callback
[vd] FFmpeg: Using 4 threads for hwdec
[vd] Requesting 4 threads for decoding.
[vd] FFmpeg: Opening codec 'h264'
[vd] FFmpeg: Codec opened successfully
[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]     libfdk_aac (aac) - Fraunhofer FDK AAC
[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] Pre-loading OSD to avoid lag on first display...
[global] config path: 'fonts' -/-> '/home/xxx/.config/dmpv/fonts'
[global] config path: 'fonts' -/-> '/home/xxx/.dmpv/fonts'
[global] config path: 'fonts' -/-> '/usr/local/etc/fonts'
[osd/libass] libass API version: 0x1703000
[osd/libass] libass source: tarball: 0.17.3
[osd/libass] Shaper: FriBidi 1.0.15 (SIMPLE) HarfBuzz-ng 10.2.0 (COMPLEX)
[global] config path: 'subfont.ttf' -/-> '/home/xxx/.config/dmpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> '/home/xxx/.dmpv/subfont.ttf'
[global] config path: 'subfont.ttf' -/-> '/usr/local/etc/subfont.ttf'
[global] config path: 'fonts.conf' -/-> '/home/xxx/.config/dmpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> '/home/xxx/.dmpv/fonts.conf'
[global] config path: 'fonts.conf' -/-> '/usr/local/etc/fonts.conf'
[osd/libass] Setting up fonts...
[osd/libass] Using font provider fontconfig
[osd/libass] Done.
[cplayer] OSD pre-loading complete.
[af] [in] 44100Hz stereo 2ch floatp
[af] [userspeed] 44100Hz stereo 2ch floatp
[af] [userspeed] (disabled)
[af] [convert] 44100Hz stereo 2ch floatp
[vd] Pixel formats supported by decoder: vdpau vulkan vaapi yuv420p
[vd] Codec profile: Main (0x4d)
[vd] FFmpeg: Initializing hwaccel for format vaapi
[vd] FFmpeg: HW frames context: format=vaapi sw_format=nv12 size=640x480 pool=0
[vd] FFmpeg: Initializing new HW frames context
[vd] FFmpeg: HW frames context configured successfully
[vd] Requesting pixfmt 'vaapi' from decoder.
[ao] Trying audio driver 'null'
[ao/null] requested format: 44100 Hz, stereo channels, floatp
[ao/null] Channel layouts:
[ao/null]  - anything
[ao/null] result: stereo
[ao/null] device buffer: 8704 samples.
[ao/null] using soft-buffer of 8820 samples.
[cplayer] INFO: [null] 44100Hz stereo 2ch floatp
[cplayer] AO: Description: Null audio output
[af] [convert] (disabled)
[af] [out] 44100Hz stereo 2ch floatp
[vd] INFO: Using hardware decoding (vaapi).
[vd] Decoder format: 640x480 vaapi[nv12] auto/auto/auto/auto/auto CL=mpeg2/4/h264
[vd] Using container aspect ratio.
[vf] [in] 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [userdeint] (disabled)
[vf] [autovflip] 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [autovflip] (disabled)
[vf] [autorotate] 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vf] [autorotate] (disabled)
[vf] [convert] 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/default] Loading hwdec drivers for format: 'vaapi'
[vf] [out] 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[cplayer] INFO: [default] 640x480 vaapi[nv12]
[cplayer] VO: Description: Video output based on libplacebo
[vo/default] reconfig to 640x480 vaapi[nv12] bt.601/bt.601-525/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/default] Window size: 640x480 (Borders: l=0 t=0 r=0 b=0)
[vo/default] Video source: 640x480 (1:1)
[vo/default] Video display: (0, 0) 640x480 -> (0, 0) 640x480
[vo/default] Video scale: 1.000000/1.000000
[vo/default] OSD borders: l=0 t=0 r=0 b=0
[vo/default] Video borders: l=0 t=0 r=0 b=0
[vo/default/wayland] Resizing due to xdg from 640x480 to 1366x768
[vo/default/wayland] Handling resize on the vk side
[vo/default] Window size: 1366x768 (Borders: l=0 t=0 r=0 b=0)
[vo/default] Video source: 640x480 (1:1)
[vo/default] Video display: (0, 0) 640x480 -> (363, 144) 640x480
[vo/default] Video scale: 1.000000/1.000000
[vo/default] OSD borders: l=363 t=144 r=363 b=144
[vo/default] Video borders: l=363 t=144 r=363 b=144
[vo/default/libplacebo] Detected fps ratio 0.0099 below threshold 0.0100, disabling interpolation
[vo/default/libplacebo] Spent 36.308 ms creating ICC transform
[vo/default/libplacebo] Spent 4555.805 ms generating ICC 3DLUT (slow!)
[vo/default/libplacebo] Spent 4594.475 ms generating shader LUT (slow!)
==1608506== Thread 7 vo:
==1608506== Syscall param write(buf) points to uninitialised byte(s)
==1608506==    at 0x89549EE: __syscall_cancel_arch (syscall_cancel.S:56)
==1608506==    by 0x8949667: __internal_syscall_cancel (cancellation.c:49)
==1608506==    by 0x89496AC: __syscall_cancel (cancellation.c:75)
==1608506==    by 0x89BE935: write (write.c:26)
==1608506==    by 0x89455F4: _IO_file_write@@GLIBC_2.2.5 (fileops.c:1182)
==1608506==    by 0x89438D1: new_do_write (fileops.c:450)
==1608506==    by 0x89457F8: _IO_new_file_xsputn (fileops.c:1256)
==1608506==    by 0x89457F8: _IO_file_xsputn@@GLIBC_2.2.5 (fileops.c:1198)
==1608506==    by 0x893937B: fwrite (iofwrite.c:39)
==1608506==    by 0xB16949: cache_save_obj (in /usr/local/bin/dmpv)
==1608506==    by 0x83C4ADD: pl_cache_try_set (cache.c:189)
==1608506==    by 0x83C4ADD: pl_cache_try_set (cache.c:173)
==1608506==    by 0x83C4B38: pl_cache_set (cache.c:195)
==1608506==    by 0x83AF6F0: sh_lut (lut.c:600)
==1608506==  Address 0x199e1ff6 is 38 bytes inside a block of size 2,097,184 alloc'd
==1608506==    at 0x4844818: malloc (vg_replace_malloc.c:446)
==1608506==    by 0x83E48B2: pl_alloc (pl_alloc.c:123)
==1608506==    by 0x83AF41B: pl_cache_obj_resize (cache.h:51)
==1608506==    by 0x83AF41B: sh_lut (lut.c:483)
==1608506==    by 0x83ADBA5: pl_icc_encode (icc.c:769)
==1608506==    by 0x838BF10: pass_convert_colors (renderer.c:2252)
==1608506==    by 0x8394123: pl_render_image (renderer.c:3497)
==1608506==    by 0x839540F: pl_render_image_mix (renderer.c:4034)
==1608506==    by 0xB0CB28: draw_frame (in /usr/local/bin/dmpv)
==1608506==    by 0xAFC85E: render_frame (in /usr/local/bin/dmpv)
==1608506==    by 0xAF865E: vo_thread (in /usr/local/bin/dmpv)
==1608506==    by 0x894CB7A: start_thread (pthread_create.c:448)
==1608506==    by 0x89CA5EF: clone (clone.S:100)
==1608506== 
[vo/default/libplacebo] Spent 77.569 ms compiling shader
[vo/default/libplacebo] Spent 276.106 ms creating pipeline (slow!)
[cplayer] first video frame after restart shown
[cplayer] audio ready
[cplayer] starting audio playback
[cplayer] playback restart complete @ 0.033008, audio=playing, video=playing

[K[statusline] INFO: 00:00:00 / 01:51:34 (0%)
[statusline] 
[+-------------------------------------------------------------------------------------------------------------------------------]
[ao/null] starting AO

[K[statusline] INFO: 00:00:00 / 01:51:34 (0%)
[statusline] 
[+-------------------------------------------------------------------------------------------------------------------------------]
[vo/default/wayland] Given DND offer with mime type text/plain;charset=utf-8
[vo/default/wayland] Received a new DND offer. Releasing the previous offer.
[vo/default/wayland] Surface entered output AUO 0x45ec (0x3), scale = 1.000000, refresh rate = 60.001000 Hz
[vo/default/wayland] Enabling idle inhibitor
[vo/default] Assuming 60.001000 FPS for display sync.

[K[statusline] INFO: 00:00:00 / 01:51:34 (0%)
[statusline] 
[+-------------------------------------------------------------------------------------------------------------------------------]
[vo/default/libplacebo] Estimated source FPS: 30.000, display FPS: 30.073

[K[statusline] INFO: 00:00:00 / 01:51:34 (0%)
[statusline] 
[+-------------------------------------------------------------------------------------------------------------------------------]
[cplayer] 
[cplayer] Audio/Video desynchronization detected! Possible reasons include slow
[cplayer] hardware, temporary CPU spikes, broken drivers, broken files, heavy
[cplayer] shaders, or heavy filters. Audio position will not match the video.
[cplayer] 

[K[statusline] INFO: 00:00:00 / 01:51:34 (0%)
[statusline] 
[+-------------------------------------------------------------------------------------------------------------------------------]
[cplayer] EOF code: 5  
[cplayer] finished playback, success (reason 3)
[cplayer] Exiting... (Quit)
[vo/default/wayland] Disabling the idle inhibitor
[vo/default] Removing /home/xxx/.cache/dmpv/icc_7fbe57a28201fd1b | size:   2097152 bytes | last used:     90127 seconds ago
[vo/default/wayland] Deregistering output AUO 0x45ec (0x3)
==1608506== 
==1608506== HEAP SUMMARY:
==1608506==     in use at exit: 22,654 bytes in 34 blocks
==1608506==   total heap usage: 124,250 allocs, 124,072 frees, 166,515,503 bytes allocated
==1608506== 
==1608506== LEAK SUMMARY:
==1608506==    definitely lost: 0 bytes in 0 blocks
==1608506==    indirectly lost: 0 bytes in 0 blocks
==1608506==      possibly lost: 0 bytes in 0 blocks
==1608506==    still reachable: 22,654 bytes in 34 blocks
==1608506==         suppressed: 0 bytes in 0 blocks
==1608506== Reachable blocks (those to which a pointer was found) are not shown.
==1608506== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==1608506== 
==1608506== Use --track-origins=yes to see where uninitialised values come from
==1608506== For lists of detected and suppressed errors, rerun with: -s
==1608506== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

dancingmirrors avatar Dec 09 '25 15:12 dancingmirrors