.NET 8 Avalonia GTK - low performance

Hi,

I wanted to ask a question about the Avalonia GTK vscode template. When it comes to animations, rendering, page navigation and general performance the app seems to be lagging pretty hard.

I’m using the standard vscode template from the bookworm branch with a few tweaks. I use the weston compositor instead of xfce, I’ve added [“libvlc-dev”, “vlc”] libs to implement a VLC based video player and ScottPlot for chart support. I also changed the default ReactiveUI binding system to the Community Toolkit.

Edit: Forgot to mention, I’m using the Verdin AM62 board attached to a dahlia carrier board. The display is a connected 10inch DSI panel.

After changing the code in the Program.cs to something like this, it works a little bit better but is still far from being fluent:

Is there something I might be missing that slows down the performance so much?

class Program
{
    // Initialization code. Don't use any Avalonia, third-party APIs or any
    // SynchronizationContext-reliant code before AppMain is called: things aren't initialized
    // yet and stuff might break.
    [STAThread]
    public static void Main(string[] args) => BuildAvaloniaApp()
        .StartWithClassicDesktopLifetime(args);

    // Avalonia configuration, don't remove; also used by visual designer.
    public static AppBuilder BuildAvaloniaApp() 
    {
        IReadOnlyList<X11RenderingMode> renders = new List<X11RenderingMode>
            {
                X11RenderingMode.Egl,
                X11RenderingMode.Glx
            };
    
        return AppBuilder.Configure<App>()
                .UsePlatformDetect()
                .WithInterFont()
                .LogToTrace()
                .UseSkia()
                .With(new SkiaOptions() { MaxGpuResourceSizeBytes = 49152000 })  // ~49mb 12x 1280 x 800 textures. 
                .With(new X11PlatformOptions
                {
                    RenderingMode = renders,
                });
    }
}

Weston compositor logs:

Switching VT tty1 to text mode if currently in graphics mode
Switching VT mode of /dev/tty1 to text
Switching to VT 7
Cannot detect SoC! Assuming it's GPU-capable.
SoC has GPU: true
SoC has DPU: false
Removing previously created '.X*-lock' entries under /tmp before starting Weston. Pass 'IGNORE_X_LOCKS=1' environment variable to Weston container to disable this behavior.
dos2unix: converting file /etc/xdg/weston/weston.ini to Unix format...
dos2unix: converting file /etc/xdg/weston-dev/weston.ini to Unix format...
00:00:00.000 [INFO] [seatd/seat.c:39] Created VT-bound seat seat0
00:00:00.000 [INFO] [seatd/seatd.c:194] seatd started
Date: 2025-03-21 UTC
[07:59:32.087] weston 10.0.1
               https://wayland.freedesktop.org
               Bug reports to: https://gitlab.freedesktop.org/wayland/weston/issues/
               Build: 10.0.1
[07:59:32.088] Command line: weston -Bdrm-backend.so -Swayland-0
[07:59:32.088] OS: Linux, 6.6.58-7.1.0-gf874412b7190, #1-Torizon SMP PREEMPT Fri Dec  6 14:07:48 UTC 2024, aarch64
[07:59:32.088] Flight recorder: enabled
[07:59:32.089] Using config file '/etc/xdg/weston/weston.ini'
[07:59:32.090] Output repaint window is 7 ms maximum.
[07:59:32.090] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/drm-backend.so'
[07:59:32.105] initializing drm backend
[07:59:32.105] Trying libseat launcher...
00:00:00.066 [INFO] [seatd/server.c:145] New client connected (pid: 27, uid: 1000, gid: 1000)
00:00:00.066 [INFO] [seatd/seat.c:170] Added client 7 to seat0
00:00:00.067 [INFO] [seatd/seat.c:480] Opened client 7 on seat0
[07:59:32.107] libseat: session control granted
[07:59:32.112] using /dev/dri/card0
[07:59:32.113] DRM: supports atomic modesetting
[07:59:32.113] DRM: supports GBM modifiers
[07:59:32.113] DRM: supports picture aspect ratio
[07:59:32.113] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/gl-renderer.so'
MESA-LOADER: failed to open tidss: /usr/lib/dri/tidss_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
failed to load driver: tidss
[07:59:32.877] EGL client extensions: EGL_EXT_device_base
               EGL_EXT_device_enumeration EGL_EXT_device_query
               EGL_EXT_platform_base EGL_KHR_client_get_all_proc_addresses
               EGL_EXT_client_extensions EGL_KHR_debug EGL_EXT_platform_device
               EGL_EXT_platform_wayland EGL_KHR_platform_wayland
               EGL_EXT_platform_x11 EGL_KHR_platform_x11 EGL_EXT_platform_xcb
               EGL_MESA_platform_gbm EGL_KHR_platform_gbm
               EGL_MESA_platform_surfaceless
[07:59:32.882] EGL device extensions: EGL_MESA_device_software
               EGL_EXT_device_drm_render_node
[07:59:32.882] failed to query DRM device from EGL
[07:59:32.882] EGL version: 1.4
[07:59:32.882] EGL vendor: Mesa Project
[07:59:32.882] EGL client APIs: OpenGL OpenGL_ES 
[07:59:32.882] EGL extensions: EGL_ANDROID_blob_cache EGL_EXT_buffer_age
               EGL_EXT_image_dma_buf_import
               EGL_EXT_image_dma_buf_import_modifiers EGL_KHR_cl_event2
               EGL_KHR_config_attribs EGL_KHR_context_flush_control
               EGL_KHR_create_context EGL_KHR_create_context_no_error
               EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses
               EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image
               EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image
               EGL_KHR_gl_texture_cubemap_image EGL_KHR_image
               EGL_KHR_image_base EGL_KHR_image_pixmap
               EGL_KHR_no_config_context EGL_KHR_reusable_sync
               EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float
               EGL_KHR_wait_sync EGL_MESA_configless_context
               EGL_MESA_image_dma_buf_export EGL_MESA_query_driver
[07:59:32.882] warning: Disabling render GPU timeline and explicit synchronization due to missing EGL_ANDROID_native_fence_sync extension
[07:59:32.882] EGL_KHR_surfaceless_context available
[07:59:32.927] GL version: OpenGL ES 3.2 Mesa 22.3.6
[07:59:32.928] GLSL version: OpenGL ES GLSL ES 3.20
[07:59:32.928] GL vendor: Mesa/X.org
[07:59:32.928] GL renderer: llvmpipe (LLVM 15.0.6, 128 bits)
[07:59:32.928] GL extensions: GL_EXT_blend_minmax GL_EXT_multi_draw_arrays
               GL_EXT_texture_filter_anisotropic
               GL_EXT_texture_compression_s3tc GL_EXT_texture_compression_dxt1
               GL_EXT_texture_compression_rgtc GL_EXT_texture_format_BGRA8888
               GL_OES_compressed_ETC1_RGB8_texture GL_OES_depth24
               GL_OES_element_index_uint GL_OES_fbo_render_mipmap
               GL_OES_mapbuffer GL_OES_rgb8_rgba8 GL_OES_standard_derivatives
               GL_OES_stencil8 GL_OES_texture_3D GL_OES_texture_float
               GL_OES_texture_float_linear GL_OES_texture_half_float
               GL_OES_texture_half_float_linear GL_OES_texture_npot
               GL_OES_vertex_half_float GL_EXT_draw_instanced
               GL_EXT_texture_sRGB_decode GL_OES_EGL_image
               GL_OES_depth_texture GL_OES_packed_depth_stencil
               GL_EXT_texture_type_2_10_10_10_REV GL_NV_conditional_render
               GL_OES_get_program_binary GL_APPLE_texture_max_level
               GL_EXT_discard_framebuffer GL_EXT_read_format_bgra
               GL_NV_pack_subimage GL_EXT_frag_depth
               GL_NV_fbo_color_attachments GL_OES_EGL_image_external
               GL_OES_EGL_sync GL_OES_vertex_array_object
               GL_OES_viewport_array GL_ANGLE_pack_reverse_row_order
               GL_ANGLE_texture_compression_dxt3
               GL_ANGLE_texture_compression_dxt5
               GL_EXT_occlusion_query_boolean GL_EXT_robustness
               GL_EXT_texture_rg GL_EXT_unpack_subimage GL_NV_draw_buffers
               GL_NV_read_buffer GL_NV_read_depth GL_NV_read_depth_stencil
               GL_NV_read_stencil GL_EXT_draw_buffers GL_EXT_map_buffer_range
               GL_KHR_debug GL_KHR_robustness
               GL_KHR_texture_compression_astc_ldr GL_NV_pixel_buffer_object
               GL_OES_depth_texture_cube_map GL_OES_required_internalformat
               GL_OES_surfaceless_context GL_EXT_color_buffer_float
               GL_EXT_debug_label GL_EXT_sRGB_write_control
               GL_EXT_separate_shader_objects GL_EXT_shader_framebuffer_fetch
               GL_EXT_shader_group_vote GL_EXT_shader_implicit_conversions
               GL_EXT_shader_integer_mix GL_EXT_tessellation_point_size
               GL_EXT_tessellation_shader GL_ANDROID_extension_pack_es31a
               GL_ARM_shader_framebuffer_fetch_depth_stencil
               GL_EXT_base_instance GL_EXT_compressed_ETC1_RGB8_sub_texture
               GL_EXT_copy_image GL_EXT_draw_buffers_indexed
               GL_EXT_draw_elements_base_vertex GL_EXT_gpu_shader5
               GL_EXT_polygon_offset_clamp GL_EXT_primitive_bounding_box
               GL_EXT_render_snorm GL_EXT_shader_io_blocks
               GL_EXT_texture_border_clamp GL_EXT_texture_buffer
               GL_EXT_texture_cube_map_array GL_EXT_texture_norm16
               GL_EXT_texture_view GL_KHR_blend_equation_advanced
               GL_KHR_blend_equation_advanced_coherent
               GL_KHR_context_flush_control
               GL_KHR_robust_buffer_access_behavior GL_NV_image_formats
               GL_NV_shader_noperspective_interpolation GL_OES_copy_image
               GL_OES_draw_buffers_indexed GL_OES_draw_elements_base_vertex
               GL_OES_gpu_shader5 GL_OES_primitive_bounding_box
               GL_OES_sample_shading GL_OES_sample_variables
               GL_OES_shader_io_blocks GL_OES_shader_multisample_interpolation
               GL_OES_tessellation_point_size GL_OES_tessellation_shader
               GL_OES_texture_border_clamp GL_OES_texture_buffer
               GL_OES_texture_cube_map_array GL_OES_texture_stencil8
               GL_OES_texture_storage_multisample_2d_array GL_OES_texture_view
               GL_EXT_blend_func_extended GL_EXT_buffer_storage
               GL_EXT_float_blend GL_EXT_geometry_point_size
               GL_EXT_geometry_shader GL_EXT_texture_filter_minmax
               GL_EXT_texture_sRGB_R8 GL_EXT_texture_sRGB_RG8 GL_KHR_no_error
               GL_KHR_texture_compression_astc_sliced_3d
               GL_OES_EGL_image_external_essl3 GL_OES_geometry_point_size
               GL_OES_geometry_shader GL_OES_shader_image_atomic
               GL_EXT_clear_texture GL_EXT_clip_cull_distance
               GL_EXT_disjoint_timer_query
               GL_EXT_texture_compression_s3tc_srgb
               GL_MESA_shader_integer_functions GL_EXT_clip_control
               GL_EXT_color_buffer_half_float GL_EXT_memory_object
               GL_EXT_memory_object_fd GL_EXT_texture_compression_bptc
               GL_EXT_texture_mirror_clamp_to_edge
               GL_KHR_parallel_shader_compile GL_EXT_EGL_image_storage
               GL_EXT_shader_framebuffer_fetch_non_coherent
               GL_EXT_texture_shadow_lod GL_MESA_framebuffer_flip_y
               GL_EXT_depth_clamp GL_EXT_texture_query_lod GL_MESA_bgra
[07:59:32.987] GL ES 3.2 - renderer features:
               read-back format: BGRA
               EGL Wayland extension: no
[07:59:33.012] event1  - tps65219-pwrbutton: is tagged by udev as: Keyboard
[07:59:33.012] event1  - tps65219-pwrbutton: device is a keyboard
[07:59:33.021] event2  - ilitek_ts: is tagged by udev as: Touchscreen
[07:59:33.023] event2  - ilitek_ts: device is a touch device
[07:59:33.030] event0  - gpio-keys: is tagged by udev as: Keyboard
[07:59:33.031] event0  - gpio-keys: device is a keyboard
[07:59:33.074] libinput: configuring device "tps65219-pwrbutton".
[07:59:33.075] Touchscreen - ilitek_ts - /sys/devices/platform/bus@f0000/20020000.i2c/i2c-2/2-0041/input/input2/event2
[07:59:33.075] libinput: configuring device "ilitek_ts".
[07:59:33.075] input device event2 has no enabled output associated (none named), skipping calibration for now.
[07:59:33.075] libinput: configuring device "gpio-keys".
[07:59:33.076] DRM: head 'LVDS-1' updated, connector 40 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[07:59:33.077] DRM: head 'LVDS-1' found, connector 40 is connected, EDID make 'unknown', model 'unknown', serial 'unknown'
[07:59:33.078] Registered plugin API 'weston_drm_output_api_v1' of size 24
[07:59:33.078] Registered plugin API 'weston_drm_virtual_output_api_v1' of size 48
[07:59:33.078] Color manager: no-op
[07:59:33.078] Output 'LVDS-1' using color profile: built-in default sRGB SDR profile
[07:59:33.079] Chosen EGL config details: id:  31 rgba: 8 8 8 0 buf: 24 dep:  0 stcl: 0 int: 1-1 type: win vis_id: XRGB8888 (0x34325258)
[07:59:33.079] Output LVDS-1 (crtc 38) video modes:
               1280x800@58.0, preferred, current, 71.1 MHz
[07:59:33.079] associating input device event1 with output LVDS-1 (none by udev)
[07:59:33.079] associating input device event2 with output LVDS-1 (none by udev)
[07:59:33.081] associating input device event0 with output LVDS-1 (none by udev)
[07:59:33.081] Output 'LVDS-1' enabled with head(s) LVDS-1
[07:59:33.081] Compositor capabilities:
               arbitrary surface rotation: yes
               screen capture uses y-flip: yes
               cursor planes: yes
               arbitrary resolutions: no
               view mask clipping: yes
               explicit sync: no
               color operations: yes
               presentation clock: CLOCK_MONOTONIC, id 1
               presentation clock resolution: 0.000000001 s
[07:59:33.082] Loading module '/usr/lib/aarch64-linux-gnu/weston/desktop-shell.so'
[07:59:33.086] launching '/usr/lib/aarch64-linux-gnu/weston-keyboard'
[07:59:33.096] Note: support for the deprecated wl_shell interface is disabled. If a legacy client still needs it, it can be re-enabled by passing -Ddeprecated-wl-shell=true to Meson when building Weston.
[07:59:33.098] Loading module '/usr/lib/aarch64-linux-gnu/weston/screen-share.so'
[07:59:33.102] Loading module '/usr/lib/aarch64-linux-gnu/libweston-10/xwayland.so'
[07:59:33.183] Registered plugin API 'weston_xwayland_v1' of size 32
[07:59:33.183] Registered plugin API 'weston_xwayland_surface_v1' of size 16
[07:59:33.184] xserver listening on display :0
[07:59:33.184] launching '/usr/lib/aarch64-linux-gnu/weston-desktop-shell'
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
could not load cursor 'dnd-move'
could not load cursor 'dnd-copy'
could not load cursor 'dnd-none'
[07:59:35.492] unexpectedly large timestamp jump (from 2394692 to 2396002)
[07:59:35.996] Spawned Xwayland server, pid 39
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
(WW) Option "-listen" for file descriptors is deprecated
Please use "-listenfd" instead.
libEGL warning: MESA-LOADER: failed to open pvr: /usr/lib/dri/pvr_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
libEGL warning: MESA-LOADER: failed to open pvr: /usr/lib/dri/pvr_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
Failed to initialize glamor, falling back to sw
[07:59:36.347] xfixes version: 6.0
[07:59:36.397] created wm, root 1309
The XKEYBOARD keymap compiler (xkbcomp) reports:
Warning:          Unsupported maximum keycode 708, clipping.
                  X11 cannot support keycodes above 255.
Errors from xkbcomp are not fatal to the X server

tdx-info output:

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.58-7.1.0-gf874412b7190 #1-Torizon SMP PREEMPT Fri Dec  6 14:07:48 UTC 2024
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/f3e8eace2362cfd69fe527293cf3f705d48ce1c6781b1052c56459592e6a30dc/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.1.0-build.4
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-am62-15380640
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 WB on Verdin Development Board
Toradex version:          0076 V1.1C
Serial number:            15380640
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


Hello!

It seems like there are a few areas that might be affecting your system’s performance:

  1. Software Rendering: Your system is currently using software rendering (llvmpipe) instead of hardware acceleration. This is indicated by the log entry:

    GL renderer: llvmpipe (LLVM 15.0.6, 128 bits)
    

    To address this, ensure that the appropriate GPU drivers are installed and configured for hardware acceleration. You can find more information on this topic here.

  2. Wayland Compositor Configuration: Consider using QtWayland instead of Weston for better performance, especially if you’re running Qt-based applications. QtWayland offers better integration and can enhance overall system performance. More details can be found here.

  3. Missing GPU Drivers: The log entry:

    MESA-LOADER: failed to open tidss: /usr/lib/dri/tidss_dri.so: cannot open shared object file
    

    suggests that some GPU drivers might be missing. Make sure these drivers are correctly installed.

Additionally, verify that your display configuration and device tree overlays are set up correctly. This can also impact performance. You can refer to this discussion for more insights.

If you need further assistance with any of these areas, feel free to ask!

Best regards,
Toradex AI Assistant

Greetings @daniel.l,

I believe Avalonia when used with Wayland, uses XWayland. This probably means the whole thing is not hardware accelerated and is not utilizing the GPU. Instead using the CPU for everything. This would explain why you’re seeing not-ideal performance.

While your application here is running could you check the CPU usage on the module. This would help to confirm whether it really is using the CPU for the graphics rendering.

Best Regards,
Jeremias

Hi, Jeremias

It does seem that the container app (M600DC) uses around 7-10% of CPU during idle and up to 90% when rendering other pages.

So I guess that the hardware acceleration is not working in that case. How can I enable it?

Best Regards,
Daniel

So I guess that the hardware acceleration is not working in that case. How can I enable it?

Well there’s not really anything you can do regarding this. I’m afraid the issue is more with the software support available. .NET Avalonia GTK uses XWayland. These days XWayland support for hardware acceleration is not that common. It would likely require some non-trival work on either Weston, the Avalona framework, or even both to get acceptable hardware acceleration.

Have you already settled on using .NET Avalona GTK in your project? Or are you flexible, on this or would it be a blocker for your project?

If Avalonia is what you want, then perhaps you could try the .NET Avalonia Framebuffer DRM template instead. This does not use Weston/Wayland and uses the framebuffer directly, which may yield better results.

Best Regards,
Jeremias

Dear Jeremias,

Thank you for your suggestions.
I’ve managed to switch the project from GTK to the FrameBuffer/DRM project. The application does indeed work better than earlier but now I’m facing a different problem. In the previous project the video player worked correctly but now when I’m in DRM mode I get errors. I guess it probably is due to the lack of the compositor? Can it be fixed or is there a guide on how to set it?

EDIT: It’s actually in FrameBuffer mode, I’ve mistaken the debug env variable with the docker one. DRM actually doesn’t work at all in my case :frowning:

ALSA lib confmisc.c:855:(parse_card) cannot find card ‘0’
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_card_inum returned error: No such file or directory
ALSA lib confmisc.c:422:(snd_func_concat) error evaluating strings
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1334:(snd_func_refer) error evaluating name
ALSA lib conf.c:5180:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5703:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2666:(snd_pcm_open_noupdate) Unknown PCM default
[000000559b7701c0] alsa audio output error: cannot open ALSA device “default”: No such file or directory
[000000559b7701c0] main audio output error: Audio output failed
[000000559b7701c0] main audio output error: The audio device “default” could not be used:
No such file or directory.
[000000559b7701c0] main audio output error: module not functional
[0000007e881b4b90] main decoder error: failed to create audio output
[0000007e60001410] gl vout display error: parent window not available
[0000007e60001410] gles2 vout display error: parent window not available
[0000007e60001410] xcb vout display error: window not available

Best Regards,
Daniel

I guess it probably is due to the lack of the compositor? Can it be fixed or is there a guide on how to set it?

I guess I was focused on the .NET Avalonia part of the software which does have support for direct framebuffer. Now the question would be whether this video player you’re using has support to use just framebuffer. Which admittedly I’m not really familiar with. If the video player you’re trying to use does not have support for framebuffer, and requires a compositor of some kind, then this would just be a dead-end I’m afraid.

It’s actually in FrameBuffer mode, I’ve mistaken the debug env variable with the docker one. DRM actually doesn’t work at all in my case

Not sure if I understand your comment here, are you saying the video player will not work at all in this case?

Best Regards,
Jeremias

When running in DRM mode i’m getting this in the logs and the performace seems worse than on FrameBuffer.

[+] Running 1/1
 ✔ Container torizon-m600dc-1  Created                                                                                       5.3s 
Attaching to m600dc-1
m600dc-1  | MESA-LOADER: failed to open tidss: /usr/lib/dri/tidss_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)
m600dc-1  | failed to load driver: tidss
m600dc-1  | Hello Torizon!

When it comes to the video player errors, I use libvlcsharp (which uses vlc) with the proper flags for running it in FrameBuffer.

private readonly LibVLC _libVlc = new("--vout=fb", "--fbdev=/dev/fb0");
        
    public MediaPlayer MediaPlayer { get; }
    
    public VideoViewModel()
    {
        MediaPlayer = new MediaPlayer(_libVlc);
        MediaPlayer.EnableHardwareDecoding = true;
        MediaPlayer.Volume = 0;
    }

The video player does seem to work in some way (at least the app doesn’t terminate) but there’s no video output and there are errors running in loop. Though I guess this problem isn’t strictly connected with torizon but rather with vlc itself.

[0000726ccc056030] main video output error: video output creation failed
[0000726cd4c022d0] main decoder error: failed to create video output
[mpeg4 @ 0x726cd4c275c0] get_buffer() failed
[mpeg4 @ 0x726cd4c275c0] thread_get_buffer() failed
[mpeg4 @ 0x726cd4c275c0] get_buffer() failed (-1 (nil))

Greetings @daniel.l,

I’m trying to investigate further here, but it’s strange. So you report you are getting this log in the container:

failed to open tidss: /usr/lib/dri/tidss_dri.so: cannot open shared object file: No such file or directory (search paths /usr/lib/aarch64-linux-gnu/dri:\$${ORIGIN}/dri:/usr/lib/dri, suffix _dri)

I noticed you got the same log in your Weston logs at the start of this thread. This is odd because this library is available in our containers. I checked myself and I can see it is at /usr/lib/aarch64-linux-gnu/dri/tidss_dri.so.

So I’m not sure why you’re getting log message saying this can’t be found.

I then tried to build and run the DRM/Framebuffer template myself to see if I see a similar log message. I’m building and running the default template with no modifications. This is what I see:

[+] Running 1/1
 ✔ Container torizon-test-1  Created                                                                                                                                                                                                                                                      1.3s 
Attaching to test-1
test-1  | Hello Torizon!

So yeah I can’t seem to reproduce the logs that you are seeing. Are you doing or changing anything in the default DRM/Frambeuffer template after you create the project?

Also what version of the IDE extension are you using here? I notice you are using Torizon OS 7.1.0 on your module, this means you should be using the early-access version of the extension for proper support.

Best Regards,
Jeremias

Hi,

I’ve updated the Torizon IDE to the pre-release version and it indeed worked! Now the performance is definetely much better and closer to what I expected.

Unfortunately I’m still dealing with the video player problem. I’ve already tried with vlc and mpv but both of them return similar errors which lead to video output errors. Can it be connected somehow with the OS devices permissions? It seems everything is set correctly in the docker.compose.yml file.

This is for example what mpv returned to me

torizon@verdin-am62-15380640:~/app$ mpv --vo=drm --drm-device=/dev/dri/card0 Assets/Videos/Calibr_vacuum_gauge.avi
 
 (+) Video --vid=1 (mpeg4 400x240 25.000fps)
 (+) Audio --aid=1 (mp3 1ch 44100Hz)
[vo/drm] VT_GETMODE failed: Inappropriate ioctl for device
[vo/drm] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/drm] Cannot set CRTC: Permission denied
Error opening/initializing the selected video_out (--vo) device.
Video: no video

Exiting... (Errors when loading file)

I’ve updated the Torizon IDE to the pre-release version and it indeed worked! Now the performance is definetely much better and closer to what I expected.

That’s good to hear.

Can it be connected somehow with the OS devices permissions? It seems everything is set correctly in the docker.compose.yml file.

If you think the issue is related to permissions in the container, you should confirm it. Try setting the privileged flag in your compose file for your container, mount all of /dev, and use the root user inside the container. This should more or less give you blanket permissions for just about everything inside the container.

If you still have issues with all of this, then it’s probably not a permission issue at that point I would say.

Best Regards,
Jeremias

Hi @daniel.l !

Do you have any updates regarding this topic?

How can we further support you? :slight_smile:

Best regards,

Hi,

In the end I’ve decided to implement my own Video Player using FFMpeg and SDL. Now it
seems to be working correctly.

Best Regards,
Daniel

Hi @daniel.l !

Thanks for the information! Good to know that your project is unblocked. I marked your latest message as the Solution.

Have a nice day! :slight_smile:

Best regards,