Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.48k stars 171 forks source link

Graphical issues with Linux build #921

Closed sftwninja closed 5 years ago

sftwninja commented 5 years ago

(I tried to look for similar issues but I might have missed one, if I did, my bad.)

OS: Ubuntu 18.04.1 LTS Haxe Compiler: 3.4.7 Kode Studio: 18.11.0 (latest at time of filing) Using open source AMD graphics drivers.

I tend to not see graphical issues really anywhere else on my system, so I'm pretty sure the system's ok. However, whenever I build a native Linux application (Kore) version of the default project Kode Studio creates, I see this:

screenshot from 2018-11-29 19-42-13

When I launch a Krom window, nothing happens at all. When I target HTML5, it ends up falling back to canvas and presents all sorts of artifacts.

dmesg reports the following

[372409.057007] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[388373.445190] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[391228.335595] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[391532.366797] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[395042.707749] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[403991.314105] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[405549.261202] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[415420.813102] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[415421.085267] [drm:radeon_dp_link_train [radeon]] *ERROR* channel eq failed: 5 tries
[415421.085278] [drm:radeon_dp_link_train [radeon]] *ERROR* channel eq failed
[418891.515632] radeon_dp_aux_transfer_native: 158 callbacks suppressed
[418891.790511] [drm:radeon_dp_link_train [radeon]] *ERROR* channel eq failed: 5 tries
[418891.790523] [drm:radeon_dp_link_train [radeon]] *ERROR* channel eq failed
[418891.846481] [drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery reached max voltage
[418891.846508] [drm:radeon_dp_link_train [radeon]] *ERROR* clock recovery failed
[418919.904703] radeon_dp_aux_transfer_native: 158 callbacks suppressed
RobDangerous commented 5 years ago

The first one is ok, the default project doesn't draw anything, on some systems you can see whatever was left in the framebuffer memory area in that situation - but that's according to Kha's specifications, framebuffer content is undefined at the beginning of a render callback. Just call the clear function. HTML5 is probably nothing we can fix - it falls back to canvas when the browser (or Electron if you use the html5 target in Kode Studio) decides that webgl is not appropriate on a system (usually because it detects a driver which is marked as unstable). Also when it falls back to canvas, the g2 api is just mapped very much directly to the canvas api, so artifacts are unlikely to be caused by Kha. Krom is something we can look into. Please try to start Krom from https://github.com/Kode/Krom_bin from the command line ala ´./Krom /path/to/project/build/krom´ and see what happens. When exactly did those driver panic messages happen?

sftwninja commented 5 years ago

Thanks for explaining the residual buffer garbage thing. I hadn't really even thought about that.

Went ahead and ran the Krom bin. Window came up no problem, no panics happened. Poked around for a bit, found out those had to do with my screen dimming on displayport which is just a driver issue. I can even replicate it just by logging out and back in, so that has nothing to do with Kha.

Thanks for your time and helping me understand what was going on. That tied up a lot of misconceptions I had made up in my head.